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

Error creating backref #175

Open
joshiparth1000 opened this issue Sep 7, 2020 · 1 comment
Open

Error creating backref #175

joshiparth1000 opened this issue Sep 7, 2020 · 1 comment

Comments

@joshiparth1000
Copy link

joshiparth1000 commented Sep 7, 2020

I am trying to use this with Apache Guacamole mysql database. I am getting the below error when running sandman2ctl

Traceback (most recent call last):
File "/usr/local/bin/sandman2ctl", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.8/site-packages/sandman2/main.py", line 51, in main
app = get_app(args.URI, read_only=args.read_only, schema=args.schema)
File "/usr/local/lib/python3.8/site-packages/sandman2/app.py", line 60, in get_app
_reflect_all(exclude_tables, admin, read_only, schema=schema)
File "/usr/local/lib/python3.8/site-packages/sandman2/app.py", line 139, in _reflect_all
register_model(cls, admin)
File "/usr/local/lib/python3.8/site-packages/sandman2/app.py", line 156, in register_model
cols = list(cls().table.primary_key.columns)
File "", line 2, in init
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/instrumentation.py", line 373, in _new_state_if_none
state = self._state_constructor(instance, self)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/util/langhelpers.py", line 855, in get
obj.dict[self.name] = result = self.fget(obj)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/instrumentation.py", line 199, in state_constructor
self.dispatch.first_init(self, self.class
)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/event/attr.py", line 297, in call
fn(*args, **kw)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/mapper.py", line 3341, in _event_on_first_init
configure_mappers()
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/mapper.py", line 3229, in configure_mappers
mapper._post_configure_properties()
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/mapper.py", line 1947, in _post_configure_properties
prop.init()
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/interfaces.py", line 196, in init
self.do_init()
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/relationships.py", line 1864, in do_init
self._generate_backref()
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/relationships.py", line 2069, in _generate_backref
raise sa_exc.ArgumentError(
sqlalchemy.exc.ArgumentError: Error creating backref 'guacamole_user_group_collection' on relationship 'guacamole_user_group.guacamole_entity_collection': property of that name exists on mapper 'mapped class guacamole_entity->guacamole_entity'

The dockerfile I use to containerize the app is this:
FROM python:3-alpine

RUN pip install sandman2 mysql-connector-python

CMD ["sandman2ctl", "mysql+mysqlconnector://guacamole:axway123@172.17.0.1/guacamole"]

EXPOSE 5000

The db schema for reference can be generated with the below command:
docker run --rm guacamole/guacamole /opt/guacamole/bin/initdb.sh --postgres > initdb.sql

@mperreir
Copy link

Looks like a Duplicate of #71

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

2 participants