Open GoogleCodeExporter opened 9 years ago
Same problem running on a mongrel cluster:
Processing DmsfController#show (for 10.74.119.28 at 2012-03-14 14:57:24) [GET]
Parameters: {"id"=>"pd1113", "controller"=>"dmsf", "action"=>"show"}
Rendering template within layouts/base
Rendering dmsf/show
ActionView::TemplateError (undefined method `size' for nil:NilClass) on line
#64 of vendor/plugins/redmine_dmsf/app/views/dmsf/show.html.erb:
61: :class => "icon icon-folder") %>
62: <div class="filename" title="<%=
l(:title_number_of_files_in_directory)%>">[<%= subfolder.deep_file_count
%>]</div>
63: </td>
64: <td class="size" title="<%=
l(:title_total_size_of_all_files)%>"><%=
number_to_human_size(subfolder.deep_size) %></td>
65: <td class="modified"><%=
subfolder.updated_at.strftime("%Y-%m-%d %H:%M") %></td>
66: <td class="version"></td>
67: <td class="author"><%= h(subfolder.user) %></td>
vendor/plugins/redmine_dmsf/app/models/dmsf_file.rb:147:in `size'
vendor/plugins/redmine_dmsf/app/models/dmsf_folder.rb:120:in `deep_size'
vendor/plugins/redmine_dmsf/app/models/dmsf_folder.rb:120:in `deep_size'
vendor/plugins/redmine_dmsf/app/models/dmsf_folder.rb:121:in `deep_size'
vendor/plugins/redmine_dmsf/app/models/dmsf_folder.rb:121:in `deep_size'
vendor/plugins/redmine_dmsf/app/views/dmsf/show.html.erb:64
vendor/plugins/redmine_dmsf/app/views/dmsf/show.html.erb:55:in `each'
vendor/plugins/redmine_dmsf/app/views/dmsf/show.html.erb:55
vendor/plugins/redmine_dmsf/app/views/dmsf/show.html.erb:27
config/initializers/mongrel.rb:62:in `dispatch_cgi'
Rendering /usr/prdev/redmine/public/500.html (500 Internal Server Error)
Original comment by smip...@gmail.com
on 14 Mar 2012 at 2:33
[deleted comment]
Additional notes:
Only some Redmine projects are affected (pd1113 project example above).
Other projects on the same server may be unaffected. E.g:
Processing DmsfController#show (for 10.74.119.28 at 2012-03-14 15:37:44) [GET]
Parameters: {"action"=>"show", "id"=>"pd1114", "controller"=>"dmsf"}
Rendering template within layouts/base
Rendering dmsf/show
Completed in 443ms (View: 389, DB: 1) | 200 OK
[http://prdev.eu.omron.net/redmine/dmsf/pd1114]
Original comment by smip...@gmail.com
on 14 Mar 2012 at 2:40
[deleted comment]
I identified what causes DMSF rendering to fail, but a root-cause is still
eluding me:
1. Some as yet unidentified bug resulted in DMSF adding a file entry in
Redmine's SQL database for which no file revisions were created (the dmsf_files
table contains a record without any associated record(s) in the
dmsf_file_revisions table).
2. When the DmsfController#show method renders the folder, it attempts to
display the total size of all files contained in the folder and it's
sub-folders.
3. The file for which there is no revision data available cannot be
class-resolved, resulting in the observed error.
Workarounds (to get DMSF rendering again):
1. Identify any records in the table dmsf_files for which there are no
dmsf_file_revisions (I.e. For some dmsf_file, you can find no
dmsf_file_revisions where dmsf_files.id = dmsf_file_revisions.dmsf_file_id).
You can use any tool that gives you access to the Redmine database (I used
phpmyadmin).
2. Delete these records.
Original comment by smip...@gmail.com
on 14 Mar 2012 at 5:05
This bug happens altogether too often! It seems to happen on some browsers
when the file upload / creation is interrupted. There is no way to recover
from this other than manually messing about in the Redmine SQL database.
Original comment by smip...@gmail.com
on 26 Mar 2012 at 4:37
Here is a workaround that should allow you to recover from this bug:
To identify any files missing revisions:
SELECT * FROM `dmsf_files`
WHERE NOT EXISTS(
SELECT * FROM `dmsf_file_revisions`
WHERE `dmsf_file_revisions`.`dmsf_file_id` = `dmsf_files`.`id`
)
And delete the files missing revisions to recover from the problem:
DELETE FROM `dmsf_files`
WHERE NOT EXISTS(
SELECT * FROM `dmsf_file_revisions`
WHERE `dmsf_file_revisions`.`dmsf_file_id` = `dmsf_files`.`id`
)
Original comment by smip...@gmail.com
on 16 Apr 2012 at 1:25
Thanks for you workaround, it worked perfectly for me. Hope this bug will be
resolved.
Original comment by serge.d...@gmail.com
on 25 Sep 2012 at 9:14
According to:
"1. Some as yet unidentified bug resulted in DMSF adding a file entry in
Redmine's SQL database for which no file revisions were created (the dmsf_files
table contains a record without any associated record(s) in the
dmsf_file_revisions table)."
I was able to identify one scenario which causes creation of such un-revisioned
file:
1. Add file (version 1.0)
2. Add another revision (version 1.1)
3. From the details view, remove version 1.0 => works OK
4. Then remove version 1.1 => after reload: "Internal error" (caused by
described database mismatch)
Trying remove version 1.0, after the step 1. user receives message that it is
prohibited because the file can not exist with no revisions. It seems this
message is missing in the case described above. It is possible that the problem
could be solved by just improving validation of "remove" action in the detail
view.
Original comment by witold.s...@gmail.com
on 11 Oct 2012 at 3:23
I created this issue on github where the plugin is still developped.
I think u should post this there :
https://github.com/danmunn/redmine_dmsf/issues/52
Thanks
Original comment by serge.d...@gmail.com
on 11 Oct 2012 at 3:43
Original issue reported on code.google.com by
guillaum...@gmail.com
on 2 Feb 2012 at 1:21