meeb / tubesync

Syncs YouTube channels and playlists to a locally hosted media server
GNU Affero General Public License v3.0
1.96k stars 123 forks source link

Just updated to latest and throws error #157

Closed Code-Slave closed 3 years ago

Code-Slave commented 3 years ago

I just pulled latest docker image and on startup this error pops up. On postgres

Traceback (most recent call last):

File "/app/manage.py", line 18, in

main()

File "/app/manage.py", line 14, in main

execute_from_command_line(sys.argv)

File "/usr/local/lib/python3.7/dist-packages/django/core/management/init.py", line 419, in execute_from_command_line

utility.execute()

File "/usr/local/lib/python3.7/dist-packages/django/core/management/init.py", line 413, in execute

self.fetch_command(subcommand).run_from_argv(self.argv)

File "/usr/local/lib/python3.7/dist-packages/django/core/management/base.py", line 354, in run_from_argv

self.execute(*args, **cmd_options)

File "/usr/local/lib/python3.7/dist-packages/django/core/management/base.py", line 398, in execute

output = self.handle(*args, **options)

File "/usr/local/lib/python3.7/dist-packages/background_task/management/commands/process_tasks.py", line 123, in handle

self.run(*args, **options)

File "/usr/local/lib/python3.7/dist-packages/background_task/management/commands/process_tasks.py", line 105, in run

if not self._tasks.run_next_task(queue):

File "/usr/local/lib/python3.7/dist-packages/background_task/tasks.py", line 137, in run_next_task

return self._runner.run_next_task(self, queue)

File "/usr/local/lib/python3.7/dist-packages/background_task/tasks.py", line 261, in run_next_task

task = self.get_task_to_run(tasks, queue)

File "/usr/local/lib/python3.7/dist-packages/background_task/tasks.py", line 245, in get_task_to_run

available_tasks = [task for task in Task.objects.find_available(queue)

File "/usr/local/lib/python3.7/dist-packages/background_task/models.py", line 57, in find_available

currently_failed = self.failed().count()

File "/usr/local/lib/python3.7/dist-packages/django/db/models/query.py", line 412, in count

return self.query.get_count(using=self.db)

File "/usr/local/lib/python3.7/dist-packages/django/db/models/sql/query.py", line 519, in get_count

number = obj.get_aggregation(using, ['__count'])['__count']

File "/usr/local/lib/python3.7/dist-packages/django/db/models/sql/query.py", line 504, in get_aggregation

result = compiler.execute_sql(SINGLE)

File "/usr/local/lib/python3.7/dist-packages/django/db/models/sql/compiler.py", line 1173, in execute_sql

cursor = self.connection.cursor()

File "/usr/local/lib/python3.7/dist-packages/django/utils/asyncio.py", line 26, in inner

return func(*args, **kwargs)

File "/usr/local/lib/python3.7/dist-packages/django/db/backends/base/base.py", line 259, in cursor

return self._cursor()

File "/usr/local/lib/python3.7/dist-packages/django/db/backends/base/base.py", line 235, in _cursor

self.ensure_connection()

File "/app/tubesync/dbutils.py", line 20, in ensure_connection

self.connect()

File "/usr/local/lib/python3.7/dist-packages/django/utils/asyncio.py", line 26, in inner

return func(*args, **kwargs)

File "/usr/local/lib/python3.7/dist-packages/django/db/backends/base/base.py", line 201, in connect

self.set_autocommit(self.settings_dict['AUTOCOMMIT'])

File "/usr/local/lib/python3.7/dist-packages/django/db/backends/base/base.py", line 415, in set_autocommit

self._set_autocommit(autocommit)

File "/usr/local/lib/python3.7/dist-packages/django/db/backends/postgresql/base.py", line 277, in _set_autocommit

self.connection.autocommit = autocommit

File "/usr/local/lib/python3.7/dist-packages/django/db/utils.py", line 90, in exit

raise dj_exc_value.with_traceback(traceback) from exc_value

File "/usr/local/lib/python3.7/dist-packages/django/db/backends/postgresql/base.py", line 277, in _set_autocommit

self.connection.autocommit = autocommit

django.db.utils.ProgrammingError: set_session cannot be used inside a transaction

meeb commented 3 years ago

Annoying, I thought this was fixed. I'll check it again. Thanks.

meeb commented 3 years ago

I'll close this as a dupe of #135 and re-open that.

meeb commented 3 years ago

I've just disabled the keep-alives for Postgres as it probably doesn't need them. Wait for the image to build then give :latest a go and see if it's fixed it for you.

Code-Slave commented 3 years ago

that seems to have fixed it Thanks