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

Migration failed to run #671

Closed
4 tasks
successx opened this issue Jan 19, 2023 · 1 comment
Closed
4 tasks

Migration failed to run #671

successx opened this issue Jan 19, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@successx
Copy link

Bug description

Migration script fail connect to postgres with custom password.

Expected behavior

Migration script should use password set from deployment.

Actual behavior

Error log
psycopg2.OperationalError: FATAL: password authentication failed for user "postgres" The above exception was the direct cause of the following exception: Traceback (most recent call last): File "manage.py", line 21, in <module> main() File "manage.py", line 17, in main execute_from_command_line(sys.argv) File "/python-runtime/django/core/management/__init__.py", line 419, in execute_from_command_line utility.execute() File "/python-runtime/django/core/management/__init__.py", line 395, in execute django.setup() File "/python-runtime/django/__init__.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "/python-runtime/django/apps/registry.py", line 122, in populate app_config.ready() File "/code/posthog/apps.py", line 52, in ready in_range, version = service_version_requirement.is_service_in_accepted_version() File "/code/posthog/version_requirement.py", line 28, in is_service_in_accepted_version service_version = self.get_service_version() File "/code/posthog/version_requirement.py", line 33, in get_service_version return get_postgres_version() File "/code/posthog/version_requirement.py", line 45, in get_postgres_version with connection.cursor() as cursor: File "/python-runtime/django/utils/asyncio.py", line 33, in inner return func(*args, **kwargs) File "/python-runtime/django/db/backends/base/base.py", line 259, in cursor return self._cursor() File "/python-runtime/django/db/backends/base/base.py", line 235, in _cursor self.ensure_connection() File "/python-runtime/django/utils/asyncio.py", line 33, in inner return func(*args, **kwargs) File "/python-runtime/django/db/backends/base/base.py", line 219, in ensure_connection self.connect() File "/python-runtime/django/db/utils.py", line 90, in __exit__ raise dj_exc_value.with_traceback(traceback) from exc_value File "/python-runtime/django/db/backends/base/base.py", line 219, in ensure_connection self.connect() File "/python-runtime/django/utils/asyncio.py", line 33, in inner return func(*args, **kwargs) File "/python-runtime/django/db/backends/base/base.py", line 200, in connect self.connection = self.get_new_connection(conn_params) File "/python-runtime/django/utils/asyncio.py", line 33, in inner return func(*args, **kwargs) File "/python-runtime/django/db/backends/postgresql/base.py", line 187, in get_new_connection connection = Database.connect(**conn_params) File "/python-runtime/psycopg2/__init__.py", line 127, in connect conn = _connect(dsn, connection_factory=connection_factory, **kwasync) django.db.utils.OperationalError: FATAL: password authentication failed for user "postgres"

How to reproduce

  1. Deploy app version 1.41.3 with postgresqlPassword
  2. Upgrade to 1.43.0

Environment

  • Deployment platform (AWS/Azure/DigitalOcean/GCP/...): Digital Ocean
  • k8s version (server version from kubectl version): Kubernetes 1.24.4-do.0
  • Chart version/commit (helm list -n posthog): posthog-30.3.2
  • Posthog version: 1.43.0

Additional context

We also saw another error while upgrading as below:
Error: UPGRADE FAILED: cannot patch "posthog-posthog-kafka" with kind StatefulSet: StatefulSet.apps "posthog-posthog-kafka" is invalid: spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'template', 'updateStrategy', 'persistentVolumeClaimRetentionPolicy' and 'minReadySeconds' are forbidden && cannot patch "posthog-posthog-postgresql" with kind StatefulSet: StatefulSet.apps "posthog-posthog-postgresql" is invalid: spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'template', 'updateStrategy', 'persistentVolumeClaimRetentionPolicy' and 'minReadySeconds' are forbidden

We've tried to rollback to 1.41.3 but posthog-plugins and posthog-worker do not restart. Please help on this. Thanks!

@successx successx added the bug Something isn't working label Jan 19, 2023
@successx
Copy link
Author

Sorry, using wrong repo for update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant