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

DB schema missing after setup rework. #59

Closed
ckdake opened this issue Oct 6, 2020 · 3 comments
Closed

DB schema missing after setup rework. #59

ckdake opened this issue Oct 6, 2020 · 3 comments

Comments

@ckdake
Copy link
Contributor

ckdake commented Oct 6, 2020

Following the new instructions int he readme, it looks like the db schema is not getting setup correctly:

choochoo | running ch2 --base /data --db-bind postgresql --dev web service --web-bind 0.0.0.0 --warn-data --warn-secure
choochoo |
choochoo | INFO: Logging to /data/0-36/logs/web.log
choochoo | DEBUG: Formatting postgresql://{user}:{passwd}@{db-bind}:{db-port}/activity-{version}
choochoo | DEBUG: Connecting to postgresql://default:xxxxxx@postgresql:5432/activity-0-36
choochoo | DEBUG: Formatting postgresql://{user}:{passwd}@{db-bind}:{db-port}/activity-{version}
choochoo | DEBUG: Creating engine for postgresql://default:@PostgreSQL:5432/activity-0-36 with options {'echo': False, 'executemany_mode': 'values'} and connect args {}
postgresql | 2020-10-06 13:07:43.628 GMT [61] ERROR: relation "source" does not exist at character 97
postgresql | 2020-10-06 13:07:43.628 GMT [61] STATEMENT: SELECT count() AS count_1
postgresql | FROM (SELECT diary_topic_journal.id AS diary_topic_journal_id
postgresql | FROM source JOIN diary_topic_journal ON source.id = diary_topic_journal.id) AS anon_1
choochoo | DEBUG: Exception: (psycopg2.errors.UndefinedTable) relation "source" does not exist
choochoo | LINE 3: FROM source JOIN diary_topic_journal ON source.id = diary_to...
choochoo | ^
choochoo |
choochoo | [SQL: SELECT count(
) AS count_1
choochoo | FROM (SELECT diary_topic_journal.id AS diary_topic_journal_id
choochoo | FROM source JOIN diary_topic_journal ON source.id = diary_topic_journal.id) AS anon_1]
choochoo | (Background on this error at: http://sqlalche.me/e/13/f405)
choochoo | DEBUG: Type: <class 'sqlalchemy.exc.ProgrammingError'>
choochoo | DEBUG: Traceback:
choochoo | File "/usr/local/lib/python3.8/site-packages/ch2/sql/database.py", line 127, in no_data
choochoo | n_topics = s.query(DiaryTopicJournal.id).count()
choochoo | File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 3776, in count
choochoo | return self.from_self(col).scalar()
choochoo | File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 3496, in scalar
choochoo | ret = self.one()
choochoo | File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 3463, in one
choochoo | ret = self.one_or_none()
choochoo | File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 3432, in one_or_none
choochoo | ret = list(self)
choochoo | File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 3508, in iter
choochoo | return self._execute_and_instances(context)
choochoo | File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 3533, in _execute_and_instances
choochoo | result = conn.execute(querycontext.statement, self._params)
choochoo | File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1011, in execute
choochoo | return meth(self, multiparams, params)
choochoo | File "/usr/local/lib/python3.8/site-packages/sqlalchemy/sql/elements.py", line 298, in _execute_on_connection
choochoo | return connection._execute_clauseelement(self, multiparams, params)
choochoo | File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1124, in _execute_clauseelement
choochoo | ret = self._execute_context(
choochoo | File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1316, in _execute_context
choochoo | self.handle_dbapi_exception(
choochoo | File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1510, in handle_dbapi_exception
choochoo | util.raise
(
choochoo | File "/usr/local/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 182, in raise

choochoo | raise exception
choochoo | File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
choochoo | self.dialect.do_execute(
choochoo | File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 593, in do_execute
choochoo | cursor.execute(statement, parameters)
choochoo |
choochoo | DEBUG: Terminal width is 80
choochoo | INFO: Stopping any running service
postgresql | 2020-10-06 13:07:43.729 GMT [61] ERROR: relation "process" does not exist at character 195
postgresql | 2020-10-06 13:07:43.729 GMT [61] STATEMENT: SELECT process.id AS process_id, process.owner AS process_owner, process.pid AS process_pid, process.start AS process_start, process.command AS process_command, process.log AS process_log
postgresql | FROM process
postgresql | WHERE process.owner = 'WebServer'
postgresql | 2020-10-06 13:07:43.732 GMT [61] ERROR: relation "system_constant" does not exist at character 13
postgresql | 2020-10-06 13:07:43.732 GMT [61] STATEMENT: DELETE FROM system_constant WHERE system_constant.name = 'web-url'
choochoo | WARNING: Error (probably missing database): (psycopg2.errors.UndefinedTable) relation "process" does not exist
choochoo | DEBUG: Deleting web-url
choochoo | WARNING: Error (probably missing database): (psycopg2.errors.UndefinedTable) relation "system_constant" does not exist
choochoo | INFO: Starting a local service
choochoo | DEBUG: Binding to 0.0.0.0:8000
choochoo | INFO: * Running on http://0.0.0.0:8000/ (Press CTRL+C to quit)
choochoo | INFO: * Restarting with stat
choochoo | INFO: Logging to /data/0-36/logs/web.log
choochoo | DEBUG: Formatting postgresql://{user}:{passwd}@{db-bind}:{db-port}/activity-{version}
choochoo | DEBUG: Connecting to postgresql://default:xxxxxx@postgresql:5432/activity-0-36
choochoo | DEBUG: Formatting postgresql://{user}:{passwd}@{db-bind}:{db-port}/activity-{version}
choochoo | DEBUG: Creating engine for postgresql://default:@PostgreSQL:5432/activity-0-36 with options {'echo': False, 'executemany_mode': 'values'} and connect args {}
postgresql | 2020-10-06 13:07:47.586 GMT [62] ERROR: relation "source" does not exist at character 97
postgresql | 2020-10-06 13:07:47.586 GMT [62] STATEMENT: SELECT count() AS count_1
postgresql | FROM (SELECT diary_topic_journal.id AS diary_topic_journal_id
postgresql | FROM source JOIN diary_topic_journal ON source.id = diary_topic_journal.id) AS anon_1
choochoo | DEBUG: Exception: (psycopg2.errors.UndefinedTable) relation "source" does not exist
choochoo | LINE 3: FROM source JOIN diary_topic_journal ON source.id = diary_to...
choochoo | ^
choochoo |
choochoo | [SQL: SELECT count(
) AS count_1
choochoo | FROM (SELECT diary_topic_journal.id AS diary_topic_journal_id
choochoo | FROM source JOIN diary_topic_journal ON source.id = diary_topic_journal.id) AS anon_1]
choochoo | (Background on this error at: http://sqlalche.me/e/13/f405)
choochoo | DEBUG: Type: <class 'sqlalchemy.exc.ProgrammingError'>
choochoo | DEBUG: Traceback:
choochoo | File "/usr/local/lib/python3.8/site-packages/ch2/sql/database.py", line 127, in no_data
choochoo | n_topics = s.query(DiaryTopicJournal.id).count()
choochoo | File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 3776, in count
choochoo | return self.from_self(col).scalar()
choochoo | File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 3496, in scalar
choochoo | ret = self.one()
choochoo | File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 3463, in one
choochoo | ret = self.one_or_none()
choochoo | File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 3432, in one_or_none
choochoo | ret = list(self)
choochoo | File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 3508, in iter
choochoo | return self._execute_and_instances(context)
choochoo | File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 3533, in _execute_and_instances
choochoo | result = conn.execute(querycontext.statement, self._params)
choochoo | File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1011, in execute
choochoo | return meth(self, multiparams, params)
choochoo | File "/usr/local/lib/python3.8/site-packages/sqlalchemy/sql/elements.py", line 298, in _execute_on_connection
choochoo | return connection._execute_clauseelement(self, multiparams, params)
choochoo | File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1124, in _execute_clauseelement
choochoo | ret = self._execute_context(
choochoo | File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1316, in _execute_context
choochoo | self.handle_dbapi_exception(
choochoo | File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1510, in handle_dbapi_exception
choochoo | util.raise
(
choochoo | File "/usr/local/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 182, in raise

choochoo | raise exception
choochoo | File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
choochoo | self.dialect.do_execute(
choochoo | File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 593, in do_execute
choochoo | cursor.execute(statement, parameters)
choochoo |
choochoo | DEBUG: Terminal width is 80
choochoo | INFO: Stopping any running service
postgresql | 2020-10-06 13:07:47.790 GMT [62] ERROR: relation "process" does not exist at character 195
postgresql | 2020-10-06 13:07:47.790 GMT [62] STATEMENT: SELECT process.id AS process_id, process.owner AS process_owner, process.pid AS process_pid, process.start AS process_start, process.command AS process_command, process.log AS process_log
postgresql | FROM process
postgresql | WHERE process.owner = 'WebServer'
postgresql | 2020-10-06 13:07:47.793 GMT [62] ERROR: relation "system_constant" does not exist at character 13
postgresql | 2020-10-06 13:07:47.793 GMT [62] STATEMENT: DELETE FROM system_constant WHERE system_constant.name = 'web-url'
choochoo | WARNING: Error (probably missing database): (psycopg2.errors.UndefinedTable) relation "process" does not exist
choochoo | DEBUG: Deleting web-url
choochoo | WARNING: Error (probably missing database): (psycopg2.errors.UndefinedTable) relation "system_constant" does not exist
choochoo | INFO: Starting a local service
choochoo | DEBUG: Binding to 0.0.0.0:8000

@andrewcooke
Copy link
Owner

do you see any actual problems with functionality?

this looks like the database schema does not exist, which it does not until you create it via the GUI.

@ckdake
Copy link
Contributor Author

ckdake commented Oct 11, 2020

Looks like you are right, so this works fine once going into setup, but it is a little unsettling on the console. Ideally, there would not be exceptions and stack traces on the console when starting up, even when setup hasn't completed OR setup would be completed as part of the initial configuration. Is there a reason not to go ahead and do the setup at first boot?

@andrewcooke
Copy link
Owner

sorry; somehow this slipped through the cracks. but if it works then it's low priority right now - things are changing so much that this will likely change beyond recognition soon.

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