Azure / CloudShell

Container Image for Azure Cloud Shell (https://azure.microsoft.com/en-us/features/cloud-shell/)
https://shell.azure.com
MIT License
253 stars 103 forks source link

[BUG] Reports of file system corruption in Cloud Shell #106

Open edyoung opened 3 years ago

edyoung commented 3 years ago

We have received some reports of issues observed in Azure Cloud Shell which have been traced to filesystem corruption in the user's home directory in Cloud Shell. We have not yet determined the exact root cause of the issue or a way to reproduce it. In the interim, this issue provides a location to report this incident occurring, and provides some workaround steps.

Symptoms

Operations which read or write to the home directory in Cloud Shell may produce errors, including

Structure needs cleaning
[Errno 5] Input/output error: '/home/<username>/.azure/commands/<filename>'

Cause

In Cloud Shell, your home directory is stored inside a file stored in the Azure File Share you specify when configuring Cloud Shell. This blog post has more details. Under some circumstances, it is possible for the filesystem structure inside that file to become corrupted, leading to these error messages.

Workaround

The simplest workaround is to delete and recreate your home directory.

  1. Back up any important files from the home directory to the cloud drive, for example cp ~/important.txt ~/clouddrive/important.txt. Alternatively you can download these files. All files under ~ except those under ~/clouddrive will be deleted.
  2. Open your Cloud Drive by clicking the cog wheel settings icon in the Cloud Shell toolbar and chooss 'Manage File Share' from the drop down menu.
  3. Run clouddrive unmount and choose Yes. You will be prompted to reconnect to cloud shell. Don't do that yet!
  4. Open the .cloudconsole directory in the File Share window. You should see a single file acc_myusername.img. Delete this file .
  5. Reconnect to Cloud Shell. The acc_myusername.img file containing your home directory will be automatically recreated.
  6. Restore any files desired into the home directory.

Reporting

We are actively trying to determine the root cause for this issue. If you observe it, please report it either to Microsoft Support via the Azure Portal, or by adding a comment to this issue. In either case, please include your PUID (unique id) so we can identify your records in the service logs. You can determine your PUID by running env | grep ACC_PUID.

jiasli commented 3 years ago

Open your Cloud Drive by choosing 'Manage File Share' from the Cloud Shell toolbar.

I can't find this 'Manage File Share' button. Am I missing anything? 🤔

image

I can only run df to get the File Share name:

$ df
Filesystem                                1K-blocks     Used Available Use% Mounted on
...
//xxxxxx.file.core.windows.net/fs20210709   6291456  5242880   1048576  84% /usr/csuser/clouddrive