Hi Tyler
On apphost the /tmp folder reference is the location on the container where you would want to configure your sqllite database.
Typically if you were using an integration server environment (non container) we would be referencing a folder on the integration server.
If used on apphost and the container were to restart the database would be overwritten.
When we are using apphost we therefore use postgres connection to an external database.
If you would like to test with postgres , I can message you privately and share some quick docker environment setup commands to test.
I have it running on a linux environment.
Regards
John
------------------------------
John Quirke
------------------------------
Original Message:
Sent: Tue August 24, 2021 05:16 PM
From: Tyler Bennett
Subject: app-fn_scheduler database configuration
So to be clear, it is not recommended to use datastore_dir when configuring this app on an apphost? Do you have any details for how to create the postgres system? I know next to nothing about postgres or container networking and the docs are extremely sparse.
My assumption is we can create a postgres database on the apphost, then configure the containers to connect to the apphost database. Can you layout the steps to create this database, and allow container access to it?
------------------------------
Tyler Bennett
Original Message:
Sent: Tue August 24, 2021 04:51 PM
From: Mark Scherfling
Subject: app-fn_scheduler database configuration
Hi Tyler,
I believe the issue is permissions within the container. A better location within the container would be datastore_dir=/var/rescircuits. This location is intended for app file access.
Keep in mind that containers are ephemeral. They can be restarted and the state of the container is reset, losing your schedules. This is where we now support external a postgre databases. Rather than using datastore_dir=
, use db_url=postgresql+pypostgresql://username:password@host:port/database
referencing an externally accessible database.
Regards,
Mark
------------------------------
Mark Scherfling
Original Message:
Sent: Tue August 24, 2021 01:14 PM
From: Tyler Bennett
Subject: app-fn_scheduler database configuration
I followed those steps exactly.
Logged onto the dev apphost and ran
$ mkdir /tmp/scheduler.sqlite

I guess I raise a ticket with IBM then?
------------------------------
Tyler Bennett
Original Message:
Sent: Tue August 24, 2021 12:50 PM
From: Mark Scherfling
Subject: app-fn_scheduler database configuration
I followed similar steps:
$ mkdir /tmp/scheduler.sqlite
My app.config file:
[fn_scheduler]
timezone=America/New_York
thread_max=20
datastore_dir=/tmp/scheduler.sqlite
Then, the sqlite file is created:
ls /tmp/scheduler.sqlite/scheduler.sqlite
------------------------------
Mark Scherfling
Original Message:
Sent: Tue August 24, 2021 12:03 PM
From: Tyler Bennett
Subject: app-fn_scheduler database configuration
Okay, that makes sense.
I configured the following folder for testing in dev.
mkdir /tmp/app-fn_scheduler-sqllite
Then tries the following two configurations and received the same error messages.
datastore_dir = /tmp/app-fn_scheduler-sqllite
datastore_dir = /tmp/app-fn_scheduler-sqllite/
Then I made the folder world writeable and get the same error messages.
chmod 777 /tmp/app-fn_scheduler-sqllite
datastore_dir = /tmp/app-fn_scheduler-sqllite
datastore_dir = /tmp/app-fn_scheduler-sqllite/
Error for all four attempts is as follows
fn-scheduler: selftest: failure selftest output: {'state': 'failure', 'reason': '(sqlite3.OperationalError) unable to open database file\n(Background on this error at: http://sqlalche.me/e/14/e3q8)'} Elapsed time: 0.025000 seconds
------------------------------
Tyler Bennett
Original Message:
Sent: Tue August 24, 2021 10:33 AM
From: Mark Scherfling
Subject: app-fn_scheduler database configuration
Hi Tyler,
I do agree that it's a bit of confusing. The app.config setting `datastore_dir` refers to a directory where the app will create the `scheduler.sqlite` file. So, make sure your entry is a `folder`:
mkdir /tmp/app-fn_scheduler
------------------------------
Mark Scherfling
Original Message:
Sent: Mon August 23, 2021 05:54 PM
From: Tyler Bennett
Subject: app-fn_scheduler database configuration
Can I get some guidance on deploying the app-fn_scheduler? I've read the documentation but it's not really straightforward on the setup of the sqllite/psql database connection.
We are using appHosts.
I tried the following option in the configuration and touched the file on disk(on the dev apphost)
datastore_dir = /tmp/app-fn_scheduler.sqllite
fn-scheduler: selftest: failure selftest output: {'state': 'failure', 'reason': '(sqlite3.OperationalError) unable to open database file\n(Background on this error at: http://sqlalche.me/e/14/e3q8)'} Elapsed time: 0.025000 seconds
touch /tmp/app-fn_scheduler.sqllite
chmod 777 /tmp/app-fn_scheduler.sqllite
-----------------------------
Tyler Bennett
------------------------------