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


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Solved NC update to 4.12.1 fails

    Nextcloud
    3
    7
    94
    Loading More Posts
    • 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.
    • chymian
      chymian last edited by girish

      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 Reply Quote 0
      • nebulon
        nebulon Staff last edited by

        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.

        chymian 1 Reply Last reply Reply Quote 1
        • chymian
          chymian @nebulon last edited by

          @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

          nebulon 1 Reply Last reply Reply Quote 0
          • nebulon
            nebulon Staff @chymian last edited by

            @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 Reply Quote 0
            • robi
              robi last edited by

              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%. 🤷

              Life of Gratitude.
              Life of Advanced Technology

              1 Reply Last reply Reply Quote 0
              • nebulon
                nebulon Staff last edited by

                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?

                robi 1 Reply Last reply Reply Quote 0
                • robi
                  robi @nebulon last edited by

                  @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.

                  Life of Gratitude.
                  Life of Advanced Technology

                  1 Reply Last reply Reply Quote 1
                  • First post
                    Last post
                  Powered by NodeBB