diff --git a/remoteappmanager/db/orm.py b/remoteappmanager/db/orm.py
index 7111d0b..f877d5a 100644
--- a/remoteappmanager/db/orm.py
+++ b/remoteappmanager/db/orm.py
@@ -1,5 +1,6 @@
 import contextlib
 import hashlib
+import os
 
 from sqlalchemy import (
     Column, Integer, Boolean, Unicode, ForeignKey, create_engine, Enum,
@@ -157,6 +158,21 @@ class AppAccounting(ABCAccounting):
 
     def __init__(self, url, **kwargs):
         self.db = Database(url, **kwargs)
+        self.check_database_readable()
+
+    def check_database_readable(self):
+        ''' Raise IOError if the database url points to a sqlite database
+        that is not readable
+
+        TODO: may extend for validating databases in other dialects?
+        '''
+        db_url = self.db.url
+
+        if db_url.startswith('sqlite:///'):
+            file_path = os.path.abspath(db_url[10:])
+            if not os.access(file_path, os.R_OK):
+                raise IOError(
+                    'Sqlite database {} is not readable'.format(file_path))
 
     def get_user_by_name(self, user_name):
         """ Return an orm.User given a user name.  Return None

Sqlite database file created if it does not exist
Similar to #113, when `remoteappmanager` is started with its default accounting setting and that the default sqlite database does not exist, an empty file `remoteappmanager.db` would be created.

diff --git a/tests/db/test_interfaces.py b/tests/db/test_interfaces.py
index 02ced52..4ed20d0 100644
--- a/tests/db/test_interfaces.py
+++ b/tests/db/test_interfaces.py
@@ -8,7 +8,7 @@ from collections import namedtuple
 
 from remoteappmanager.db.interfaces import (
     ABCApplication, ABCApplicationPolicy, ABCAccounting)
-from .abc_test_interfaces import ABCTestDatabaseInterface
+from tests.db.abc_test_interfaces import ABCTestDatabaseInterface
 
 User = namedtuple('User', ('name',))
 
diff --git a/tests/db/test_orm.py b/tests/db/test_orm.py
index 2869b94..6c1052c 100644
--- a/tests/db/test_orm.py
+++ b/tests/db/test_orm.py
@@ -199,3 +199,12 @@ class TestOrmAppAccounting(TempMixin, ABCTestDatabaseInterface,
 
         self.assertEqual(actual_app, expected_config[0][0])
         self.assertEqual(actual_policy, expected_config[0][1])
+
+    def test_no_file_creation_if_sqlite_database_not_exist(self):
+        temp_file_path = os.path.join(self.tempdir, 'some.db')
+
+        with self.assertRaises(IOError):
+            AppAccounting(
+                url="sqlite:///"+temp_file_path)
+
+        self.assertFalse(os.path.exists(temp_file_path))

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest numpy>=1.16.0 pandas>=1.0.0
apt-get update apt-get install -y gcc
3.9
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alembic==1.15.2
annotated-types==0.7.0
arrow==1.3.0
async-generator==1.10
attrs==25.3.0
certifi==2025.1.31
certipy==0.2.2
cffi==1.17.1
charset-normalizer==3.4.1
click==8.1.8
cryptography==44.0.2
docker-py==1.10.6
docker-pycreds==0.4.0
escapism==1.0.1
exceptiongroup==1.2.2
fqdn==1.5.1
greenlet==3.1.1
idna==3.10
importlib_metadata==8.6.1
iniconfig==2.1.0
isoduration==20.11.0
Jinja2==3.1.6
jsonpointer==3.0.0
jsonschema==4.23.0
jsonschema-specifications==2024.10.1
jupyter-events==0.12.0
jupyter_client==8.6.3
jupyter_core==5.7.2
jupyterhub==5.2.1
Mako==1.3.9
MarkupSafe==3.0.2
numpy==2.0.2
oauthlib==3.2.2
packaging==24.2
pamela==1.2.0
pandas==2.2.3
platformdirs==4.3.7
pluggy==1.5.0
prometheus_client==0.21.1
pycparser==2.22
pydantic==2.11.1
pydantic_core==2.33.0
pytest==8.3.5
python-dateutil==2.9.0.post0
python-json-logger==3.3.0
pytz==2025.2
PyYAML==6.0.2
pyzmq==26.3.0
referencing==0.36.2
-e git+https://github.com/simphony/simphony-remote.git@3ceb572ce98207102f14d1b11491fc2edd85aaac#egg=remoteappmanager
requests==2.32.3
rfc3339-validator==0.1.4
rfc3986-validator==0.1.1
rpds-py==0.24.0
six==1.17.0
SQLAlchemy==2.0.40
tabulate==0.9.0
tomli==2.2.1
tornado==6.4.2
traitlets==5.14.3
types-python-dateutil==2.9.0.20241206
typing-inspection==0.4.0
typing_extensions==4.13.0
tzdata==2025.2
uri-template==1.3.0
urllib3==2.3.0
webcolors==24.11.1
websocket-client==1.8.0
zipp==3.21.0

name: simphony-remote
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - alembic==1.15.2
      - annotated-types==0.7.0
      - arrow==1.3.0
      - async-generator==1.10
      - attrs==25.3.0
      - certifi==2025.1.31
      - certipy==0.2.2
      - cffi==1.17.1
      - charset-normalizer==3.4.1
      - click==8.1.8
      - cryptography==44.0.2
      - docker-py==1.10.6
      - docker-pycreds==0.4.0
      - escapism==1.0.1
      - exceptiongroup==1.2.2
      - fqdn==1.5.1
      - greenlet==3.1.1
      - idna==3.10
      - importlib-metadata==8.6.1
      - iniconfig==2.1.0
      - isoduration==20.11.0
      - jinja2==3.1.6
      - jsonpointer==3.0.0
      - jsonschema==4.23.0
      - jsonschema-specifications==2024.10.1
      - jupyter-client==8.6.3
      - jupyter-core==5.7.2
      - jupyter-events==0.12.0
      - jupyterhub==5.2.1
      - mako==1.3.9
      - markupsafe==3.0.2
      - numpy==2.0.2
      - oauthlib==3.2.2
      - packaging==24.2
      - pamela==1.2.0
      - pandas==2.2.3
      - platformdirs==4.3.7
      - pluggy==1.5.0
      - prometheus-client==0.21.1
      - pycparser==2.22
      - pydantic==2.11.1
      - pydantic-core==2.33.0
      - pytest==8.3.5
      - python-dateutil==2.9.0.post0
      - python-json-logger==3.3.0
      - pytz==2025.2
      - pyyaml==6.0.2
      - pyzmq==26.3.0
      - referencing==0.36.2
      - requests==2.32.3
      - rfc3339-validator==0.1.4
      - rfc3986-validator==0.1.1
      - rpds-py==0.24.0
      - six==1.17.0
      - sqlalchemy==2.0.40
      - tabulate==0.9.0
      - tomli==2.2.1
      - tornado==6.4.2
      - traitlets==5.14.3
      - types-python-dateutil==2.9.0.20241206
      - typing-extensions==4.13.0
      - typing-inspection==0.4.0
      - tzdata==2025.2
      - uri-template==1.3.0
      - urllib3==2.3.0
      - webcolors==24.11.1
      - websocket-client==1.8.0
      - zipp==3.21.0
prefix: /opt/conda/envs/simphony-remote

tests/db/test_orm.py::TestOrmAppAccounting::test_no_file_creation_if_sqlite_database_not_exist
tests/db/test_orm.py::TestOrm::test_apps_for_user tests/db/test_orm.py::TestOrmAppAccounting::test_get_apps_for_user tests/db/test_orm.py::TestOrmAppAccounting::test_get_apps_for_user_across_sessions tests/db/test_orm.py::TestOrmAppAccounting::test_get_apps_for_user_mapping_id_rest_compliant
tests/db/test_interfaces.py::TestDatabaseInterface::test_get_apps_for_user tests/db/test_interfaces.py::TestDatabaseInterface::test_get_apps_for_user_mapping_id_rest_compliant tests/db/test_interfaces.py::TestDatabaseInterface::test_get_user_by_name tests/db/test_orm.py::TestOrm::test_database_init_and_session tests/db/test_orm.py::TestOrm::test_orm_objects tests/db/test_orm.py::TestOrmAppAccounting::test_get_user_by_name
remoteappmanager/db/orm.py
remoteappmanager/db/orm.py