/opt/unetlab/wrappers/unl_wrapper -a fixpermissions Error

 

When i m trying to give permission getting this error. im not much aware of the PHP can some one please help me

 

root@instance-1:~# /opt/unetlab/wrappers/unl_wrapper -a fixpermissions
PHP Notice: file_get_contents(): read of 8192 bytes failed with errno=21 Is a directory in /opt/unetlab/html/includes/init.php on line 71

0 12 10.9K
12 REPLIES 12

The error code "errno 21" seems to be "Is a directory" and is the kind of error one gets when one references a directory when a reference to a plain file is expected.  Unfortunately, there is not enough context.  If you can describe in more detail what you are trying to achieve, the steps you have taken and whether or not you see this as a Google Cloud related issue .. that would be great.

Anyone have the solutions for this issue? Im getting the same issue while executing the command /opt/unetlab/wrappers/unl_wrapper -a fixpermissions in command line.

Do we have alternative way to change permission not executing the commands?

Just check if you have /opt/unetlab/platform and /opt/unetlab/hypervisor files.

If you don't just create it and type "bare" or "VM" (depends if you have bare or vm server) for hypervisor and "intel" for platform file.

root@srv-eveng-IPv0:~# /opt/unetlab/wrappers/unl_wrapper -a fixpermissions
Just try 
chmod -R 777 /opt/unetlab/

(All commands must be run as root)

1. Check that the 71st line in the specified file (/opt/unetlab/html/includes/init.php) is such as:

$kvm_family = file_get_contents("/opt/unetlab/platform");

If it's not, edit it to look like this.

2. Run the command:

dmesg | grep -i cpu | grep -i -e intel -e amd

if you get an output line with the word "Intel"

then run the following command:

echo "intel" > /opt/unetlab/platform

If you get an output line with the word "amd", then run:

echo "amd" > /opt/unetlab/platform

this should solve your problem with launching unl_wrapper -a fixpermissions

Worked perfectly for me. Thank you!

Very useful. Worked for me. Thanks

sorry i did it when i deploy fortigate to eve-ng but i can not see fortigate image in eve-ng GUI so what problem with my lab ?

 

Perfect man, you resolved my problem.😁

It works thank you!

The error message PHP Notice: file_get_contents(): read of 8192 bytes failed with errno=21 Is a directory means that the file_get_contents() function is trying to read a directory, but directories cannot be read.

This error is likely occurring because the init.php file on line 71 contains a path to a directory instead of a file. For example, if the line looks like this:

PHP
$kvm_family = file_get_contents("/opt/unetlab/platform");

Then the file_get_contents() function will try to read the /opt/unetlab/platform directory, which will cause the error.

To fix this error, you need to edit the init.php file and change the path on line 71 to a file instead of a directory. For example, you could change the line to:

PHP
$kvm_family = file_get_contents("/opt/unetlab/platform/version");

Once you have made the change, save the file and run the unl_wrapper command again.

If you are not sure what the correct path should be, you can consult the UnetLab documentation.

Here are some additional troubleshooting tips:

  • Make sure that the init.php file exists and is readable.
  • Make sure that the user running the unl_wrapper command has permission to read the init.php file.
  • Try restarting the UnetLab service.
  • If you are still having problems, contact UnetLab support for assistance.

I have tried all the things mentioned above still not able to resolve the issue. Can anyone help me how to resolve this issue on google cloud.

root@eve-ng:~# /opt/unetlab/wrappers/unl_wrapper -a fixpermissions
PHP Warning: file_get_contents(/opt/unetlab/platform): failed to open stream: No such file or directory in /opt/unetlab/html/includes/init.php on line 71

root@eve-ng:~#