Unable to start after upgrade Docker container to latest
There seems to be a problem in the migrations since the latest version. I pulled the artifact.probo.inc/probo/probo:latest, just as normally when upgrading to the latest version. But now the container wont start anymore.
{"time":"2026-10-09T11:42:53.27716816Z","level":"INFO","msg":"shutting down metrics server","version":"0.307.0","environment":"prod","name":"probod.unit.metrics"} {"time":"2026-10-09T11:42:53.277301275Z","level":"INFO","msg":"metrics server shutdown","version":"0.307.0","environment":"prod","name":"probod.unit"} {"time":"2026-10-09T11:42:53.280381102Z","level":"INFO","msg":"trace exporter shutdown","version":"0.307.0","environment":"prod","name":"probod.unit"} {"time": "2026-10-09T11:42:53Z", "msg": "cannot run probod", "version": "0.307.0", "environment": "prod", "level": "ERROR", "name": "probod", "error": "cannot migrate database schema: cannot apply migration &{20261006T092010Z -- Copyright (c) 2026 Probo Inc [email protected].\n--\n-- Permission is hereby granted, free of charge, to any person obtaining a copy\n-- of this software and associated documentation files (the "Software"), to deal\n-- in the Software without restriction, including without limitation the rights\n-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n-- copies of the Software, and to permit persons to whom the Software is\n-- furnished to do so, subject to the following conditions:\n--\n-- The above copyright notice and this permission notice shall be included in\n-- all copies or substantial portions of the Software.\n--\n-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n-- SOFTWARE.\n\n-- Measures are internal controls. Rename the tables, columns, enum types,\n-- and stored values. Security and supplementary measures stay as they are.\n\nALTER TABLE measures RENAME TO internal_controls;\nALTER TABLE measures_documents RENAME TO internal_controls_documents;\nALTER TABLE measures_third_parties RENAME TO internal_controls_third_parties;\nALTER TABLE treatment_plans_measures RENAME TO treatment_plans_internal_controls;\nALTER TABLE controls_measures RENAME TO controls_internal_controls;\nALTER TABLE risks_measures RENAME TO risks_internal_controls;\nALTER TABLE measure_events RENAME TO internal_control_events;\n\nALTER TABLE internal_controls_documents RENAME COLUMN measure_id TO internal_control_id;\nALTER TABLE internal_controls_third_parties RENAME COLUMN measure_id TO internal_control_id;\nALTER TABLE treatment_plans_internal_controls RENAME COLUMN measure_id TO internal_control_id;\nALTER TABLE controls_internal_controls RENAME COLUMN measure_id TO internal_control_id;\nALTER TABLE risks_internal_controls RENAME COLUMN measure_id TO internal_control_id;\nALTER TABLE internal_control_events RENAME COLUMN measure_id TO internal_control_id;\nALTER TABLE internal_control_events RENAME COLUMN measure_created_at TO internal_control_created_at;\nALTER TABLE evidences RENAME COLUMN measure_id TO internal_control_id;\nALTER TABLE tasks RENAME COLUMN measure_id TO internal_control_id;\nALTER TABLE treatment_plan_events RENAME COLUMN measure_ids TO internal_control_ids;\n\nALTER TYPE measure_event_type RENAME TO internal_control_event_type;\nALTER TYPE task_activity_field RENAME VALUE 'MEASURE' TO 'INTERNAL_CONTROL';\nALTER TYPE treatment_plan_event_type RENAME VALUE 'MEASURE_LINKED' TO 'INTERNAL_CONTROL_LINKED';\nALTER TYPE treatment_plan_event_type RENAME VALUE 'MEASURE_UNLINKED' TO 'INTERNAL_CONTROL_UNLINKED';\n\nALTER TABLE evidences RENAME CONSTRAINT evidences_measure_id_fkey TO evidences_internal_control_id_fkey;\nALTER TABLE evidences RENAME CONSTRAINT evidences_measure_id_not_null TO evidences_internal_control_id_not_null;\n\nALTER TABLE internal_controls RENAME CONSTRAINT measures_implementation_status_not_null TO internal_controls_implementation_status_not_null;\nALTER TABLE internal_controls RENAME CONSTRAINT measures_operating_frequency_shape_check TO internal_controls_operating_frequency_shape_check;\nALTER TABLE internal_controls RENAME CONSTRAINT measures_organization_id_code_key TO internal_controls_organization_id_code_key;\nALTER TABLE internal_controls RENAME CONSTRAINT measures_owner_profile_id_fkey TO internal_controls_owner_profile_id_fkey;\nALTER TABLE internal_controls RENAME CONSTRAINT measures_owner_reviewer_distinct_check TO internal_controls_owner_reviewer_distinct_check;\nALTER TABLE internal_controls RENAME CONSTRAINT measures_reviewer_profile_id_fkey TO internal_controls_reviewer_profile_id_fkey;\nALTER TABLE internal_controls RENAME CONSTRAINT mitigations_org_ref_unique TO internal_controls_organization_id_reference_id_key;\n\nALTER TABLE controls_internal_controls RENAME CONSTRAINT controls_measures_organization_id_not_null TO controls_internal_controls_organization_id_not_null;\nALTER TABLE controls_internal_controls RENAME CONSTRAINT controls_mitigations_pkey TO controls_internal_controls_pkey;\nALTER TABLE controls_internal_controls RENAME CONSTRAINT fk_controls_mitigations_mitigation_id TO controls_internal_controls_internal_control_id_fkey;\n\nALTER TABLE risks_internal_controls RENAME CONSTRAINT risks_measures_organization_id_not_null TO risks_internal_controls_organization_id_not_null;\nALTER TABLE risks_internal_controls RENAME CONSTRAINT risks_mitigations_pkey TO risks_internal_controls_pkey;\nALTER TABLE risks_internal_controls DROP CONSTRAINT risks_mesures_mesure_id_fkey;\nALTER TABLE risks_internal_controls RENAME CONSTRAINT risks_mitigations_mitigation_id_fkey TO risks_internal_controls_internal_control_id_fkey;\n\nALTER TABLE internal_controls_documents RENAME CONSTRAINT measures_documents_created_at_not_null TO internal_controls_documents_created_at_not_null;\nALTER TABLE internal_controls_documents RENAME CONSTRAINT measures_documents_document_id_fkey TO internal_controls_documents_document_id_fkey;\nALTER TABLE internal_controls_documents RENAME CONSTRAINT measures_documents_document_id_not_null TO internal_controls_documents_document_id_not_null;\nALTER TABLE internal_controls_documents RENAME CONSTRAINT measures_documents_measure_id_fkey TO internal_controls_documents_internal_control_id_fkey;\nALTER TABLE internal_controls_documents RENAME CONSTRAINT measures_documents_measure_id_not_null TO internal_controls_documents_internal_control_id_not_null;\nALTER TABLE internal_controls_documents RENAME CONSTRAINT measures_documents_organization_id_not_null TO internal_controls_documents_organization_id_not_null;\nALTER TABLE internal_controls_documents RENAME CONSTRAINT measures_documents_pkey TO internal_controls_documents_pkey;\nALTER TABLE internal_controls_documents RENAME CONSTRAINT measures_documents_tenant_id_not_null TO internal_controls_documents_tenant_id_not_null;\n\nALTER TABLE internal_controls_third_parties RENAME CONSTRAINT measures_third_parties_created_at_not_null TO internal_controls_third_parties_created_at_not_null;\nALTER TABLE internal_controls_third_parties RENAME CONSTRAINT measures_third_parties_measure_id_fkey TO internal_controls_third_parties_internal_control_id_fkey;\nALTER TABLE internal_controls_third_parties RENAME CONSTRAINT measures_third_parties_measure_id_not_null TO internal_controls_third_parties_internal_control_id_not_null;\nALTER TABLE internal_controls_third_parties RENAME CONSTRAINT measures_third_parties_organization_id_not_null TO internal_controls_third_parties_organization_id_not_null;\nALTER TABLE internal_controls_third_parties RENAME CONSTRAINT measures_third_parties_pkey TO internal_controls_third_parties_pkey;\nALTER TABLE internal_controls_third_parties RENAME CONSTRAINT measures_third_parties_tenant_id_not_null TO internal_controls_third_parties_tenant_id_not_null;\nALTER TABLE internal_controls_third_parties RENAME CONSTRAINT measures_third_parties_third_party_id_fkey TO internal_controls_third_parties_third_party_id_fkey;\nALTER TABLE internal_controls_third_parties RENAME CONSTRAINT measures_third_parties_third_party_id_not_null TO internal_controls_third_parties_third_party_id_not_null;\n\nALTER TABLE treatment_plans_internal_controls RENAME CONSTRAINT treatment_plans_measures_created_at_not_null TO treatment_plans_internal_controls_created_at_not_null;\nALTER TABLE treatment_plans_internal_controls RENAME CONSTRAINT treatment_plans_measures_measure_id_fkey TO treatment_plans_internal_controls_internal_control_id_fkey;\nALTER TABLE treatment_plans_internal_controls RENAME CONSTRAINT treatment_plans_measures_measure_id_not_null TO treatment_plans_internal_controls_internal_control_id_not_null;\nALTER TABLE treatment_plans_internal_controls RENAME CONSTRAINT treatment_plans_measures_organization_id_fkey TO treatment_plans_internal_controls_organization_id_fkey;\nALTER TABLE treatment_plans_internal_controls RENAME CONSTRAINT treatment_plans_measures_organization_id_not_null TO treatment_plans_internal_controls_organization_id_not_null;\nALTER TABLE treatment_plans_internal_controls RENAME CONSTRAINT treatment_plans_measures_pkey TO treatment_plans_internal_controls_pkey;\nALTER TABLE treatment_plans_internal_controls RENAME CONSTRAINT treatment_plans_measures_tenant_id_not_null TO treatment_plans_internal_controls_tenant_id_not_null;\nALTER TABLE treatment_plans_internal_controls RENAME CONSTRAINT treatment_plans_measures_treatment_plan_id_fkey TO treatment_plans_internal_controls_treatment_plan_id_fkey;\nALTER TABLE treatment_plans_internal_controls RENAME CONSTRAINT treatment_plans_measures_treatment_plan_id_not_null TO treatment_plans_internal_controls_treatment_plan_id_not_null;\n\nALTER TABLE treatment_plan_events RENAME CONSTRAINT treatment_plan_events_measure_ids_not_null TO treatment_plan_events_internal_control_ids_not_null;\n\nALTER TABLE internal_control_events RENAME CONSTRAINT measure_events_category_not_null TO internal_control_events_category_not_null;\nALTER TABLE internal_control_events RENAME CONSTRAINT measure_events_created_at_not_null TO internal_control_events_created_at_not_null;\nALTER TABLE internal_control_events RENAME CONSTRAINT measure_events_event_type_not_null TO internal_control_events_event_type_not_null;\nALTER TABLE internal_control_events RENAME CONSTRAINT measure_events_measure_created_at_not_null TO internal_control_events_internal_control_created_at_not_null;\nALTER TABLE internal_control_events RENAME CONSTRAINT measure_events_measure_id_not_null TO internal_control_events_internal_control_id_not_null;\nALTER TABLE internal_control_events RENAME CONSTRAINT measure_events_name_not_null TO internal_control_events_name_not_null;\nALTER TABLE internal_control_events RENAME CONSTRAINT measure_events_organization_id_fkey TO internal_control_events_organization_id_fkey;\nALTER TABLE internal_control_events RENAME CONSTRAINT measure_events_organization_id_not_null TO internal_control_events_organization_id_not_null;\nALTER TABLE internal_control_events RENAME CONSTRAINT measure_events_state_not_null TO internal_control_events_state_not_null;\nALTER TABLE internal_control_events RENAME CONSTRAINT measure_events_tenant_id_not_null TO internal_control_events_tenant_id_not_null;\n\nALTER INDEX measures_search_idx RENAME TO internal_controls_search_idx;\n}: cannot execute migration: ERROR: constraint "evidences_measure_id_not_null" for table "evidences" does not exist (SQLSTATE 42704)"}\n
Hello,
Wich PG version do you use ?
This is the image in the compose.pod.yaml: postgres@sha256:7ad98329d513dd497293b951c195ca354274a77f12ddbbbbf85e68a811823d72
If I execute psql -V in the container the following version appears: psql (PostgreSQL) 17.9 (Debian 17.9-1.pgdg13+1)
I am sorry there is a version mismatch between https://github.com/getprobo/probo/blob/main/compose.prod.yaml and the PostgreSQL version we use locally, in tests, and on our own instance.
PostgreSQL 17 does not store NOT NULL as a named constraint, so renaming that constraint failed.
We are going to merge this pull request, which points the Compose file at Postgres 18.3: https://github.com/getprobo/probo/pull/2058. You will still need to upgrade your database server to PostgreSQL 18 before starting Probo. I strongly recommend making a backup first. If Postgres is the container from compose.prod.yaml, one way to do that is documented in the pull request.