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 Restore Error - Cannot access 'error' before initialization

    Support
    restore
    5
    8
    403
    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.
    • 3246
      3246 last edited by girish

      Fresh install on Ubuntu 20.04.3 LTS
      Tried various Chrome-based browsers

      angular.js:12011          POST https://192.168.2.200/api/v1/cloudron/restore 500
      (anonymous) @ angular.js:12011
      n @ angular.js:11776
      (anonymous) @ angular.js:11571
      (anonymous) @ angular.js:16383
      $eval @ angular.js:17682
      $digest @ angular.js:17495
      $apply @ angular.js:17790
      (anonymous) @ angular.js:25890
      dispatch @ jquery.min.js:3
      r.handle @ jquery.min.js:3
      client.js:264 500 {status: 'Internal Server Error', message: "Cannot access 'error' before initialization"}
      (anonymous) @ client.js:264
      (anonymous) @ angular.js:11486
      (anonymous) @ angular.js:16383
      $eval @ angular.js:17682
      $digest @ angular.js:17495
      $apply @ angular.js:17790
      l @ angular.js:11831
      J @ angular.js:12033
      t.onload @ angular.js:11966
      load (async)
      (anonymous) @ angular.js:11949
      n @ angular.js:11776
      (anonymous) @ angular.js:11571
      (anonymous) @ angular.js:16383
      $eval @ angular.js:17682
      $digest @ angular.js:17495
      $apply @ angular.js:17790
      (anonymous) @ angular.js:25890
      dispatch @ jquery.min.js:3
      r.handle @ jquery.min.js:3
      client.js:265 ------
      Cloudron Internal Error
      
      If you see this, please send a mail with above log to support@cloudron.io
      ------
      

      Visit https://www.bebravernow.com for more

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

        Can you also take a look at /home/yellowtent/platformdata/logs/box.log to get more info on the error?

        jan.reinhardt 1 Reply Last reply Reply Quote 0
        • jan.reinhardt
          jan.reinhardt @nebulon last edited by

          @nebulon Have exactly the same problem. Error comes up after uploading the Backup config file.

          This is in the box.log:
          2022-02-14T20:36:03.307Z box:server ==========================================
          2022-02-14T20:36:03.308Z box:server Cloudron 7.0.4
          2022-02-14T20:36:03.308Z box:server ==========================================
          2022-02-14T20:36:03.370Z box:settings initCache: pre-load settings
          2022-02-14T20:36:03.391Z box:tasks stopAllTasks: stopping all tasks
          2022-02-14T20:36:03.392Z box:shell stopTask spawn: /usr/bin/sudo -S /home/yellowtent/box/src/scripts/stoptask.sh all
          2022-02-14T20:36:03.413Z box:dockerproxy startDockerProxy: started proxy on port 3003
          Cloudron is up and running. Logs are at /home/yellowtent/platformdata/logs/box.log
          2022-02-14T20:36:03.458Z box:cloudron runStartupTasks: not activated. generating IP based redirection config2022-02-14T20:36:03.460Z box:reverseproxy writeDefaultConfig: writing configs for endpoint "setup"
          2022-02-14T20:36:03.461Z box:shell reload spawn: /usr/bin/sudo -S /home/yellowtent/box/src/scripts/restartservice.sh nginx
          HttpError: Cannot access 'error' before initialization
          at Function.BoxError.toHttpError (/home/yellowtent/box/src/boxerror.js:107:16)
          at restore (/home/yellowtent/box/src/routes/provision.js:121:37)
          at processTicksAndRejections (internal/process/task_queues.js:95:5) {
          status: 500,
          internalError: ReferenceError: Cannot access 'error' before initialization
          at Object.restore (/home/yellowtent/box/src/provision.js:210:19)
          at processTicksAndRejections (internal/process/task_queues.js:95:5),
          details: null
          }
          Box POST /api/v1/cloudron/restore 500 Internal Server Error Cannot access 'error' before initialization 19.997 ms - 99
          HttpError: Cannot access 'error' before initialization
          at Function.BoxError.toHttpError (/home/yellowtent/box/src/boxerror.js:107:16)
          at restore (/home/yellowtent/box/src/routes/provision.js:121:37)
          at processTicksAndRejections (internal/process/task_queues.js:95:5) {
          status: 500,
          internalError: ReferenceError: Cannot access 'error' before initialization
          at Object.restore (/home/yellowtent/box/src/provision.js:210:19)
          at processTicksAndRejections (internal/process/task_queues.js:95:5),
          details: null
          }
          Box POST /api/v1/cloudron/restore 500 Internal Server Error Cannot access 'error' before initialization 3.243 ms - 99

          CDC061F5-B450-4B54-A9DA-1F956020DEEB.jpeg

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

            @3246 I guess you are trying to restore from local filesystem mount ? like cifs/sshfs ?

            @jan-reinhardt yes, this is a known issue, fix is coming.

            The fix is in the next release - https://git.cloudron.io/cloudron/box/-/commit/04b7c14fd71e65072f43ed008d9e8b598dd946ab .

            BrutalBirdie 1 Reply Last reply Reply Quote 0
            • Referenced by  BrutalBirdie BrutalBirdie 
            • BrutalBirdie
              BrutalBirdie Staff @girish last edited by

              For anyone running into this specific issue (for me in a restore from 7.0.4) you need to apply the fixes manually:

              # Go into the box source folder
              cd /home/yellowtent/box/
              
              # Download the patches from gitlab
              wget https://git.cloudron.io/cloudron/box/-/commit/04b7c14fd71e65072f43ed008d9e8b598dd946ab.diff
              wget https://git.cloudron.io/cloudron/box/-/commit/8b9d821905b55c624084cb7665d8fbdb621a56e4.diff
              wget https://git.cloudron.io/cloudron/box/-/commit/a786fad3eed59e9ed141c7a3344466b61e280891.diff
              
              # Apply the patches
              git apply 04b7c14fd71e65072f43ed008d9e8b598dd946ab.diff
              git apply 8b9d821905b55c624084cb7665d8fbdb621a56e4.diff
              git apply a786fad3eed59e9ed141c7a3344466b61e280891.diff
              
              # a box restart
              systemctl restart box.service
              

              Like my work? Consider donating a beer 🍻 Cheers!

              1 Reply Last reply Reply Quote 2
              • girish
                girish Staff last edited by

                Easier way might be to upgrade to 7.1 and then you can restore from a backup created from 7.1 🙂

                1 Reply Last reply Reply Quote 0
                • 3246
                  3246 last edited by

                  Thanks, folks. I applied @BrutalBirdie's patch and it's working without error now.

                  However, I found that when I enter the values manually and try to restore from a locally mounted NFS share or copy the backup across, it just spins without throwing errors or restoring. Do I always have to use the backup config (I did manage to change the path manually to point it to the latest backup after uploading the restore file)?

                  screencapture-192-168-2-200-restore-html-2022-02-22-22_25_08.png

                  Visit https://www.bebravernow.com for more

                  BrutalBirdie 1 Reply Last reply Reply Quote 0
                  • Forked by  nebulon nebulon 
                  • BrutalBirdie
                    BrutalBirdie Staff @3246 last edited by

                    @3246 said in Restore Error - Cannot access 'error' before initialization:

                    Do I always have to use the backup config (I did manage to change the path manually to point it to the latest backup after uploading the restore file)?

                    No you don't need the backup file.
                    https://docs.cloudron.io/backups/#restore-cloudron

                    did you try to completely remove the mount and the configure it new?

                    Like my work? Consider donating a beer 🍻 Cheers!

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