Closed hexistore closed 7 years ago
I have a similar problem. (png also)
Started GET "/plantuml/svg/plantuml_014e26497d93d28d0134c188ce0a5d58daa0013747eae594c935857213061d9e.svg" for 213.87.155.38 at 2018-08-27 14:34:24 +0000
Processing by PlantumlController#convert as
Parameters: {"content_type"=>"svg", "filename"=>"plantuml_014e26497d93d28d0134c188ce0a5d58daa0013747eae594c935857213061d9e"}
Current user: l.terekhov (id=5)
Sent file /usr/src/redmine/files/plantuml_014e26497d93d28d0134c188ce0a5d58daa0013747eae594c935857213061d9e.svg (0.2ms)
Completed 500 Internal Server Error in 9ms (ActiveRecord: 2.7ms)
ActionController::MissingFile (Cannot read file /usr/src/redmine/files/plantuml_014e26497d93d28d0134c188ce0a5d58daa0013747eae594c935857213061d9e.svg):
plugins/plantuml/app/controllers/plantuml_controller.rb:7:in `convert'
lib/redmine/sudo_mode.rb:63:in `sudo_mode'
plugins/redmine_dmsf/lib/redmine_dmsf/webdav/custom_middleware.rb:62:in `call'
How to solve it?
My redmine is deployed in the docker.
My plantuml section in Dockerfile:
#pluntuml
RUN apt-get update && apt-get install -y default-jre graphviz
COPY ./Dockerfiles/plantuml_lib/plantuml /usr/bin/plantuml
COPY ./Dockerfiles/plantuml_lib/plantuml.jar /opt/plantuml.jar
RUN chmod u+x /usr/bin/plantuml \
&& chown redmine:redmine /usr/bin/plantuml
Contents of file plantuml:
#!/bin/bash
/usr/bin/java -Djava.io.tmpdir=/var/tmp -Djava.awt.headless=true -jar /opt/plantuml.jar ${@}
My redmine info:
Environment:
Redmine version 3.4.6.stable
Ruby version 2.4.4-p296 (2018-03-28) [x86_64-linux]
Rails version 4.2.8
Environment production
Database adapter PostgreSQL
Plugin settings:
@lterekhov I got the same issue today and spent a little time debug it. Finally I found it is incorrect file permission of plantuml.jar.
First you can check apache2 error log /var/apache2/log/error.log (or if you using other web container, please check related log). There is message prnted as this,
App 24096 stderr: Error: Unable to access jarfile /var/plantuml/lib/plantuml.jar
App 24096 stderr:
Then I found the plantuml.jar owner is root, and other user cannot access it. For apache2 service, it is running as www-data user. So I do these to fix the problem,
cd /var/plantuml/lib
chown www-data:www-data plantuml.jar
chmod 755 plantuml.jar
service apache2 restart
I'm not using plantuml docker here but start from scratch. Please check which user the web container is running with and set that accordingly, which may not "www-data".
Other than this, please check,
For any issue, other than check Redmine production log, you also need check web container log like error.log of apache2.
There was a similar thread here which is incorrect permission of /usr/bin/plantuml.
https://github.com/sameersbn/docker-redmine/issues/261
PS: Why this problem happens on docker? I think it is because on docker, sudo doesn't work. Every file copied will belong to root. Then we may forget to change correct owner of related files.
how to solve this error?