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. Off-topic
  3. Shooting a Cloudron Server right in the brain - I deleted appsdata and boxdata by accident

Shooting a Cloudron Server right in the brain - I deleted appsdata and boxdata by accident

Scheduled Pinned Locked Moved Off-topic
4 Posts 3 Posters 638 Views 4 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.
  • BrutalBirdieB Offline
    BrutalBirdieB Offline
    BrutalBirdie
    Partner
    wrote on last edited by BrutalBirdie
    #1

    Lets update Cloudron to experimental - 7.1.X - What can go wrong?

    😬
    a lot when something fails and you try to debug the /home/yellowtent/box/box.js and use the environment variables from the systemd service and then don't realize you also set the HOME variable and then do cd and see confused that in the root folder has the appsdata and boxdata folder.


    You think:

    Did I execute box.js as root and now the folders are in root? Better delete them
    Hmm why is my mail not working, why is nothing working correctly? Only the box.service did not work
    OhNo.jpg

    65b87d4e-fbfa-4c03-b540-6703a6317155-grafik.png

    Image Description:
    Two panes, left and right.
    Spongebob grinning into the camera very close up with normal big eyes in the left pane.
    In the right pane just the eyes shrink into a very small version, like oh no what have I done
    
    pwd
    /home/yellowtent
    

    ☠ fml I just delete all app data and boxdata 🤣

    Time to restore cloudron from the pre-update backup.

    I run a Hetzner Storage box as backup space.

    cf7c5d70-8e08-4fee-a793-5032373ee519-grafik.png

    ps: I know the backup id is wrong and I fixed that

    And now for the first time, I get an error when trying to restore.

    Looking into the /home/yellowtent/platformdata/logs/box.log

    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 2.663 ms - 99
    

    What? Lets look up this error in the forum.
    Ok linked to this:
    https://forum.cloudron.io/topic/6494/restore-error-cannot-access-error-before-initialization/4?_=1645411808982

    Since I am restoring from 7.0.4 I am still affected by this issue.
    So what to do? Wait for support? No I can't, I need my mails up and running!

    I need to apply the commits done to fix this issue:

    https://git.cloudron.io/cloudron/box/-/commit/04b7c14fd71e65072f43ed008d9e8b598dd946ab
    https://git.cloudron.io/cloudron/box/-/commit/8b9d821905b55c624084cb7665d8fbdb621a56e4
    https://git.cloudron.io/cloudron/box/-/commit/a786fad3eed59e9ed141c7a3344466b61e280891

    if you put a .diff to the url you will get the diff file which then can get applied via git apply.
    So I got into /home/yellowtent/box and wget the diffs.

    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
    
    # now I apply the diffs aka patches
    git apply 04b7c14fd71e65072f43ed008d9e8b598dd946ab.diff
    git apply 8b9d821905b55c624084cb7665d8fbdb621a56e4.diff
    git apply a786fad3eed59e9ed141c7a3344466b61e280891.diff
    
    # a box restart
    systemctl restart box.service
    
    File not found: /mnt/cloudronbackup/2022-02-21-003521-723/box_v7.0.4.tar.gz
    

    Next error..

    ls -lah /mnt/cloudronbackup/cloudron-backup/2022-02-21-003521-723/box_v7.0.4.tar.gz
    

    The path is wrong in the error?

    tail -f /home/yellowtent/platformdata/logs/box.log
    2022-02-21T03:09:00.625Z box:provision setProgress: restore - Downloading box backup
    2022-02-21T03:09:00.625Z box:backuptask download: Downloading 2022-02-21-003521-723/box_v7.0.4 of format tgz to {"localRoot":"/home/yellowtent/boxdata/box","layout":[]}
    2022-02-21T03:09:00.625Z box:provision setProgress: restore - Downloading backup 2022-02-21-003521-723/box_v7.0.4
    2022-02-21T03:09:00.625Z box:storage/filesystem download: /mnt/cloudronbackup/2022-02-21-003521-723/box_v7.0.4.tar.gz
    2022-02-21T03:09:20.695Z box:provision setProgress: restore - Downloading backup 2022-02-21-003521-723/box_v7.0.4
    2022-02-21T03:09:20.695Z box:storage/filesystem download: /mnt/cloudronbackup/2022-02-21-003521-723/box_v7.0.4.tar.gz
    2022-02-21T03:09:40.762Z box:provision setProgress: restore - Downloading backup 2022-02-21-003521-723/box_v7.0.4
    2022-02-21T03:09:40.762Z box:storage/filesystem download: /mnt/cloudronbackup/2022-02-21-003521-723/box_v7.0.4.tar.gz
    2022-02-21T03:10:00.831Z box:provision setProgress: restore - Downloading backup 2022-02-21-003521-723/box_v7.0.4
    2022-02-21T03:10:00.831Z box:storage/filesystem download: /mnt/cloudronbackup/2022-02-21-003521-723/box_v7.0.4.tar.gz
    2022-02-21T03:10:20.904Z box:provision setProgress: restore - Downloading backup 2022-02-21-003521-723/box_v7.0.4
    2022-02-21T03:10:20.904Z box:storage/filesystem download: /mnt/cloudronbackup/2022-02-21-003521-723/box_v7.0.4.tar.gz
    

    Hmmm...
    OH! The backup remote directory is wrong it should be /backup/cloudron-backup then!

    And now it works!
    Now I am looking at a dashboard that is restoring my apps.

    Like my work? Consider donating a drink. Cheers!

    rmdesR 1 Reply Last reply
    2
    • BrutalBirdieB BrutalBirdie

      Lets update Cloudron to experimental - 7.1.X - What can go wrong?

      😬
      a lot when something fails and you try to debug the /home/yellowtent/box/box.js and use the environment variables from the systemd service and then don't realize you also set the HOME variable and then do cd and see confused that in the root folder has the appsdata and boxdata folder.


      You think:

      Did I execute box.js as root and now the folders are in root? Better delete them
      Hmm why is my mail not working, why is nothing working correctly? Only the box.service did not work
      OhNo.jpg

      65b87d4e-fbfa-4c03-b540-6703a6317155-grafik.png

      Image Description:
      Two panes, left and right.
      Spongebob grinning into the camera very close up with normal big eyes in the left pane.
      In the right pane just the eyes shrink into a very small version, like oh no what have I done
      
      pwd
      /home/yellowtent
      

      ☠ fml I just delete all app data and boxdata 🤣

      Time to restore cloudron from the pre-update backup.

      I run a Hetzner Storage box as backup space.

      cf7c5d70-8e08-4fee-a793-5032373ee519-grafik.png

      ps: I know the backup id is wrong and I fixed that

      And now for the first time, I get an error when trying to restore.

      Looking into the /home/yellowtent/platformdata/logs/box.log

      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 2.663 ms - 99
      

      What? Lets look up this error in the forum.
      Ok linked to this:
      https://forum.cloudron.io/topic/6494/restore-error-cannot-access-error-before-initialization/4?_=1645411808982

      Since I am restoring from 7.0.4 I am still affected by this issue.
      So what to do? Wait for support? No I can't, I need my mails up and running!

      I need to apply the commits done to fix this issue:

      https://git.cloudron.io/cloudron/box/-/commit/04b7c14fd71e65072f43ed008d9e8b598dd946ab
      https://git.cloudron.io/cloudron/box/-/commit/8b9d821905b55c624084cb7665d8fbdb621a56e4
      https://git.cloudron.io/cloudron/box/-/commit/a786fad3eed59e9ed141c7a3344466b61e280891

      if you put a .diff to the url you will get the diff file which then can get applied via git apply.
      So I got into /home/yellowtent/box and wget the diffs.

      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
      
      # now I apply the diffs aka patches
      git apply 04b7c14fd71e65072f43ed008d9e8b598dd946ab.diff
      git apply 8b9d821905b55c624084cb7665d8fbdb621a56e4.diff
      git apply a786fad3eed59e9ed141c7a3344466b61e280891.diff
      
      # a box restart
      systemctl restart box.service
      
      File not found: /mnt/cloudronbackup/2022-02-21-003521-723/box_v7.0.4.tar.gz
      

      Next error..

      ls -lah /mnt/cloudronbackup/cloudron-backup/2022-02-21-003521-723/box_v7.0.4.tar.gz
      

      The path is wrong in the error?

      tail -f /home/yellowtent/platformdata/logs/box.log
      2022-02-21T03:09:00.625Z box:provision setProgress: restore - Downloading box backup
      2022-02-21T03:09:00.625Z box:backuptask download: Downloading 2022-02-21-003521-723/box_v7.0.4 of format tgz to {"localRoot":"/home/yellowtent/boxdata/box","layout":[]}
      2022-02-21T03:09:00.625Z box:provision setProgress: restore - Downloading backup 2022-02-21-003521-723/box_v7.0.4
      2022-02-21T03:09:00.625Z box:storage/filesystem download: /mnt/cloudronbackup/2022-02-21-003521-723/box_v7.0.4.tar.gz
      2022-02-21T03:09:20.695Z box:provision setProgress: restore - Downloading backup 2022-02-21-003521-723/box_v7.0.4
      2022-02-21T03:09:20.695Z box:storage/filesystem download: /mnt/cloudronbackup/2022-02-21-003521-723/box_v7.0.4.tar.gz
      2022-02-21T03:09:40.762Z box:provision setProgress: restore - Downloading backup 2022-02-21-003521-723/box_v7.0.4
      2022-02-21T03:09:40.762Z box:storage/filesystem download: /mnt/cloudronbackup/2022-02-21-003521-723/box_v7.0.4.tar.gz
      2022-02-21T03:10:00.831Z box:provision setProgress: restore - Downloading backup 2022-02-21-003521-723/box_v7.0.4
      2022-02-21T03:10:00.831Z box:storage/filesystem download: /mnt/cloudronbackup/2022-02-21-003521-723/box_v7.0.4.tar.gz
      2022-02-21T03:10:20.904Z box:provision setProgress: restore - Downloading backup 2022-02-21-003521-723/box_v7.0.4
      2022-02-21T03:10:20.904Z box:storage/filesystem download: /mnt/cloudronbackup/2022-02-21-003521-723/box_v7.0.4.tar.gz
      

      Hmmm...
      OH! The backup remote directory is wrong it should be /backup/cloudron-backup then!

      And now it works!
      Now I am looking at a dashboard that is restoring my apps.

      rmdesR Offline
      rmdesR Offline
      rmdes
      wrote on last edited by
      #2

      @BrutalBirdie That must have been intense !!

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

        Yeah quite unfortunate 😕 bu thanks for sharing the solution!

        BrutalBirdieB 1 Reply Last reply
        1
        • nebulonN nebulon

          Yeah quite unfortunate 😕 bu thanks for sharing the solution!

          BrutalBirdieB Offline
          BrutalBirdieB Offline
          BrutalBirdie
          Partner
          wrote on last edited by
          #4

          @rmdes
          Not so much intense, more annoyed by my own mistake.
          I'm pretty confident in the cloudron backup system since I destroyed my cloudron multiple times like this with installing other software, tinkering with code yada yada.

          But having the restore error on me made my heart race a little I must admit.

          Knowing this error seems cryptic and off I knew something must be wrong.
          I even tried coping the whole backup into the system and restoring that (Filesystem Mountpoint) with the same error.
          So I knew something was up.

          I am glad I run into this issue so I can provide this experience and a more newbie user does not have to stress themself out with this.

          Like my work? Consider donating a drink. Cheers!

          1 Reply Last reply
          2
          • BrutalBirdieB BrutalBirdie referenced this topic on
          • BrutalBirdieB BrutalBirdie referenced this topic on
          • BrutalBirdieB BrutalBirdie referenced this topic on
          • BrutalBirdieB BrutalBirdie referenced this topic on
          • BrutalBirdieB BrutalBirdie referenced this topic on
          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