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. Support
  3. NocoDB v1.32.0 restore from backup fails - PostgreSQL role already exists error

NocoDB v1.32.0 restore from backup fails - PostgreSQL role already exists error

Scheduled Pinned Locked Moved Unsolved Support
postgresqlrestorebackup
7 Posts 3 Posters 46 Views 3 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.
  • I Online
    I Online
    ivan-petro
    wrote last edited by
    #1

    Hi,

    I'm having issues restoring NocoDB v1.32.0 from a backup. The restore task consistently fails.

    Environment:

    • Cloudron version: v8.3.1
    • OS: Ubuntu 24.04.2 LTS
    • PostgreSQL allocated memory: 63 GiB (usually 5-10 GB used)
    • PostgreSQL works correctly for other apps

    Problem:
    After running the restore from backup, the task fails. I restarted PostgreSQL and tried "Retry task", but it still fails.

    PostgreSQL logs:

    add: adding database db4fd86909c95a4f079147e3854b98203f
    2026-01-28 08:55:34.684 UTC [974] root@postgres ERROR: role "db4fd86909c95a4f079147e3854b98203f" already exists
    2026-01-28 08:55:34.684 UTC [974] root@postgres STATEMENT: CREATE ROLE db4fd86909c95a4f079147e3854b98203f NOSUPERUSER NOCREATEDB NOCREATEROLE NOINHERIT NOLOGIN
    add: failed to create database. error: role "db4fd86909c95a4f079147e3854b98203f" already exists
    

    Task error:

    Addons Error: Error setting up postgresql. Status code: 500 message: role "db4fd86909c95a4f079147e3854b98203f" already exists
    

    It seems the restore process tries to create a PostgreSQL role that already exists from a previous failed attempt. Is there a way to clean up this orphaned role, or should Cloudron's restore process handle this case with CREATE ROLE IF NOT EXISTS or DROP ROLE IF EXISTS before creating?

    Any help would be appreciated. Thank you!

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

      Hello @ivan-petro

      Can you share with me what backup provider you are using and how you did restore the app backup?
      Did you uninstall the app first and imported the backup or did you select one of the latest backups in the app view?

      1 Reply Last reply
      0
      • J Online
        J Online
        joseph
        Staff
        wrote last edited by
        #3

        @ivan-petro a workaround might be to download the backup config. Then install a new nocodb and import the backup config.

        1 Reply Last reply
        1
        • I Online
          I Online
          ivan-petro
          wrote last edited by
          #4

          Thank you @james and @joseph for your quick responses!

          1) Backup provider: AWS S3

          2) Tried Joseph's suggestion - install new NocoDB and import backup config:

          I created a fresh NocoDB app and tried to import the backup configuration from AWS. Got a different error - seems like the backup archive might be corrupted:

          BoxError: tarExtract pipeline error: incorrect header check
          at tarExtract (/home/yellowtent/box/src/backupformat/tgz.js:225:26)
          at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
          at async /home/yellowtent/box/src/backupformat/tgz.js:248:9
          at async promiseRetry (/home/yellowtent/box/src/promise-retry.js:17:20)
          at async Object.download (/home/yellowtent/box/src/backupformat/tgz.js:244:5)
          

          3) Tried importing into the existing app:

          Same PostgreSQL role error as before:

          Addons Error: Error setting up postgresql. Status code: 500 message: role "db4fd86909c95a4f079147e3854b98203f" already exists
          

          Summary of the situation:

          • Fresh app + import → tarExtract pipeline error: incorrect header check (possibly corrupted backup?)
          • Existing app + import → role already exists error

          Is there a way to:

          1. Verify if the backup file on S3 is intact/not corrupted?
          2. Manually clean up the orphaned PostgreSQL role db4fd86909c95a4f079147e3854b98203f so the existing app restore can proceed?

          Let me know if you need any additional logs or information.

          1 Reply Last reply
          1
          • I Online
            I Online
            ivan-petro
            wrote last edited by
            #5

            While waiting for your response, I'm considering manually cleaning up the orphaned PostgreSQL role.

            Could you please confirm - is it safe to run the following commands?

            DROP ROLE IF EXISTS db4fd86909c95a4f079147e3854b98203f;
            DROP DATABASE IF EXISTS db4fd86909c95a4f079147e3854b98203f;
            

            Or should I only drop the role and keep the database (if it exists)?

            Also, I'm concerned - if I drop these and the restore still fails (especially with the tarExtract error on the new app), will I lose any chance to recover the data? Is there any way to verify the backup integrity on S3 first, or should I make a local copy of the backup before attempting any cleanup?

            1 Reply Last reply
            0
            • J Online
              J Online
              joseph
              Staff
              wrote last edited by joseph
              #6

              @ivan-petro You can download the backup file directly from S3 and try to extract it (on your laptop). Inside it you will find the postgresqldump and other data files. Backup -> Info will give the details of the path (remote path) in S3 . That will help us determine if the backup is corrupt or not.

              1 Reply Last reply
              0
              • I Online
                I Online
                ivan-petro
                wrote last edited by
                #7

                Hi @joseph . Thanks!

                Yes, the issue was with the encryption password. I successfully created a new app from the backup.

                However, one question remains: how can I restore a backup to NocoDB without recreating the app?

                The original restore (to the existing app) kept failing with the role already exists PostgreSQL error. Could this be related to memory limits? I checked and there seemed to be enough memory available everywhere.

                For context: my NocoDB has many records plus connections to external databases.

                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