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?

alphazwest
  • 3,483
  • 1
  • 27
  • 39

1 Answers1

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

Jatin Mehrotra
  • 9,286
  • 4
  • 28
  • 67
  • Tried that to no avail – alphazwest Jan 06 '23 at 15:07
  • Can you check the path of your sqlite command using where is sqlite to verify its path ? – Jatin Mehrotra Jan 06 '23 at 20:08
  • 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` – alphazwest Jan 06 '23 at 20:58