azure-cli: [CloudShell] Error on every command run on Azure Cloud Shell: OSError: [Errno 30] Read-only file system

This is autogenerated. Please review and update as needed.

Describe the bug

When I go to run any command on the system it errors out and prevents me from using the cloud shell interface.

Command Name Any command at all

Errors:

The command failed with an unexpected error. Here is the traceback:

[Errno 30] Read-only file system: '/home/**Redacted Username**/.azure/commands/2020-06-05.22-24-38.unknown_command.211.log'
Traceback (most recent call last):
  File "/opt/az/lib/python3.6/site-packages/knack/cli.py", line 215, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 511, in execute
    load_cmd_tbl_func=self.commands_loader.load_command_table, args=args)
  File "/opt/az/lib/python3.6/site-packages/knack/cli.py", line 164, in raise_event
    func(self, **kwargs)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/azlogging.py", line 86, in init_command_file_logging
    self._init_command_logfile_handlers(cmd_logger, args)  # pylint: disable=protected-access
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/azlogging.py", line 108, in _init_command_logfile_handlers
    logfile_handler = logging.FileHandler(log_file_path)
  File "/opt/az/lib/python3.6/logging/__init__.py", line 1032, in __init__
    StreamHandler.__init__(self, self._open())
  File "/opt/az/lib/python3.6/logging/__init__.py", line 1061, in _open
    return open(self.baseFilename, self.mode, encoding=self.encoding)
OSError: [Errno 30] Read-only file system: '/home/**Redacted Username**/.azure/commands/2020-06-05.22-24-38.unknown_command.211.log'

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • I don’t know how to reproduce the errors. I just get the error every time I put in a command.

Expected Behavior

I expected all the commands to not error out on run.

Environment Summary

Cloud Shell

Additional Context

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 2
  • Comments: 33 (4 by maintainers)

Most upvoted comments

Yes, I can reproduce the problem and a fix/workaround: 1/ Delete the group “cloud-shell-storage-westeurope” in which the “Storage account” for the Cloud Shell has been created. 2/ Wait for the deletion. 3/ Go back to Cloud Shell and click “Create storage”. 4/ See the issue by typing (for instance):

$ echo "hello world" > ~/test.txt
bash: /home/benoit/test.txt: Read-only file system

5/ Restart Cloud Shell with the “power” button/icon. 6/ Check that the issue is fixed by typing (for instance):

$ echo "hello world" > ~/test.txt

Hope this help.

Yes, I can reproduce the problem and a fix/workaround: 1/ Delete the group “cloud-shell-storage-westeurope” in which the “Storage account” for the Cloud Shell has been created. 2/ Wait for the deletion. 3/ Go back to Cloud Shell and click “Create storage”. 4/ See the issue by typing (for instance):

$ echo "hello world" > ~/test.txt
bash: /home/benoit/test.txt: Read-only file system

5/ Restart Cloud Shell with the “power” button/icon. 6/ Check that the issue is fixed by typing (for instance):

$ echo "hello world" > ~/test.txt

Hope this help.

@patricekrakow does this only occur the first time you are connecting to the new file share? My guess is that you are deleting the old file share, creating the new file share, then cloud shell is giving you the session before it has finished making the updates to the storage account settings for the new file share.

I don’t believe this would be resolved by reopening Cloud Shell or using an alternative browser. Please see my comment earlier in this thread for troubleshooting steps.

I did the commands these were my outputs:

$ stat ~/.azure/commands
  File: '/home/**Redacted Username**/.azure/commands'
  Size: 4096            Blocks: 8          IO Block: 4096   directory
Device: 700h/1792d      Inode: 131079      Links: 2
Access: (0755/drwxr-xr-x)  Uid: ( 9527/**Redacted Username**)   Gid: ( 9527/**Redacted Username**)
Access: 2020-06-09 14:38:02.020203476 +0000
Modify: 2020-06-09 14:38:01.504197941 +0000
Change: 2020-06-09 14:38:01.504197941 +0000
 Birth: -

$ ls ~/.azure/commands -l
total 32
-rw-r--r-- 1 **Redacted** **Redacted** 210 Jun  5 22:30 2020-06-05.22-30-36.login.115.log
-rw-r--r-- 1 **Redacted** **Redacted** 223 Jun  5 22:30 2020-06-05.22-30-39.account_set.126.log
-rw-r--r-- 1 **Redacted** **Redacted** 194 Jun  5 23:23 2020-06-05.23-23-58.unknown_command.183.log
-rw-r--r-- 1 **Redacted** **Redacted** 404 Jun  5 23:24 2020-06-05.23-24-12.aks_install-cli.190.log
-rw-r--r-- 1 **Redacted** **Redacted** 210 Jun  9 14:38 2020-06-09.14-37-59.login.103.log
-rw-r--r-- 1 **Redacted** **Redacted** 223 Jun  9 14:38 2020-06-09.14-38-01.account_set.115.log
-rw-r--r-- 1 **Redacted** **Redacted** 194 Jun  9 14:38 2020-06-09.14-38-50.unknown_command.140.log
-rw-r--r-- 1 **Redacted** **Redacted** 404 Jun  9 14:39 2020-06-09.14-39-19.aks_install-cli.145.log

Command with test.txt

$echo "Hello World" > ~/.azure/commands/test.txt
([Errno 13] Permission denied: '~/.azure/commands/test.txt')
$ cat ~/.azure/commands/test.txt
~/.azure/commands/test.txt does not exist

I had also tried to install az aks install-cli and I got this out

Downloading client to "/usr/local/bin/kubectl" from "https://storage.googleapis.com/kubernetes-release/release/v1.18.3/bin/linux/amd64/kubectl"
Connection error while attempting to download client ([Errno 13] Permission denied: '/usr/local/bin/kubectl')