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

Missing table on fresh 2.0.2 install #687

Closed
OttPeterR opened this issue Jul 24, 2023 · 5 comments · Fixed by #688
Closed

Missing table on fresh 2.0.2 install #687

OttPeterR opened this issue Jul 24, 2023 · 5 comments · Fixed by #688
Labels
bug Reports of unexpected problems or errors
Milestone

Comments

@OttPeterR
Copy link
Contributor

Hey @cdubz, almost ready with the HA Addon rollout of v2 (very late, I know...) and I'm seeing this show up in the logs. Seems to be a db migration issue maybe where the sqlite3.OperationalError: no such table: cache_default is the error coming from babybuddy/apps.py:50. This is from a fresh install of v2.0.2. Maybe you just need to throw in a creation of that table in the migrations if it doesn't already exist?

Full logs here:

s6-rc: info: service base-addon-banner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service base-addon-log-level: starting
s6-rc: info: service fix-attrs successfully started
Log level is set to INFO
s6-rc: info: service base-addon-log-level successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/babybuddy.sh
**** No secret key found, generating one ****
Operations to perform:
  Apply all migrations: admin, auth, authtoken, axes, babybuddy, contenttypes, core, dbsettings, sessions
Running migrations:
  No migrations to apply.
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/django/db/backends/sqlite3/base.py", line 328, in execute
    return super().execute(query, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sqlite3.OperationalError: no such table: cache_default
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/app/babybuddy/manage.py", line 26, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/lib/python3.11/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/usr/lib/python3.11/site-packages/django/core/management/__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python3.11/site-packages/django/core/management/base.py", line 412, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/lib/python3.11/site-packages/django/core/management/base.py", line 458, in execute
    output = self.handle(*args, **options)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/babybuddy/babybuddy/management/commands/migrate.py", line 10, in handle
    super(Command, self).handle(*args, **kwargs)
  File "/usr/lib/python3.11/site-packages/django/core/management/base.py", line 106, in wrapper
    res = handle_func(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/django/core/management/commands/migrate.py", line 383, in handle
    emit_post_migrate_signal(
  File "/usr/lib/python3.11/site-packages/django/core/management/sql.py", line 52, in emit_post_migrate_signal
    models.signals.post_migrate.send(
  File "/usr/lib/python3.11/site-packages/django/dispatch/dispatcher.py", line 176, in send
    return [
           ^
  File "/usr/lib/python3.11/site-packages/django/dispatch/dispatcher.py", line 177, in <listcomp>
    (receiver, receiver(signal=self, sender=sender, **named))
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/babybuddy/babybuddy/apps.py", line 50, in set_default_site_settings
    set_setting_value("core.models", class_name, attribute_name, value)
  File "/usr/lib/python3.11/site-packages/dbsettings/loading.py", line 93, in set_setting_value
    cache.delete(key)
  File "/usr/lib/python3.11/site-packages/django/core/cache/backends/db.py", line 207, in delete
    return self._base_delete_many([key])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/django/core/cache/backends/db.py", line 223, in _base_delete_many
    cursor.execute(
  File "/usr/lib/python3.11/site-packages/django/db/backends/utils.py", line 67, in execute
    return self._execute_with_wrappers(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers
    return executor(sql, params, many, context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/django/db/backends/utils.py", line 84, in _execute
    with self.db.wrap_database_errors:
  File "/usr/lib/python3.11/site-packages/django/db/utils.py", line 91, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/usr/lib/python3.11/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/django/db/backends/sqlite3/base.py", line 328, in execute
    return super().execute(query, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
django.db.utils.OperationalError: no such table: cache_default
cont-init: info: /etc/cont-init.d/babybuddy.sh exited 1
cont-init: info: running /etc/cont-init.d/nginx.sh
cont-init: info: /etc/cont-init.d/nginx.sh exited 0
cont-init: warning: some scripts exited nonzero
s6-rc: warning: unable to start service legacy-cont-init: command exited 1
/run/s6/basedir/scripts/rc.init: warning: s6-rc failed to properly bring all the services up! Check your logs (in /run/uncaught-logs/current if you have in-container logging) for more information.
/run/s6/basedir/scripts/rc.init: fatal: stopping the container.
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service base-addon-log-level: stopping
s6-rc: info: service base-addon-log-level successfully stopped
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service base-addon-banner: stopping
s6-rc: info: service base-addon-banner successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

I

@OttPeterR OttPeterR changed the title Error while Missing table on fresh 2.0.2 install Jul 24, 2023
@cdubz
Copy link
Member

cdubz commented Jul 24, 2023

It seems odd to me that I would not have already done this... wonder if I'm breaking some edge case here. Are you able to test with #688 or does it need to be merged and released for your testing?

@cdubz cdubz added the bug Reports of unexpected problems or errors label Jul 24, 2023
@MrApplejuice
Copy link
Contributor

I encountered the same issue while working on https://github.com/OttPeterR/addon-babybuddy . I tried to fix this by switching around the createcachetable and migrate commands. However, admittedly that was just a "hail mary"-move without me understanding what I am doing. Worked for me though. Just FYI!

@OttPeterR
Copy link
Contributor Author

I've been working off of the .tar.gz archive on each release, doing essentially the same thing that linuxserver.io is doing. Pretty sure that archive is just a code snapshot though, so I think I should be able to get it working without you needing to make a release. That said, if you're going to make a release fairly soon I'll just wait for that.

@cdubz
Copy link
Member

cdubz commented Jul 26, 2023

OK. I'm mostly convinced this fine so I'll just cut a new bugfix release. We'll do it live!

@cdubz cdubz added this to the 2.0.3 milestone Jul 26, 2023
@OttPeterR
Copy link
Contributor Author

Alright with the release and MrAppleJuice's tip, it's up and running, thanks for all the help guys!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Reports of unexpected problems or errors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants