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. Support
  3. Disk Usage Stuck

Disk Usage Stuck

Scheduled Pinned Locked Moved Solved Support
disk-usage
10 Posts 3 Posters 1.4k 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.
  • R Offline
    R Offline
    Recliner2042
    wrote on last edited by girish
    #1

    As of today, the Disk Usage under System Info never stops the spinner to show the results. In the browser's network debug tab, the api call completes as 304 Not Modified and has a lot of data in the response. In the console there is an error in the angular code TypeError: Cannot read properties of undefined (reading 'name')
    So it seems the Disk Usage UI was expecting a value that was not there. Of course, the console error could be from something else and not the Disk Usage.

    murgeroM 1 Reply Last reply
    1
    • R Recliner2042

      As of today, the Disk Usage under System Info never stops the spinner to show the results. In the browser's network debug tab, the api call completes as 304 Not Modified and has a lot of data in the response. In the console there is an error in the angular code TypeError: Cannot read properties of undefined (reading 'name')
      So it seems the Disk Usage UI was expecting a value that was not there. Of course, the console error could be from something else and not the Disk Usage.

      murgeroM Offline
      murgeroM Offline
      murgero
      App Dev
      wrote on last edited by
      #2

      @Recliner2042 If you hold CTRL+F5 to force a cache refresh, does it update?

      --
      https://urgero.org
      ~ Professional Nerd. Freelance Programmer. ~

      R 1 Reply Last reply
      0
      • murgeroM murgero

        @Recliner2042 If you hold CTRL+F5 to force a cache refresh, does it update?

        R Offline
        R Offline
        Recliner2042
        wrote on last edited by Recliner2042
        #3

        @murgero That did not help.

        But, I did some more debugging. I see in the code that it is indeed looking for the volume name.

        if volume expect name.png
        See https://git.cloudron.io/cloudron/box/-/blob/master/dashboard/src/views/system.js?ref_type=heads for the context of that code.

        And in the API the volume name is not coming through.

        no name.png

        1 Reply Last reply
        1
        • R Offline
          R Offline
          Recliner2042
          wrote on last edited by Recliner2042
          #4

          Possibly related. I have these 2 ghost volumes. By that I mean I had properly removed them but they are still listed.

          ghost volumes.png

          Including those two ghosted volumes, I have a total of 4 volumes (not all in the same disk) and all are missing the name field.

          But on the Volumes screen, the names do come through. It is only on the Disk Usage screen that they don't. (also the ghost volumes don't show on the Volumes screen)

          R 1 Reply Last reply
          1
          • R Recliner2042

            Possibly related. I have these 2 ghost volumes. By that I mean I had properly removed them but they are still listed.

            ghost volumes.png

            Including those two ghosted volumes, I have a total of 4 volumes (not all in the same disk) and all are missing the name field.

            But on the Volumes screen, the names do come through. It is only on the Disk Usage screen that they don't. (also the ghost volumes don't show on the Volumes screen)

            R Offline
            R Offline
            Recliner2042
            wrote on last edited by Recliner2042
            #5

            @Recliner2042 said in Disk Usage Stuck:

            Including those two ghosted volumes, I have a total of 4 volumes (not all in the same disk) and all are missing the name field.

            After reading the code closer, I see that the name field is not actually supposed to be there in the API call. It finds the name from the volume map from the volumes api call.

            But the 2 ghosted volumes, are not returned by the volume api call.

            2 Volumes.png
            (above: only the two valid volumes returned by volumes call)

            And so their name can't be found when they are looped over after the disk_usage api call.

            So the question is: why is the disk_usage API call picking up ghost volumes that the volumes API call is not picking up?

            1 Reply Last reply
            1
            • R Offline
              R Offline
              Recliner2042
              wrote on last edited by Recliner2042
              #6

              So the problem is that the disk usage data is still cached in a file (https://git.cloudron.io/cloudron/box/-/blob/master/src/system.js?ref_type=heads line 260) from checking before the 2 ghost volumes were removed.

              So simply forcing a recheck should fix it. But that can't be done because the button is disabled.

              So I force enabled the button in my browser, clicked it, and now it is working fine.

              So the issue seems to be, that the cache file is not invalidated when a volume is removed. (maybe it is normally but failed for me)

              For a simple solution, I would propose enabling the recheck button as soon as the api call returns before executing the handling of the data. So that way if there is an error processing the data, the button is enabled.

              quick code change.png
              See https://git.cloudron.io/cloudron/box/-/blob/master/dashboard/src/views/system.js?ref_type=heads

              Of course check into the disk usage cache file invalidation, too. I assume that "normally" when you remove a volume, the file is invalidated. But there seems to be an edge case where it does not always.

              Edit: I just had a look over volumes.js and mounts.js and it look like the cache file is never invalidated by the del/remove action.

              1 Reply Last reply
              1
              • R Offline
                R Offline
                Recliner2042
                wrote on last edited by Recliner2042
                #7

                @girish I'm pinging you because the git history shows you as the main author of all the code files involved.

                1 Reply Last reply
                1
                • girishG Offline
                  girishG Offline
                  girish
                  Staff
                  wrote on last edited by
                  #8

                  @Recliner2042 the disk usage is not instantaneous. It runs in a background task periodically. There is a refresh button on top of the disk usage graphs. If you click that, then it will collect the disk usage afresh. You can also see the logs of the task there. It's expected that the cache is not invalidated when volumes are removed etc.

                  R 1 Reply Last reply
                  0
                  • girishG girish

                    @Recliner2042 the disk usage is not instantaneous. It runs in a background task periodically. There is a refresh button on top of the disk usage graphs. If you click that, then it will collect the disk usage afresh. You can also see the logs of the task there. It's expected that the cache is not invalidated when volumes are removed etc.

                    R Offline
                    R Offline
                    Recliner2042
                    wrote on last edited by Recliner2042
                    #9

                    @girish When the cache is invalid, it causes a runtime error, and the error prevents the refresh button from getting enabled. I'm asking for the refresh button to immediately enable in the handler, so if there is an error in the handler from invalid data, one may still click the refresh button.

                    1 Reply Last reply
                    1
                    • girishG girish marked this topic as a question on
                    • girishG Offline
                      girishG Offline
                      girish
                      Staff
                      wrote on last edited by
                      #10

                      @Recliner2042 ah fair, that's a bug then. Can you contact us at support@cloudron.io , so we can debug this further?

                      1 Reply Last reply
                      0
                      • R Recliner2042 has marked this topic as solved 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