BookStack icon indicating copy to clipboard operation
BookStack copied to clipboard

ERROR: Error when attempting image upload:chmod(): Operation not permitted

Open jmleandrocr opened this issue 3 years ago • 3 comments

Attempted Debugging

  • [X] I have read the debugging page

Searched GitHub Issues

  • [X] I have searched GitHub for the issue.

Describe the Scenario

I tried to upload images, but it doesn't work. I reviewed the directory and the images exists, but the system show that and error was raised.

Exact BookStack Version

BookStack v23.01.1

Log Content

#8 /app/www/vendor/laravel/framework/src/Illuminate/Routing/ResponseFactory.php(85): Illuminate\\Routing\\ResponseFactory->make()
#9 /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(585): Illuminate\\Routing\\ResponseFactory->view()
#10 /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(490): Illuminate\\Foundation\\Exceptions\\Handler->renderHttpException()
#11 /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(356): Illuminate\\Foundation\\Exceptions\\Handler->prepareResponse()
#12 /app/www/app/Exceptions/Handler.php(66): Illuminate\\Foundation\\Exceptions\\Handler->render()
#13 /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(196): BookStack\\Exceptions\\Handler->render()
#14 /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(173): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->renderHttpResponse()
#15 [internal function]: Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleException()
#16 {main}
  thrown at /app/www/storage/framework/views/872733693c1f8e7d46945825e715cc42e8efb276.php:68)
[stacktrace]
#0 {main}
"} 
[2023-02-21 17:09:46] production.ERROR: Error when attempting image upload:chmod(): Operation not permitted  
[2023-02-21 17:10:08] production.ERROR: Error when attempting image upload:chmod(): Operation not permitted  
[2023-02-21 17:19:18] production.ERROR: Error when attempting image upload:chmod(): Operation not permitted  
[2023-02-21 17:53:26] production.ERROR: Error when attempting image upload:chmod(): Operation not permitted  
[2023-02-21 17:54:17] production.ERROR: Error when attempting image upload:chmod(): Operation not permitted  

PHP Version

No response

Hosting Environment

docker image linuxserver/bookstack on Icon name: computer-vm Chassis: vm Virtualization: kvm Operating System: Oracle Linux Server 7.9 CPE OS Name: cpe:/o:oracle:linux:7:9:server Kernel: Linux 5.4.17-2136.301.1.2.el7uek.x86_64 Architecture: x86-64

jmleandrocr avatar Feb 21 '23 18:02 jmleandrocr

Hi @mleandroj18, I'm guessing there's a file permissions issues at play here. Could be permissions on the files or parent folders, or possibly SELinux if enabled in your environment. Is SELinux enabled in this environment?

ssddanbrown avatar Feb 22 '23 10:02 ssddanbrown

Hi ssddanbrown

Yes, it's enabled in the host.

image

jmleandrocr avatar Feb 22 '23 15:02 jmleandrocr

I resolved the issue, it's a permission issue.

To solved it:

Use a named volume: Instead of mounting a volume from the host, you can create a named volume using the docker volume create command. Named volumes are managed by Docker and should not have file permission issues.

Regards.

jmleandrocr avatar Feb 22 '23 16:02 jmleandrocr