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
  • 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 | Demo | Docs | Install
  1. Cloudron Forum
  2. Nextcloud
  3. NC update to 4.12.1 fails

NC update to 4.12.1 fails

Scheduled Pinned Locked Moved Solved Nextcloud
7 Posts 3 Posters 995 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.
    • chymianC Offline
      chymianC Offline
      chymian
      wrote on last edited by girish
      #1

      I encountered the this bug 29986 with the latest update a few hours ago.

      ERROR:  relation "user_id" already exists
      

      since the workaround needs a php edited, which will not work in a container over restart, any proposed way to handle that?

      zordsdavini commented on 1 Dec 2021 •

      did some modifications in Version23000Date20210930122352.php and upgrade success:
      $table->addUniqueIndex(['user_id'], 'user_id'); changed to $table->addUniqueIndex(['user_id'], 'pc_user_id');

      and:

      Pytal commented on 10 Dec 2021

      did some modifications in Version23000Date20210930122352.php and upgrade success: $table->addUniqueIndex(['user_id'], 'user_id'); changed to $table->addUniqueIndex(['user_id'], 'pc_user_id');
      

      For those who renamed the index to pc_user_id, since we've merged #29996, we recommend that you rename the index to profile_config_user_id_idx to prevent any issues in the future

      since NC is offline, a quick help/fix would be very appreciated.

      1 Reply Last reply
      0
      • nebulonN Offline
        nebulonN Offline
        nebulon
        Staff
        wrote on last edited by
        #2

        To get back up quickly until a fix is there, you can restore to the backup made prior to the update.

        Looks like some of their migration scripts have that bug, so maybe there is also a chance that if you put the app in debug mode, manually edit that file, then run the start.sh within the app container to let it finish the database migrations. After that this script should not be run again so putting the app out of debug mode, theoretically should then work. I haven't tried that, since I don't have an instance where the issue is reproduced so far.

        chymianC 1 Reply Last reply
        1
        • nebulonN nebulon

          To get back up quickly until a fix is there, you can restore to the backup made prior to the update.

          Looks like some of their migration scripts have that bug, so maybe there is also a chance that if you put the app in debug mode, manually edit that file, then run the start.sh within the app container to let it finish the database migrations. After that this script should not be run again so putting the app out of debug mode, theoretically should then work. I haven't tried that, since I don't have an instance where the issue is reproduced so far.

          chymianC Offline
          chymianC Offline
          chymian
          wrote on last edited by
          #3

          @nebulon said in NC update to 4.12.1 failes:

          To get back up quickly until a fix is there, you can restore to the backup made prior to the update.

          that would have been my first choice, but the backup system didn't notice me about 5/7 failing backups due to my external minio server had updates problems, so I had only 2 out of the last week left, which had been too old.

          Looks like some of their migration scripts have that bug, so maybe there is also a chance that if you put the app in debug mode, manually edit that file, then run the start.sh within the app container to let it finish the database migrations. After that this script should not be run again so putting the app out of debug mode, theoretically should then work. I haven't tried that, since I don't have an instance where the issue is reproduced so far.

          that worked. NC is online again.
          thx very much

          nebulonN 1 Reply Last reply
          0
          • chymianC chymian

            @nebulon said in NC update to 4.12.1 failes:

            To get back up quickly until a fix is there, you can restore to the backup made prior to the update.

            that would have been my first choice, but the backup system didn't notice me about 5/7 failing backups due to my external minio server had updates problems, so I had only 2 out of the last week left, which had been too old.

            Looks like some of their migration scripts have that bug, so maybe there is also a chance that if you put the app in debug mode, manually edit that file, then run the start.sh within the app container to let it finish the database migrations. After that this script should not be run again so putting the app out of debug mode, theoretically should then work. I haven't tried that, since I don't have an instance where the issue is reproduced so far.

            that worked. NC is online again.
            thx very much

            nebulonN Offline
            nebulonN Offline
            nebulon
            Staff
            wrote on last edited by
            #4

            @chymian good that this worked out. Although Cloudron should have made a backup prior to update and not proceed with update, if the backup failed. Maybe you skipped the backup during the manual update? I think the default is actually to skip, so maybe that should be changed then.

            1 Reply Last reply
            0
            • robiR Offline
              robiR Offline
              robi
              wrote on last edited by
              #5

              I also have a cloudron that NC failed to come up on because it started the 4.12.1 update

              from there it got stuck in a loop:
              Exception: Database error when running migration latest for app core

              Entire server backups also failed because the NC Redis service ran out of memory. Givint it more allowed backups to resume.

              Restoring to earlier version from 2 days ago, still erroring during migration, something about duplicate DB entries.

              Restoring from 3 days ago appears to get stuck at 65%. 🤷

              Conscious tech

              1 Reply Last reply
              0
              • nebulonN Offline
                nebulonN Offline
                nebulon
                Staff
                wrote on last edited by
                #6

                That is very strange, since the database also gets reset on restore to that state it had.
                Do you see any errors we can work with or have you searched for upstream issues?

                robiR 1 Reply Last reply
                0
                • nebulonN nebulon

                  That is very strange, since the database also gets reset on restore to that state it had.
                  Do you see any errors we can work with or have you searched for upstream issues?

                  robiR Offline
                  robiR Offline
                  robi
                  wrote on last edited by
                  #7

                  @nebulon I got busy with other work, so when I came back 2 hours later to check on it. it seemed to complete. It took a very long time for some reason.

                  Seems ok now at 4.11.4.

                  Conscious tech

                  1 Reply Last reply
                  1
                  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