cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
449
Views
6
Helpful
1
Replies

Cisco guestshell python cli library log is not rotated

Hi,

I was using guestshell and a python script to collect cli info on a Cat9300. The script is using "cli" module that is available only in the guestshell environment. After a larger number of script runs it started to fail with this error:

 

 

 

OSError: [Errno 28] No space left on device

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/bootflash//guest-share/script.py", line 20, in <module>
    nul = cli.execute(line)
  File "/usr/lib/python3.6/site-packages/cli/__init__.py", line 392, in execute
    return (cli(command, timeout))
  File "/usr/lib/python3.6/site-packages/cli/__init__.py", line 311, in cli
    _log_to_file("CLI execution invoked for '" + command + "'")
  File "/usr/lib/python3.6/site-packages/cli/__init__.py", line 87, in _log_to_file
    logfile.close()
OSError: [Errno 28] No space left on device

 

 

 

After digging inside the guestshell container, I found out that the cli library is logging it's activity to a file.

 

 

 

[guestshell@guestshell ~]$ df -h 

 

 

 

Showed that `/dev/loop11` is full and it is mapped to `/data`.

The file is named `iosp.log`.

I could not find any log rotation config for it, so it looks like it doesn't matter how much space You will give to the guestshell, it can eventually take it all up.

My workaround was an EEM cron task to delete that file.

Sharing in case anyone stumbles upon the same error.

1 Reply 1

hhz
Level 1
Level 1

Thats a bug, fixed in 17.12.x if i remember correctly. You can give the guestshell more disk if it is now 1MB, we set it to 30MB and then it did not longer happen. Do not forget to destroy and enable guestshell to have the new value of 30MB.

Review Cisco Networking for a $25 gift card