Defect #13564
closedCan't upload image
0%
Description
Hey everybody, I just updated my redmine to 2.3.0 version
And I founded a problem with image uploading, you can see the error on a attachement
Redmine version 2.3.0.stable
Ruby version 2.0.0 (x86_64-linux)
Rails version 3.2.13
Files
Updated by Etienne Massip almost 12 years ago
- Category set to Attachments
- Status changed from New to Needs feedback
- Priority changed from High to Normal
- Resolution set to Cant reproduce
What's in your production.log
file?
What browser(s) did you produce this error with?
Does it happen every time? What permission have the user you were connected with?
Do you have plugins installed? Did you try with no plugin installed?
Updated by Anton Cherepanov almost 12 years ago
What's in your production.log file? - Just sql logs and rendering
What browser(s) did you produce this error with? - Chrome 25.0.1364.172
Does it happen every time? What permission have the user you were connected with? - yes, files have rwxrwxrwx permissons
Do you have plugins installed? - No
Updated by Etienne Massip almost 12 years ago
Anton Cherepanov wrote:
What's in your production.log file? - Just sql logs and rendering
I meant : what are the lines that appear when you try to upload the file?
What permission have the user you were connected with? - yes, files have rwxrwxrwx permissons
I meant Redmine permissions (via Roles).
Updated by Etienne Massip almost 12 years ago
Nevermind, I get it.
Your web frontend Nginx is configured to serve static content and specifically JavaScript content probably based on a pattern/regex basis set somewhat like *.js
.
Browser is calling /upload.js
for eager file upload, which is a dynamic script generated and returned by the Redmine application, but the call never reach the app because of the HTTP server filter.
You have to configure Nginx to serve itself /javascripts/**/*.js
instead of *.js
and leave the other .js calls to the application.
Updated by Etienne Massip almost 12 years ago
BTW, my filters are just for example and probably not Nginx syntax obviously =)
Updated by Anton Cherepanov over 11 years ago
Could you send lines with that it will be working ? (nginx config)
Updated by Etienne Massip over 11 years ago
- I don't know about your present configuration
- I don't know about Nginx syntax (but I could try a guess if I saw your config)
Updated by Anton Cherepanov over 11 years ago
Default configuration based on redmine wiki
upstream app_server { server localhost:3000 fail_timeout=0; } server { listen 80; server_name redmine.xxx.ru; root /sites/nginx/redmine.xxx.ru/public; location / { try_files $uri @ruby; } location ~* ^.+\.(?:css|js|jpe?g|gif|htc|ico|png|html)$ { access_log off; expires 30d; ## No need to bleed constant updates. Send the all shebang in one ## fell swoop. tcp_nodelay off; ## Set the OS file cache. open_file_cache max=3000 inactive=120s; open_file_cache_valid 45s; open_file_cache_min_uses 2; open_file_cache_errors off; } location @ruby { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; proxy_read_timeout 300; proxy_pass http://app_server; } }
Updated by Etienne Massip over 11 years ago
This configuration is not accurate enough.
Try replacing static files location regular expression:
location ~* ^.+\.(?:css|js|jpe?g|gif|htc|ico|png|html)$ {
with:
location ~* ^(?:(?:plugin_assets/|themes/).+/)(?:javascripts|stylesheets|images)/.+\.(?:css|js|jpe?g|gif|htc|ico|png|html)$ {
This should work with Redmine 2.x.
The Redmine wiki page must be a contributed HowTo so it'll be great if you could update it once your configuration is Ok.
Updated by Etienne Massip over 11 years ago
Etienne Massip wrote:
location ~* ^(?:(?:plugin_assets/|themes/).+/)(?:javascripts|stylesheets|images)/.+\.(?:css|js|jpe?g|gif|htc|ico|png|html)$ {
location ~* ^(?:(?:plugin_assets/|themes/).+/)(?:javascripts/.+\.js|stylesheets/.+\.css|images/.+\.(?:jpe?g|gif|htc|ico|png|html))$ {
Would even be more accurate.
Updated by Etienne Massip over 11 years ago
Etienne Massip wrote:
location ~* ^(?:(?:plugin_assets/|themes/).+/)(?:javascripts/.+\.js|stylesheets/.+\.css|images/.+\.(?:jpe?g|gif|htc|ico|png|html))$ {
Would even be more accurate.
Except I miss the "html" thing and "htc" is useless:
location ~* ^favicon.ico|(?:(?:plugin_assets/|themes/).+/)(?:.+\.html|javascripts/.+\.js|stylesheets/.+\.css|images/.+\.(?:jpe?g|gif|ico|png))$ {
Updated by Anton Cherepanov over 11 years ago
but it does not work in issue info - thumbnails
Updated by Anton Cherepanov over 11 years ago
GET http://redmine.xxx.ru/attachments/thumbnail/11 404 (Not Found)
Updated by Etienne Massip over 11 years ago
I think it's because of your previous static assets cache rule, try refreshing after emptying your browser cache?
Disclaimer edit: this is probably a stupid statement
Updated by Etienne Massip over 11 years ago
Have a look to your production.log
contents.
Updated by Etienne Massip over 11 years ago
- Status changed from Needs feedback to Closed
- Resolution changed from Cant reproduce to Invalid
Anyway, it's a configuration issue.
Please update the HowTo accordingly or point us to the HowTo in the wiki so we can do it.