Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opensips-cli fails to run with sqlite #128

Open
ryankurte opened this issue Aug 25, 2024 · 0 comments
Open

opensips-cli fails to run with sqlite #128

ryankurte opened this issue Aug 25, 2024 · 0 comments

Comments

@ryankurte
Copy link

howdy, i'm trying to configure an sqlite database but struggling to find documentation / running into an error.

attempting to configure an sqlite database reports: sqlalchemy.exc.ArgumentError: Could not parse SQLAlchemy URL from string '"sqlite://', and single or double (triple or quadruple) slashes doesn't appear to make a difference.

.opensips-cli.cfg:

[default]
database_url="sqlite:////var/lib/opensips/opensips.sqlite"
database_admin_url="sqlite:////var/lib/opensips/opensips.sqlite"
database_modules="ALL"
full backtrace:

opensips-cli -d -x database create
DEBUG: using config file /home/ryan/.opensips-cli.cfg
Traceback (most recent call last):
  File "/usr/bin/opensips-cli", line 9, in <module>
    run_console()
  File "/usr/bin/opensips-cli", line 6, in run_console
    main.main()
  File "/usr/lib/python3/dist-packages/opensipscli/main.py", line 77, in main
    shell = cli.OpenSIPSCLI(args)
            ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/opensipscli/cli.py", line 90, in __init__
    self.update_instance(cfg.current_instance)
  File "/usr/lib/python3/dist-packages/opensipscli/cli.py", line 166, in update_instance
    excl_mod = mod.__exclude__(mod)
               ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/opensipscli/modules/database.py", line 469, in __exclude__
    return (not osdb.has_dialect(osdb.get_dialect(db_url)), None)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/opensipscli/db.py", line 767, in has_dialect
    sqlalchemy.create_engine('{}://'.format(dialect))
  File "<string>", line 2, in create_engine
  File "/usr/lib/python3/dist-packages/sqlalchemy/util/deprecations.py", line 375, in warned
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/sqlalchemy/engine/create.py", line 518, in create_engine
    u = _url.make_url(url)
        ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/sqlalchemy/engine/url.py", line 738, in make_url
    return _parse_url(name_or_url)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/sqlalchemy/engine/url.py", line 799, in _parse_url
    raise exc.ArgumentError(
sqlalchemy.exc.ArgumentError: Could not parse SQLAlchemy URL from string '"sqlite://'

there's also a possibly related issue on the mailing list: https://opensips.org/pipermail/users/2020-August/043637.html, and appears similar to but distinct from #66.

i was also wondering if there is any documentation on the expected configuration for the db_sqlite module in the main opensips config? the module page doesn't provide many clues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant