0

I have a Django App deployed via AWS' elastic beanstalk, that uses the CodePipeline service to build. As part of that pipeline, the CodeBuild service is used to build the app that gets deployed to the ElasticBeanstalk environment.

The build failed, sending the following error message:

django.core.exceptions.ImproperlyConfigured: SQLite 3.9.0 or later is required (found 3.7.17).

Per Amazon's own package version listing I realize that is expected given the older version is intended to be on the Amazon Linux 2 distro.

Ok. I wrote a shell script to download the latest version of SQLite and build from scratch, but I'm still getting the same issue.

In the buildspec.yaml file I have the following:

...    
  post_build:
    commands:
      - echo "beginning post-build phase..."
      - bash get_sqlite.sh
      - echo "sqlite version -- $(sqlite3 --version)"
      - python manage.py makemigrations
      ...

In the CodeBuild logs, I can see the result of the echo command as such:

sqlite version -- 3.40.1 2022-12-28

Yet, the build fails and the logs still show the following error:

django.core.exceptions.ImproperlyConfigured: SQLite 3.9.0 or later is required (found 3.7.17).

Any idea what further steps need to be taken for the updated version to be detected rather than the previous one?

1 Answer 1

0

I think you need to move your sqlite command to bin directory in linux.

- mv sqlite /usr/local/bin/

Even though package has been updated but linux reads PATH ( env variable to find the commands ) and still it is finding the old version of the command, that is hwy you need to replace the old sqlite command with the new version in bin directory

Sign up to request clarification or add additional context in comments.

3 Comments

Tried that to no avail
Can you check the path of your sqlite command using where is sqlite to verify its path ?
Before: /usr/bin/sqlite3 /usr/include/sqlite3.h /usr/local/android-sdk-linux/platform-tools/sqlite3 /usr/share/man/man1/sqlite3.1.gz After install: /usr/bin/sqlite3 /usr/local/bin/sqlite3 /usr/include/sqlite3.h /usr/local/android-sdk-linux/platform-tools/sqlite3 /usr/share/man/man1/sqlite3.1.gz This is the command I ran: mv /usr/bin/local/sqlite3/ /usr/bin/sqlite3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.