Hi Mohamad,
You cannot use SQLite with App Host because containers are ephemeral and the database will not persist after a container restart.
https://ibmresilient.github.io/resilient-community-apps/fn_scheduler/README.html#migrating-to-v1-0-2
******
# db url if using a postgreSQL DB. Use this with AppHost
# db_url=postgresql://username:password***@host:port/database (or) db_url=postgresql+pypostgresql://username:password***@host:port/database
Use this setting rather than the SQLite datastore_dir
setting to persist the scheduler DB in PostgreSQL. This is necessary in an App Host environment to retain your schedules outside the app container.
********
In short, stand up Postgres elsewhere and point the scheduler application to it so the data persists regardless of whether the container is restarted. You cannot use Postgres that comes with SOAR.
------------------------------
BEN WILLIAMS
------------------------------
Original Message:
Sent: Fri May 16, 2025 01:28 AM
From: Mohamad islam Hamadieh
Subject: app-fn_scheduler database configuration
hi @Mark Scherfling , please let me know if you know of a fix for this issue , thanks.
------------------------------
Mohamad islam Hamadieh
I post SOAR content and tips on linkedIn , follow me :)
https://linkedin.com/in/mohamadislam
Original Message:
Sent: Thu May 08, 2025 03:44 AM
From: Mohamad islam Hamadieh
Subject: app-fn_scheduler database configuration
Hi Mark ,
I have tried both creating in /tmp (from apphost ssh) and /etc/rescircuits/ (from app config GUI)
I tried inputting both directories and files in datastore_dir = with no luck.
also I have done chmod 777 on both the files and directories
some examples I used :
datastore_dir =/tmp/test.sqlite(where test.sqlite is a directory)
datastore_dir =/tmp/file.sqlite(where file.sqlite is a file)
datastore_dir = /etc/rescircuits/test.sqlite
datastore_dir = /etc/rescircuits/test
datastore_dir = /etc/rescircuits/test/test.sqlite
it always returns the same error :
return self.loaded_dbapi.connect(*cargs, **cparams) sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) unable to open database file (Background on this error at: https://sqlalche.me/e/20/e3q8)
also tried DEBUG log level its returning the same error
------------------------------
Mohamad islam Hamadieh
I post SOAR content and tips on linkedIn , follow me :)
https://linkedin.com/in/mohamadislam
Original Message:
Sent: Mon May 05, 2025 07:47 AM
From: Mark Scherfling
Subject: app-fn_scheduler database configuration
Hi Mohamad,
Can yo share what your app.config file looks like? It should contain the setting `datastore_dir` to reference the directory which the sqlite file will reside, such as /tmp.
------------------------------
Mark Scherfling
Original Message:
Sent: Mon May 05, 2025 06:37 AM
From: Mohamad islam Hamadieh
Subject: app-fn_scheduler database configuration
Hi all ,
In my scenario , I don't care if the schedules got deleted once a restart is performed.
Still Im not able to get an app host version to work with sqlite , I have tried creating the file from the GUI and referencing it in the app with no luck.
If anyone have that working, I would appreciate the help, thanks.
------------------------------
Mohamad islam Hamadieh
I post SOAR content and tips on linkedIn , follow me :)
https://linkedin.com/in/mohamadislam
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
------------------------------