Project

General

Profile

Actions

Defect #13564

closed

Can't upload image

Added by Anton Cherepanov almost 12 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Attachments
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Invalid
Affected version:

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

GAziYvs.png (10.1 KB) GAziYvs.png Anton Cherepanov, 2013-03-22 19:36
Actions #1

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?

Actions #2

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

http://www.youtube.com/watch?v=tGt5XJ1WYyM

Actions #3

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).

Actions #4

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.

Actions #5

Updated by Etienne Massip almost 12 years ago

BTW, my filters are just for example and probably not Nginx syntax obviously =)

Actions #6

Updated by Anton Cherepanov over 11 years ago

Could you send lines with that it will be working ? (nginx config)

Actions #7

Updated by Etienne Massip over 11 years ago

No because:
  • 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)
Actions #8

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;
 }
}
Actions #9

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.

Actions #10

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.

Actions #11

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))$ {

Actions #12

Updated by Anton Cherepanov over 11 years ago

thanks! it is working =)

Actions #13

Updated by Anton Cherepanov over 11 years ago

but it does not work in issue info - thumbnails

Actions #15

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

Actions #16

Updated by Etienne Massip over 11 years ago

Have a look to your production.log contents.

Actions #17

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.

Actions

Also available in: Atom PDF