0

While trying to deploy a Django application (with sqlite db) to Beanstalk I get the error:

"deterministic=True requires SQLite 3.8.3 or higher"

The solution seems to be to upgrade sqlite and set LD_LIBRARY_PATH. So I'm adding this to .ebextensions/app.config:

option_settings:
  aws:elasticbeanstalk:application:environment:
    LD_LIBRARY_PATH: /usr/local/lib

commands:

  01_upgrade_sqlite:
    command: "cd ~ && wget https://www.sqlite.org/2020/sqlite-autoconf-3320100.tar.gz && tar xvfz sqlite-autoconf-3320100.tar.gz && cd sqlite-autoconf-3320100 && ./configure && make && make install"

But whatever I try, the environment variable LD_LIBRARY_PATH is not set. I've check by logging into the environment (eb ssh) and executing an env command. I've also tried setting the environment variable in a command under both commands and container_commands. To no avail. Am I missing something?

EDIT: Some related discussions (non with a solution though):

Berco Beute
  • 1,115
  • 15
  • 30

1 Answers1

0

You have to explicitly load these variables to use them in your scripts.

You can try:

commands:

  01_upgrade_sqlite:
    command: |
        export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(/opt/elasticbeanstalk/bin/get-config environment -k LD_LIBRARY_PATH)
        echo "$LD_LIBRARY_PATH"    
        cd ~
        wget https://www.sqlite.org/2020/sqlite-autoconf-3320100.tar.gz 
        tar xvfz sqlite-autoconf-3320100.tar.gz
        cd sqlite-autoconf-3320100 && ./configure
        make && make install

or

commands:

  01_upgrade_sqlite:
    command: |
        export $(cat /opt/elasticbeanstalk/deployment/env | xargs)
        echo "$LD_LIBRARY_PATH"    
        cd ~
        wget https://www.sqlite.org/2020/sqlite-autoconf-3320100.tar.gz 
        tar xvfz sqlite-autoconf-3320100.tar.gz
        cd sqlite-autoconf-3320100 && ./configure
        make && make install

Marcin
  • 215,873
  • 14
  • 235
  • 294
  • Thanks, but Django still gives me `deterministic=True requires SQLite 3.8.3 or higher`. And doing an `env` after ssh'ing into the environment doesn't show me the LD_LIBRARY_PATH as an environment variable. Or did you mean that you have to set them explicitely for every script you run? So also when starting Django? I'm not sure how to get to the EB script that starts the Django application, though. – Berco Beute Apr 18 '21 at 09:16
  • @BercoBeute Does your `01_upgrade_sqlite` run without any errors? Can you ssh to the eb instance and verify that the new `sqlite` was correctly installed? – Marcin Apr 18 '21 at 09:30
  • SSH'ing into the eb instance and starting sqlite3 shows me version `SQLite version 3.32.1`. So that looks OK. The logs (`eb logs`) don't show any errors either. But when the Django app tries to use sqlite it throws: ```create_deterministic_function('django_date_extract', 2, _sqlite_datetime_extract)", "django.db.utils.NotSupportedError: deterministic=True requires SQLite 3.8.3 or higher"``` – Berco Beute Apr 18 '21 at 12:07
  • I'm getting the same error @BercoBeute . Did you find a solution for this? – Excalibur Oct 27 '21 at 17:47