GithubHelp home page GithubHelp logo

Comments (14)

zeratax avatar zeratax commented on June 2, 2024

hmm so afaik this help page only appears if no arguments are passed or the -h/--help argument.

otherwise it should look like this, even if only the --config-path is being set:

Usage: matrix-registration [OPTIONS] COMMAND [ARGS]...
Try 'matrix-registration -h' for help.

Error: Missing command.

You're command looks correct though, but i'm not that familiar with docker compose

from matrix-registration.

jahlives avatar jahlives commented on June 2, 2024

@zeratax
Could hardly imagine that the arguments are not passed, as the very same command does properly work with matrix-registration v 0.8.0 and I have many docker setups (compose) which use command like the above and there is no problem

from matrix-registration.

jahlives avatar jahlives commented on June 2, 2024

weird is the following message from logs

registration            | 2021-05-28T07:25:05.547871948Z Usage: matrix-registration [OPTIONS] COMMAND [ARGS]...
registration            | 2021-05-28T07:25:05.547940420Z Try 'matrix-registration -h' for help.
registration            | 2021-05-28T07:25:05.547953560Z 
registration            | 2021-05-28T07:25:05.547962189Z Error: No such command 'matrix-registration'.

first claims wrong (missing) params then claiming command does not exist at all???

from matrix-registration.

jahlives avatar jahlives commented on June 2, 2024

@zeratax

regarding the image: I should have used docker inspect earlier. Seems the image has an entrypoint

 "Entrypoint": [
                "/nix/store/y611r8b86zv0l2r2xnlf408j718f62xl-python3.8-matrix-registration/bin/matrix-registration",
                "--config-path=/data/config.yaml"
            ],

so my command doubled ;-) I'd recommend to remove the --config-path from entrypoint or else it cannot be specified via cli in command.
Still having an issue with the latest version from pip, according to error there is something missing in my config.yaml

AttributeError: 'Config' object has no attribute 'client_redirect'

currently back to 0.8.0 from pip, will try again the latest version and fix the config later today

from matrix-registration.

jahlives avatar jahlives commented on June 2, 2024

okay it works now with latest version from pip. Had to change config.yaml
As for reasons above I cannot use the image. But also with version from pip I have two open "issues"

  1. client_redirect dos NOT redirect to given url. Instead after register it redirects to register page again
  2. not sure that -m when creating a token does what it should. Registered 3 test users with that token but api/token still shows me its used once only

from matrix-registration.

zeratax avatar zeratax commented on June 2, 2024

it will use the last provided --config-path. so you should be able to just overwrite it

from matrix-registration.

jahlives avatar jahlives commented on June 2, 2024

if I try it with your image and overwrite with the following command

"Cmd": [
                "matrix-registration",
                "--config-path",
                "/etc/config.yaml",
                "serve"
            ],

I still get

registration            | 2021-05-28T11:32:30.542062146Z Usage: matrix-registration [OPTIONS] COMMAND [ARGS]...
registration            | 2021-05-28T11:32:30.542109005Z Try 'matrix-registration -h' for help.
registration            | 2021-05-28T11:32:30.542118073Z 
registration            | 2021-05-28T11:32:30.542125135Z Error: No such command 'matrix-registration'.
registration            | 2021-05-28T11:32:41.920007513Z Usage: matrix-registration [OPTIONS] COMMAND [ARGS]...
registration            | 2021-05-28T11:32:41.920069286Z Try 'matrix-registration -h' for help.
registration            | 2021-05-28T11:32:41.920086826Z 
registration            | 2021-05-28T11:32:41.920100459Z Error: No such command 'matrix-registration'.

but anyway that's okay with me as I just can use the latest version from pip and with that it works as expected

from matrix-registration.

zeratax avatar zeratax commented on June 2, 2024

no I mean can't you just do:

"Cmd": [
  "--config-path",
  "/etc/config.yaml",
  "serve"
],

that should result in:

$ /nix/store/y611r8b86zv0l2r2xnlf408j718f62xl-python3.8-matrix-registration/bin/matrix-registration \
  --config-path /data/config.yaml \
  --config-path /etc/config.yaml \
  serve

where only the last config-path should be used

from matrix-registration.

jahlives avatar jahlives commented on June 2, 2024

@zeratax
tried that which results in the following process being fired up

/nix/store/qy5z9gcld7dljm4i5hj3z8a9l6p37y81-python3-3.8.8/bin/python3.8 /nix/store/y611r8b86zv0l2r2xnlf408j718f62xl-python3.8-matrix-registration/bin/.matrix-registration-wrapped --config-path=/data/config.yaml --config-path /etc/config.yaml serve

but then it throws exceptions that the db cannot be opened

registration            | 2021-05-29T12:45:17.137905524Z Traceback (most recent call last):
registration            | 2021-05-29T12:45:17.137970719Z   File "/nix/store/pw7vpy2x39sc50ydmqf2klqaymi51cqf-python3.8-SQLAlchemy-1.3.19/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 2338, in _wrap_pool_connect
registration            | 2021-05-29T12:45:17.137987552Z     return fn()
registration            | 2021-05-29T12:45:17.137995117Z   File "/nix/store/pw7vpy2x39sc50ydmqf2klqaymi51cqf-python3.8-SQLAlchemy-1.3.19/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 364, in connect
registration            | 2021-05-29T12:45:17.138002701Z     return _ConnectionFairy._checkout(self)
registration            | 2021-05-29T12:45:17.138009755Z   File "/nix/store/pw7vpy2x39sc50ydmqf2klqaymi51cqf-python3.8-SQLAlchemy-1.3.19/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 778, in _checkout
registration            | 2021-05-29T12:45:17.138017387Z     fairy = _ConnectionRecord.checkout(pool)
registration            | 2021-05-29T12:45:17.138024434Z   File "/nix/store/pw7vpy2x39sc50ydmqf2klqaymi51cqf-python3.8-SQLAlchemy-1.3.19/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 495, in checkout
registration            | 2021-05-29T12:45:17.138031856Z     rec = pool._do_get()
registration            | 2021-05-29T12:45:17.138038726Z   File "/nix/store/pw7vpy2x39sc50ydmqf2klqaymi51cqf-python3.8-SQLAlchemy-1.3.19/lib/python3.8/site-packages/sqlalchemy/pool/impl.py", line 239, in _do_get
registration            | 2021-05-29T12:45:17.138046129Z     return self._create_connection()
registration            | 2021-05-29T12:45:17.138053047Z   File "/nix/store/pw7vpy2x39sc50ydmqf2klqaymi51cqf-python3.8-SQLAlchemy-1.3.19/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 309, in _create_connection
registration            | 2021-05-29T12:45:17.138060454Z     return _ConnectionRecord(self)
registration            | 2021-05-29T12:45:17.138067311Z   File "/nix/store/pw7vpy2x39sc50ydmqf2klqaymi51cqf-python3.8-SQLAlchemy-1.3.19/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 440, in __init__
registration            | 2021-05-29T12:45:17.138074679Z     self.__connect(first_connect_check=True)
registration            | 2021-05-29T12:45:17.138081592Z   File "/nix/store/pw7vpy2x39sc50ydmqf2klqaymi51cqf-python3.8-SQLAlchemy-1.3.19/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 661, in __connect
registration            | 2021-05-29T12:45:17.138088986Z     pool.logger.debug("Error on connect(): %s", e)
registration            | 2021-05-29T12:45:17.138095986Z   File "/nix/store/pw7vpy2x39sc50ydmqf2klqaymi51cqf-python3.8-SQLAlchemy-1.3.19/lib/python3.8/site-packages/sqlalchemy/util/langhelpers.py", line 68, in __exit__
registration            | 2021-05-29T12:45:17.138103421Z     compat.raise_(
registration            | 2021-05-29T12:45:17.138110248Z   File "/nix/store/pw7vpy2x39sc50ydmqf2klqaymi51cqf-python3.8-SQLAlchemy-1.3.19/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
registration            | 2021-05-29T12:45:17.138117597Z     raise exception
registration            | 2021-05-29T12:45:17.138126212Z   File "/nix/store/pw7vpy2x39sc50ydmqf2klqaymi51cqf-python3.8-SQLAlchemy-1.3.19/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 656, in __connect
registration            | 2021-05-29T12:45:17.138134089Z     connection = pool._invoke_creator(self)
registration            | 2021-05-29T12:45:17.138141083Z   File "/nix/store/pw7vpy2x39sc50ydmqf2klqaymi51cqf-python3.8-SQLAlchemy-1.3.19/lib/python3.8/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect
registration            | 2021-05-29T12:45:17.138148523Z     return dialect.connect(*cargs, **cparams)
registration            | 2021-05-29T12:45:17.138161494Z   File "/nix/store/pw7vpy2x39sc50ydmqf2klqaymi51cqf-python3.8-SQLAlchemy-1.3.19/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 493, in connect
registration            | 2021-05-29T12:45:17.138169981Z     return self.dbapi.connect(*cargs, **cparams)
registration            | 2021-05-29T12:45:17.138177044Z sqlite3.OperationalError: unable to open database file

guess it tries the /data path to find the db (from first --config-path)

from matrix-registration.

zeratax avatar zeratax commented on June 2, 2024

it definitely shouldn't. the db is handled like everything else:

$ grep db configA.yaml
db: 'sqlite:///{cwd}dbA.sqlite3'
$ grep db configB.yaml
db: 'sqlite:///{cwd}dbB.sqlite3'
$ matrix-registration --config-path=configA.yaml --config-path=configB.yaml generate
UserColonyTaboo
$ ls db*
dbB.sqlite3

Here the first config-path argument has absolutely no effect.

Are you sure there isn't just a mistake with your config file? sqlalchemy expects an absolute path, so if you want to do a relative path it should look like this

db: 'sqlite:///{cwd}db.sqlite3'

where cwd will be replaced by the current working directory

from matrix-registration.

jahlives avatar jahlives commented on June 2, 2024

@zeratax

I have the following three mounts in my docker-compose

        volumes:
            - "./configs/synapse-registration/register.html:/usr/local/lib/python3.9/site-packages/matrix_registration/templates/register.html:ro"
            - "./data/matrix-registration/:/data/"
            - "./configs/synapse-registration/config.yaml:/etc/config.yaml:ro"

and config.yaml defines db as db: 'sqlite:///{cwd}/data/db.sqlite3'
If I use this command command: ["--config-path","/etc/config.yaml","serve"] together with the image it throws the shown exceptions.

from matrix-registration.

zeratax avatar zeratax commented on June 2, 2024

okay sorry the documentation here is wrong and idk how I didn't notice this earlier, but the config file is read in the docker environment so the db isn't in {cwd}/data/db.sqlite3, but /data/db.sqlite3

so it should be:

db: 'sqlite:////data/db.sqlite3'

from matrix-registration.

jahlives avatar jahlives commented on June 2, 2024

@zeratax
tried that but still same exceptions. Tried with 3 and 4 / although I think 3 / should be correct. Anyway the pip version works perfectly, so I keep using this one. Thank you for your patience and your work for the registration. Really a great tool that I love to use 👍

from matrix-registration.

zeratax avatar zeratax commented on June 2, 2024

since i can't reproduce this at all and you seem to have found a solution I'll consider this fixed until someone says otherwise ^^

from matrix-registration.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.