mirror of
https://github.com/jeffknupp/sandman2.git
synced 2026-04-26 09:05:55 +03:00
[GH-ISSUE #175] Error creating backref #69
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
pull-request
question
refactoring
research
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/sandman2-jeffknupp#69
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @joshiparth1000 on GitHub (Sep 7, 2020).
Original GitHub issue: https://github.com/jeffknupp/sandman2/issues/175
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 commented on GitHub (Mar 26, 2021):
Looks like a Duplicate of #71