Bug #112
Incorrect images file names in 0.7.5 archive
| Status: | Rejected | Start: | 03/05/2009 | |
| Priority: | Normal | Due date: | ||
| Assigned to: | - | % Done: | 0% |
|
| Category: | Visible | Spent time: | - | |
| Target version: | 0.7.5 | |||
Description
Trying to generate a report, tosca throws :
Magick::ImageMagickError in ReportingController#general unable to open image `/opt/tosca/public/images/reporting/by_type.png': Permission deniedHere's what i have i my images/reporting dir :
# ll public/images/reporting/ total 112K -rw-rw-r-- 1 www-data root 172 2009-01-30 11:43 x0082dd.png -rw-rw-r-- 1 www-data root 173 2009-01-30 11:43 x22a4ff.png -rw-rw-r-- 1 www-data root 186 2009-01-30 11:43 x330065.png -rw-rw-r-- 1 www-data root 185 2009-01-30 11:43 x339833.png -rw-rw-r-- 1 www-data root 185 2009-01-30 11:43 x339898.png -rw-rw-r-- 1 www-data root 186 2009-01-30 11:43 x3399fe.png -rw-rw-r-- 1 www-data root 186 2009-01-30 11:43 x343397.png -rw-rw-r-- 1 www-data root 186 2009-01-30 11:43 x6ab200.png -rw-rw-r-- 1 www-data root 173 2009-01-30 11:43 x84dd00.png -rw-rw-r-- 1 www-data root 185 2009-01-30 11:43 x970264.png -rw-rw-r-- 1 www-data root 187 2009-01-30 11:43 x99cb33.png -rw-rw-r-- 1 www-data root 173 2009-01-30 11:43 xa6ff22.png -rw-rw-r-- 1 www-data root 184 2009-01-30 11:43 xb20000.png -rw-rw-r-- 1 www-data root 185 2009-01-30 11:43 xb2b200.png -rw-rw-r-- 1 www-data root 186 2009-01-30 11:43 xc0ff63.png -rw-rw-r-- 1 www-data root 171 2009-01-30 11:43 xdd0000.png -rw-rw-r-- 1 www-data root 174 2009-01-30 11:43 xdd8242.png -rw-rw-r-- 1 www-data root 172 2009-01-30 11:43 xdddd00.png -rw-rw-r-- 1 www-data root 186 2009-01-30 11:43 xfc3301.png -rw-rw-r-- 1 www-data root 188 2009-01-30 11:43 xfc3365.png -rw-rw-r-- 1 www-data root 186 2009-01-30 11:43 xfe9933.png -rw-rw-r-- 1 www-data root 187 2009-01-30 11:43 xfecb33.png -rw-rw-r-- 1 www-data root 185 2009-01-30 11:43 xfefe33.png -rw-rw-r-- 1 www-data root 172 2009-01-30 11:43 xff2222.png -rw-rw-r-- 1 www-data root 185 2009-01-30 11:43 xff6363.png -rw-rw-r-- 1 www-data root 173 2009-01-30 11:43 xffa464.png -rw-rw-r-- 1 www-data root 172 2009-01-30 11:43 xffff22.png -rw-rw-r-- 1 www-data root 185 2009-01-30 11:43 xffff63.png
Bad filenames can also be found in the archive :
# tar tvjf sources/tosca-full.tar.bz2 | grep xc0ff63.png -rw-rw-r-- root/root 186 2009-01-30 11:43 tosca/public/images/reporting/xc0ff63.png
History
03/05/2009 12:47 PM - Michel Loiseleur
As the message indicates it, you have to give write rights for www-data on /opt/tosca/public/images/reporting/
03/05/2009 12:49 PM - Michel Loiseleur
For x*.png pictures, it's not a bug or a bad file naming. It's a workaround for a Firefox defect. When printing, Firefox do not print background color of a cell, so we bypass this with a single color picture, named with the HTML reference of the color.
03/05/2009 12:57 PM - Tristan Rivoallan
Michel Loiseleur wrote:
As the message indicates it, you have to give write rights for www-data on /opt/tosca/public/images/reporting/
the webserver does have write rights, so this is not the source of the problem :
$ ll -d /opt/tosca/public/images/reporting/ drwxrwxr-x 2 www-data root 4.0K 2009-01-30 11:43 /opt/tosca/public/images/reporting/
03/05/2009 02:04 PM - Michel Loiseleur
Is www-data the good user running your fcgi/mongrel/thin/whatever you use to run Tosca ?
The file "by_type.png" is generated by the reporting action, with RMagick, so I do not see what can interfere besides a rights problem.
03/05/2009 02:52 PM - Tristan Rivoallan
Michel Loiseleur wrote:
Is www-data the good user running your fcgi/mongrel/thin/whatever you use to run Tosca ?
The file "by_type.png" is generated by the reporting action, with RMagick, so I do not see what can interfere besides a rights problem.
i'm running tosca using apache/passenger, so the user is www-data. but i don't see any problem. The following command works :
sudo -u www-data touch public/images/reporting/by_type.png
I tried running it through webrick : same exception
I tried running it through webrick launched by root, i get
NoMethodError in Reporting#general Showing reporting/_header.html.erb where line#8raised: You have a nil object when you didn't expect it! The error occurred while evaluating nil.image_relative_path
does it help or is it just the same issue with a different wording ?
03/05/2009 02:58 PM - Michel Loiseleur
Maybe it's a good clue : can you try to add a logo to the client on which you try to get reporting ?
03/05/2009 04:27 PM - Tristan Rivoallan
Michel Loiseleur wrote:
Maybe it's a good clue : can you try to add a logo to the client on which you try to get reporting ?
ok, this was the main source of the issue : Report generation fails for clients that do not have a logo. Should i rename the ticket ?
but there's also another problem : i cannot upload a client logo using passenger, it only works with webrick. i'll dig into that now and create another ticket if appropriate...
03/05/2009 04:37 PM - Rémy-Christophe Schermesser
- Status changed from New to Rejected
Hi,
I close this issue and add another one with the real problem.
03/05/2009 04:42 PM - Michel Loiseleur
XSendFile::Plugin.replace_send_file! if RAILS_ENV == 'production'"
from config/environment.rb
03/05/2009 04:44 PM - Tristan Rivoallan
Michel Loiseleur wrote:
For the upload problem, try to remove : [...] from config/environment.rb
i'm running in "development" environment, so i guess this won't do any good.
03/05/2009 05:10 PM - Tristan Rivoallan
Tristan Rivoallan wrote:
but there's also another problem : i cannot upload a client logo using passenger, it only works with webrick. i'll dig into that now and create another ticket if appropriate...
ok one last update on this closed ticket. the problem was caused by http://www.modrails.com/documentation/Users%20guide.html#user_switching. a great feature i was not aware of :)
i added a note about that in the documentation.