Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Bad df command #1632

Merged

Commits on Jan 12, 2024

  1. Bugfix: Bad df command

    If the filesystem name is to long the result of `df -h /` will end up on two lines. Which causes the following error:
    
    ```
    panic: runtime error: index out of range [1] with length 1
    
    goroutine 477 [running]:
    github.com/memphisdev/memphis/server.getUnixStorageSize()
    	/go/src/memphis/server/memphis_handlers_monitoring.go:1054 +0x454
    github.com/memphisdev/memphis/server.MonitoringHandler.GetSystemComponents({0xc0001ced80?})
    	/go/src/memphis/server/memphis_cloud.go:382 +0x9be8
    github.com/memphisdev/memphis/server.MonitoringHandler.getMainOverviewDataDetails.func2()
    	/go/src/memphis/server/memphis_cloud.go:1680 +0x45
    created by github.com/memphisdev/memphis/server.MonitoringHandler.getMainOverviewDataDetails
    	/go/src/memphis/server/memphis_cloud.go:1679 +0x2ca
    ```
    
    Example:
    
    ```
    /run # df -h /
    Filesystem                Size      Used Available Use% Mounted on
    /dev/mapper/cryptvol-root
                            446.5G    268.3G    170.7G  61% /
    ```
    
    Solution for this is to force the output in POSIX output format.
    ```
    /run # df -h -P /
    Filesystem                Size      Used Available Capacity Mounted on
    /dev/mapper/cryptvol-root         446.5G    268.3G    170.7G  61% /
    ```
    madestreel committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    2633f37 View commit details
    Browse the repository at this point in the history