Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps - Status | Demo | Docs | Install
  1. Cloudron Forum
  2. Documenso
  3. Documenso does not come up after update to 1.6.0

Documenso does not come up after update to 1.6.0

Scheduled Pinned Locked Moved Documenso
16 Posts 6 Posters 2.3k Views 6 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • jamesJ Offline
    jamesJ Offline
    james
    Staff
    wrote on last edited by james
    #5

    I just tried to reproduce this error and got the following log:

    Jul 29 10:31:49 ==> Create / Migrate db
    Jul 29 10:31:50 => Healthcheck error: Error: connect ECONNREFUSED 172.18.19.52:3000
    Jul 29 10:31:51 \Prisma schema loaded from packages/prisma/schema.prisma
    Jul 29 10:31:51 Datasource "db": PostgreSQL database "db806162892d894b9f84f2eafb933ba9d4", schema "public" at "postgresql:5432"
    Jul 29 10:31:51 2025-07-29T08:31:51Z
    Jul 29 10:31:51 132 migrations found in prisma/migrations
    Jul 29 10:31:51 2025-07-29T08:31:51Z
    Jul 29 10:31:51 Applying migration `20250522054049_add_id_generator`
    Jul 29 10:31:51 Applying migration `20250522054050_add_organisations`
    Jul 29 10:31:51 Applying migration `20250611052525_add_session_revoke_enum`
    Jul 29 10:31:51 2025-07-29T08:31:51Z
    Jul 29 10:31:51 The following migration(s) have been applied:
    Jul 29 10:31:51 2025-07-29T08:31:51Z
    Jul 29 10:31:51 migrations/
    Jul 29 10:31:51 └─ 20250522054049_add_id_generator/
    Jul 29 10:31:51 └─ migration.sql
    Jul 29 10:31:51 └─ 20250522054050_add_organisations/
    Jul 29 10:31:51 └─ migration.sql
    Jul 29 10:31:51 └─ 20250611052525_add_session_revoke_enum/
    Jul 29 10:31:51 └─ migration.sql
    Jul 29 10:31:51 2025-07-29T08:31:51Z
    Jul 29 10:31:51 All migrations have been successfully applied.
    

    The app update was successful, and the app is in a healthy state.


    @pepicrft a restore to the previous backup did not work? Did I get this right?


    @marcusquinn said in Documenso does not come up after update to 1.6.0:

    Seems to be a problem with other apps, too.

    What other apps are you experiencing this issue with?

    marcusquinnM 1 Reply Last reply
    1
    • jamesJ Offline
      jamesJ Offline
      james
      Staff
      wrote on last edited by
      #6

      Please follow these steps:

      While the app is installed and in an error state for version 1.6.0:

      • enable the recovery mode in the app settings
      • open the web terminal
      • insert the following
         export DATABASE_URL=postgres://${CLOUDRON_POSTGRESQL_USERNAME}:${CLOUDRON_POSTGRESQL_PASSWORD}@${CLOUDRON_POSTGRESQL_HOST}:${CLOUDRON_POSTGRESQL_PORT}/${CLOUDRON_POSTGRESQL_DATABASE}
         export NEXT_PRIVATE_DATABASE_URL=postgres://${CLOUDRON_POSTGRESQL_USERNAME}:${CLOUDRON_POSTGRESQL_PASSWORD}@${CLOUDRON_POSTGRESQL_HOST}:${CLOUDRON_POSTGRESQL_PORT}/${CLOUDRON_POSTGRESQL_DATABASE}
         export NEXT_PRIVATE_DIRECT_DATABASE_URL=postgres://${CLOUDRON_POSTGRESQL_USERNAME}:${CLOUDRON_POSTGRESQL_PASSWORD}@${CLOUDRON_POSTGRESQL_HOST}:${CLOUDRON_POSTGRESQL_PORT}/${CLOUDRON_POSTGRESQL_DATABASE}
         npx prisma migrate status --schema ./packages/prisma/schema.prisma
        

      Post the output of this command here.

      Since each migration in the _prisma_migrations table has a logs column that stores the error we can also inspect that with:

      PGPASSWORD=${CLOUDRON_POSTGRESQL_PASSWORD} psql -h ${CLOUDRON_POSTGRESQL_HOST} -p ${CLOUDRON_POSTGRESQL_PORT} -U ${CLOUDRON_POSTGRESQL_USERNAME} -d ${CLOUDRON_POSTGRESQL_DATABASE} -c "SELECT id,migration_name,started_at,rolled_back_at,logs FROM _prisma_migrations;"
      

      and see what migration failed and has logs for further analysis.


      For @CaeruleusAqua since the log provided the migration failed is 20250522054050_add_organisations we can attempt the following while the app is in recovery mode:

      export DATABASE_URL=postgres://${CLOUDRON_POSTGRESQL_USERNAME}:${CLOUDRON_POSTGRESQL_PASSWORD}@${CLOUDRON_POSTGRESQL_HOST}:${CLOUDRON_POSTGRESQL_PORT}/${CLOUDRON_POSTGRESQL_DATABASE}
      export NEXT_PRIVATE_DATABASE_URL=postgres://${CLOUDRON_POSTGRESQL_USERNAME}:${CLOUDRON_POSTGRESQL_PASSWORD}@${CLOUDRON_POSTGRESQL_HOST}:${CLOUDRON_POSTGRESQL_PORT}/${CLOUDRON_POSTGRESQL_DATABASE}
      export NEXT_PRIVATE_DIRECT_DATABASE_URL=postgres://${CLOUDRON_POSTGRESQL_USERNAME}:${CLOUDRON_POSTGRESQL_PASSWORD}@${CLOUDRON_POSTGRESQL_HOST}:${CLOUDRON_POSTGRESQL_PORT}/${CLOUDRON_POSTGRESQL_DATABASE}
      
      # Mark the migration as rolled back - this updates the migration record in the _prisma_migrations table to register it as rolled back, allowing it to be applied again:
      npx prisma migrate resolve --rolled-back 20250522054050_add_organisations --schema ./packages/prisma/schema.prisma
      # Try to re-deploy the migration
      npx prisma migrate deploy --schema ./packages/prisma/schema.prisma
      
      1 Reply Last reply
      0
      • J Offline
        J Offline
        joseph
        Staff
        wrote on last edited by
        #7

        Seems to work fine for me in my test server. Can you give postgres more memory ? https://docs.cloudron.io/services/#configure

        1 Reply Last reply
        0
        • jamesJ james

          I just tried to reproduce this error and got the following log:

          Jul 29 10:31:49 ==> Create / Migrate db
          Jul 29 10:31:50 => Healthcheck error: Error: connect ECONNREFUSED 172.18.19.52:3000
          Jul 29 10:31:51 \Prisma schema loaded from packages/prisma/schema.prisma
          Jul 29 10:31:51 Datasource "db": PostgreSQL database "db806162892d894b9f84f2eafb933ba9d4", schema "public" at "postgresql:5432"
          Jul 29 10:31:51 2025-07-29T08:31:51Z
          Jul 29 10:31:51 132 migrations found in prisma/migrations
          Jul 29 10:31:51 2025-07-29T08:31:51Z
          Jul 29 10:31:51 Applying migration `20250522054049_add_id_generator`
          Jul 29 10:31:51 Applying migration `20250522054050_add_organisations`
          Jul 29 10:31:51 Applying migration `20250611052525_add_session_revoke_enum`
          Jul 29 10:31:51 2025-07-29T08:31:51Z
          Jul 29 10:31:51 The following migration(s) have been applied:
          Jul 29 10:31:51 2025-07-29T08:31:51Z
          Jul 29 10:31:51 migrations/
          Jul 29 10:31:51 └─ 20250522054049_add_id_generator/
          Jul 29 10:31:51 └─ migration.sql
          Jul 29 10:31:51 └─ 20250522054050_add_organisations/
          Jul 29 10:31:51 └─ migration.sql
          Jul 29 10:31:51 └─ 20250611052525_add_session_revoke_enum/
          Jul 29 10:31:51 └─ migration.sql
          Jul 29 10:31:51 2025-07-29T08:31:51Z
          Jul 29 10:31:51 All migrations have been successfully applied.
          

          The app update was successful, and the app is in a healthy state.


          @pepicrft a restore to the previous backup did not work? Did I get this right?


          @marcusquinn said in Documenso does not come up after update to 1.6.0:

          Seems to be a problem with other apps, too.

          What other apps are you experiencing this issue with?

          marcusquinnM Offline
          marcusquinnM Offline
          marcusquinn
          wrote on last edited by
          #8

          @james All apps that have updated recently now experiencing this issue:

          • Docuseal
          • Librechat
          • n8n
          • Postiz
          • Privatebin
          • StirlingPDF
          • Vaultwarden
          • Ghost

          I just increased the PostGreSQL DB Memory from 1GB to 2GB, and still no joy on app restarts.

          Web Design & Development: https://www.evergreen.je
          Technology & Apps: https://www.marcusquinn.com

          1 Reply Last reply
          0
          • jamesJ Offline
            jamesJ Offline
            james
            Staff
            wrote on last edited by
            #9

            Good Morning @marcusquinn
            This sounds something else is astray with PostgreSQL on your instance.
            Can you please review and/or send the PostgreSQL log file?

            1 Reply Last reply
            1
            • pepicrftP Offline
              pepicrftP Offline
              pepicrft
              wrote on last edited by
              #10

              @james in my case the same migration failed, and when I tried to migrate, I got the following migration error:

              Error: P3018
              
              A migration failed to apply. New migrations cannot be applied before the error is recovered from. Read more about how to resolve migration issues in a production database: https://pris.ly/d/migrate-resolve
              
              Migration name: 20250522054050_add_organisations
              
              Database error code: 23502
              
              Database error:
              ERROR: null value in column "organisationId" of relation "OrganisationGroup" violates not-null constraint
              DETAIL: Failing row contains (org_group_wxiansskyyehhuuo, null, INTERNAL_TEAM, MEMBER, null, 1, ADMIN).
              
              DbError { severity: "ERROR", parsed_severity: Some(Error), code: SqlState(E23502), message: "null value in column \"organisationId\" of relation \"OrganisationGroup\" violates not-null constraint", detail: Some("Failing row contains (org_group_wxiansskyyehhuuo, null, INTERNAL_TEAM, MEMBER, null, 1, ADMIN)."), hint: None, position: None, where_: None, schema: Some("public"), table: Some("OrganisationGroup"), column: Some("organisationId"), datatype: None, constraint: None, file: Some("execMain.c"), line: Some(2006), routine: Some("ExecConstraints") }
              

              So it seems the migration is making assumptions on the state of some tables.

              1 Reply Last reply
              2
              • pepicrftP Offline
                pepicrftP Offline
                pepicrft
                wrote on last edited by
                #11

                For anyone running into this, it seems the migration assumes that all teams have a subscription. Until the migration is fixed, you can workaround it by faking a subscription.

                1 Reply Last reply
                2
                • C Offline
                  C Offline
                  CaeruleusAqua
                  wrote on last edited by CaeruleusAqua
                  #12
                  Prisma schema loaded from packages/prisma/schema.prisma
                  Datasource "db": PostgreSQL database "db831ce9e36aaa4dc1b586a1c879179689", schema "public" at "postgresql:5432"
                  
                  132 migrations found in prisma/migrations
                  Following migration have not yet been applied:
                  20250611052525_add_session_revoke_enum
                  
                  To apply migrations in development run prisma migrate dev.
                  To apply migrations in production run prisma migrate deploy.
                  npm notice
                  npm notice New major version of npm available! 10.9.2 -> 11.5.2
                  npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.5.2
                  npm notice To update run: npm install -g npm@11.5.2
                  npm notice
                  
                  npx prisma migrate deploy --schema ./packages/prisma/schema.prisma
                  Prisma schema loaded from packages/prisma/schema.prisma
                  Datasource "db": PostgreSQL database "db831ce9e36aaa4dc1b586a1c879179689", schema "public" at "postgresql:5432"
                  
                  
                  Migration 20250522054050_add_organisations marked as rolled back.
                  
                  ┌─────────────────────────────────────────────────────────┐
                  │  Update available 6.8.2 -> 6.13.0                       │
                  │  Run the following to update                            │
                  │    npm i --save-dev prisma@latest                       │
                  │    npm i @prisma/client@latest                          │
                  └─────────────────────────────────────────────────────────┘
                  Prisma schema loaded from packages/prisma/schema.prisma
                  Datasource "db": PostgreSQL database "db831ce9e36aaa4dc1b586a1c879179689", schema "public" at "postgresql:5432"
                  
                  132 migrations found in prisma/migrations
                  
                  Applying migration `20250522054050_add_organisations`
                  Error: P3018
                  
                  A migration failed to apply. New migrations cannot be applied before the error is recovered from. Read more about how to resolve migration issues in a production database: https://pris.ly/d/migrate-resolve
                  
                  Migration name: 20250522054050_add_organisations
                  
                  Database error code: 23502
                  
                  Database error:
                  ERROR: null value in column "organisationId" of relation "OrganisationGroup" violates not-null constraint
                  DETAIL: Failing row contains (org_group_dyzbocwtyozutncz, null, INTERNAL_TEAM, MEMBER, null, 1, ADMIN).
                  
                  DbError { severity: "ERROR", parsed_severity: Some(Error), code: SqlState(E23502), message: "null value in column \"organisationId\" of relation \"OrganisationGroup\" violates not-null constraint", detail: Some("Failing row contains (org_group_dyzbocwtyozutncz, null, INTERNAL_TEAM, MEMBER, null, 1, ADMIN)."), hint: None, position: None, where_: None, schema: Some("public"), table: Some("OrganisationGroup"), column: Some("organisationId"), datatype: None, constraint: None, file: Some("execMain.c"), line: Some(2006), routine: Some("ExecConstraints") }
                  
                  1 Reply Last reply
                  0
                  • jamesJ Offline
                    jamesJ Offline
                    james
                    Staff
                    wrote on last edited by
                    #13

                    Hello @CaeruleusAqua
                    @pepicrft linked the workaround here

                    @pepicrft said in Documenso does not come up after update to 1.6.0:

                    For anyone running into this, it seems the migration assumes that all teams have a subscription. Until the migration is fixed, you can workaround it by faking a subscription.

                    Either you can apply this yourself or you will have to wait until Documenso releases a new Update fixing this issue.

                    1 Reply Last reply
                    0
                    • G Offline
                      G Offline
                      giniw88
                      wrote last edited by james
                      #14

                      I ran into the same 20250522054050_add_organisations migration failure on a self-hosted Docker instance and spent some time digging into the root cause. The "fake subscription" workaround that's been floating around doesn't fully solve it — the issue goes deeper than a missing Subscription record.
                      I was able to fully resolve it and migrate from v1.8.1 → v2.6.0 with all 17 pending migrations applied and data intact. Posted details on the GitHub issue here: https://github.com/documenso/documenso/issues/1880
                      If anyone's still stuck on this and wants help getting unstuck, feel free to reach out.

                      1 Reply Last reply
                      0
                      • jamesJ Offline
                        jamesJ Offline
                        james
                        Staff
                        wrote last edited by
                        #15

                        Hello @giniw88 and welcome to the Cloudron Forum

                        I have removed your mail address self-promotion since you are new to the forum due to missing reputation.
                        If you want to provide help with this issue, do it here in the forum publicly, so everyone can benefit from it.
                        Also, please keep in mind this is the Cloudron Forum and not a generic 'self-hosted Docker' support forum.

                        1 Reply Last reply
                        0
                        • G Offline
                          G Offline
                          giniw88
                          wrote last edited by
                          #16

                          The root cause is that self-hosted Teams have no customerId (Stripe ID). The migration copies it onto the Subscription, gets NULL, then deletes the Subscription. Run these before upgrading:

                          sqlUPDATE "Team" SET "customerId" = 'cus_selfhosted_' || id WHERE "customerId" IS NULL;
                          

                          Then create Subscription records for any Teams missing them. If you've already attempted the upgrade and it failed, you'll also need to clean up 10 partially-created tables before retrying.

                          1 Reply Last reply
                          0
                          Reply
                          • Reply as topic
                          Log in to reply
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes


                          • Login

                          • Don't have an account? Register

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • Bookmarks
                          • Search