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

Watchtower not triggering database migrations on UAT #1985

Open
pgwillia opened this issue Nov 12, 2020 · 2 comments
Open

Watchtower not triggering database migrations on UAT #1985

pgwillia opened this issue Nov 12, 2020 · 2 comments

Comments

@pgwillia
Copy link
Member

Describe the bug
Migrations are not being run when Watchtower triggers an update to the container.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://era.uat.library.ualberta.ca
  2. Search for anything
  3. See 500 error page

Expected behavior
When a container is updated, run all migrations and precompile assets.

Additional context
This was an example of an error that was the result of not running a migration

web_1       | I, [2020-11-12T19:57:18.868866 #12]  INFO -- : [c93db739-8fb9-4c04-98cd-a9c0d8d4bf5d] Completed 500 Internal Server Error in 9ms (ActiveRecord: 2.0ms | Allocations: 1533)
web_1       | F, [2020-11-12T19:57:18.870637 #12] FATAL -- : [c93db739-8fb9-4c04-98cd-a9c0d8d4bf5d]
web_1       | [c93db739-8fb9-4c04-98cd-a9c0d8d4bf5d] ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR:  relation "flipper_gates" does not exist
web_1       | LINE 8:  WHERE a.attrelid = '"flipper_gates"'::regclass
web_1       |                             ^
web_1       | ):

Watchtower does have hooks for this purpose. Something about this is not working:

com.centurylinklabs.watchtower.lifecycle.post-update: "watchtower-post-update.sh"

@pgwillia
Copy link
Member Author

Still experiencing this!

@pgwillia
Copy link
Member Author

Might not be watchtower specific. Seems like the whole db is wiped clean.

root@905a02639488:/app# rails db:migrate
W, [2021-10-29T16:34:43.090311 #8]  WARN -- Skylight: [SKYLIGHT] [4.3.2] You are running in the uat environment but haven't added it to config.skylight.environments, so no data will be sent to Skylight servers.
I, [2021-10-29T16:34:43.710811 #8]  INFO -- : Migrating to CreateUsers (20170714174108)
== 20170714174108 CreateUsers: migrating ======================================
-- create_table(:users, {})
   -> 0.0582s
-- add_index(:users, :email, {:unique=>true})
   -> 0.0247s
== 20170714174108 CreateUsers: migrated (0.0832s) =============================

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant