HugoHasenbein / redmine_more_previews

Redmine plugin to preview various file types in redmine's preview pane
https://www.redmine.org/plugins/redmine_more_previews
GNU General Public License v2.0
46 stars 15 forks source link

Preview breaks for repo on Windows. Also admin Information page breaks. #29

Open liviriniu opened 2 years ago

liviriniu commented 2 years ago

Hello,

I struggled all day to make this plugin work and not have limits/bugs after installing it. Also I am new to the Ruby/Redmine universe so don't know much, at least I figured out the info below.

Same stack is installed on two stations (on Windows 10 Enterprise x64 and on Windows Server 2012 R2 Standard x64):

Two issues manifesting on both stations: 1) After installing redmine_more_previews, when I access as admin: Administration-> Information it waits for 1 minute and then shows this:

![proxy error Redmine](https://user-images.githubusercontent.com/63544057/127053910-7c98ff77-442e-4723-a5fe-2279081d7c67.PNG)
After that, pages are no longer accessible (stuck on loading or show same error) and I don't have a choice but to restart Redmine. In 'production.log' I find:
```
Started GET "/redmine/admin/info" for 127.0.0.1 at 2021-07-26 20:46:32 +0300
Processing by AdminController#info as HTML
  Current user: admin (id=1)
Imagemagick's convert binary (C:\Bitnami\redmine-4.2.1-2/imagemagick/convert.exe) not available
gs binary (gs) not available
  Rendering admin/info.html.erb within layouts/admin
```
Uninstalling the plugin makes the **Information** page work again and this "not available" is no longer logged.

2) (this one seems very much related to Issue #11 which I read and tested suggestions from it but didn't helped and now I'm stuck) While previewing .xlsx attachments in issues works fine, preview of .xlsx in repository does not work at all. For embedding option with <object><embed>-tag, the "View" tab remains blank (white) and in production.log I find:

    Started GET "/redmine/projects/cl-common-library/repository/test-repo/preview/TESTE.xlsx@/index.html" for 127.0.0.1 at 2021-07-26 22:56:50 +0300
    Processing by RepositoriesController#more_preview as HTML
      Parameters: {"id"=>"cl-common-library", "repository_id"=>"test-repo", "path"=>"TESTE.xlsx"}
      Current user: admin (id=1)
      Couldn't find template for digesting: tabs/tab
    Completed 500 Internal Server Error in 644ms (ActiveRecord: 16.0ms)

    Errno::ENOTEMPTY (Directory not empty @ dir_s_rmdir - C:/WINDOWS/Temp/d20210726-7560-ai8lv3):

    plugins/redmine_more_previews/lib/redmine_more_previews/patches/repository_patch.rb:41:in `more_preview'
    plugins/redmine_more_previews/lib/redmine_more_previews/patches/repositories_controller_patch.rb:94:in `send_more_preview'
    plugins/redmine_more_previews/lib/redmine_more_previews/patches/repositories_controller_patch.rb:61:in `block (2 levels) in more_preview'
    plugins/redmine_more_previews/lib/redmine_more_previews/patches/repositories_controller_patch.rb:60:in `more_preview'
    lib/redmine/sudo_mode.rb:61:in `sudo_mode'
But for option `with <iframe>-tag` I get this:

![repoProblemIFrame](https://user-images.githubusercontent.com/63544057/127052448-161447b5-690e-43b6-94d7-10ba155e9ae7.PNG)
And in the `production.log` similar text as above except "Couldn't find template for digesting: tabs/tab" does not appear.

**This happens for both a local SVN repo (https://) and a local filesystem repo (file:///).**

Cheers!

HugoHasenbein commented 2 years ago

Dear Liviriniu,

it seems, imagemagick is not installed in a complete manner. Imagemagick complains with

Imagemagick's convert binary (C:\Bitnami\redmine-4.2.1-2/imagemagick/convert.exe) not available gs binary (gs) not available

I will add an error catching line to this kind of error soon.

Please, try to install imagemagick in a complete manner or check, if your path variables are set correctly for the redmine process user.

Best regards

Stephan

Am 26.07.2021 um 22:57 schrieb liviriniu @.***>:

Hello,

I struggled all day to make this plugin work and not have limits/bugs after installing it. Also I am new to the Ruby/Redmine universe so don't know much, at least I figured out the info below.

Same stack is installed on two stations (on Windows 10 Enterprise x64 and on Windows Server 2012 R2 Standard x64):

Redmine 4.2.1-stable x64 configured for https LibreOffice 7.0.6 x64 Redmine More Previews 2.0.5 other plugins: redmine_base_deface, redmine_base_stimulusjs, redmine_checklists, redmine_issue_badge, redmine_issue_dynamic_edit, redmine_mentions, redmine_xlsx_format_issue_exporter, redmineup_tags. Two issues manifesting on both stations:

After installing redmine_more_previews, when I access as admin: Administration-> Information it waits for 1 minute and then shows this:

https://user-images.githubusercontent.com/63544057/127053910-7c98ff77-442e-4723-a5fe-2279081d7c67.PNG After that, pages are no longer accessible (stuck on loading or show same error) and I don't have a choice but to restart Redmine. In 'production.log' I find:

Started GET "/redmine/admin/info" for 127.0.0.1 at 2021-07-26 20:46:32 +0300 Processing by AdminController#info as HTML Current user: admin (id=1) Imagemagick's convert binary (C:\Bitnami\redmine-4.2.1-2/imagemagick/convert.exe) not available gs binary (gs) not available Rendering admin/info.html.erb within layouts/admin Uninstalling the plugin makes the Information page work again and this "not available" is no longer logged.

(this one seems very much related to Issue #11 https://github.com/HugoHasenbein/redmine_more_previews/issues/11 which I read and tested suggestions from it but didn't helped and now I'm stuck) While previewing .xlsx attachments in issues works fine, preview of .xlsx in repository does not work at all. For embedding option with -tag, the "View" tab remains blank (white) and in production.log I find:

Started GET "/redmine/projects/cl-common-library/repository/test-repo/preview/TESTE.xlsx@/index.html" for 127.0.0.1 at 2021-07-26 22:56:50 +0300 Processing by RepositoriesController#more_preview as HTML Parameters: {"id"=>"cl-common-library", "repository_id"=>"test-repo", "path"=>"TESTE.xlsx"} Current user: admin (id=1) Couldn't find template for digesting: tabs/tab Completed 500 Internal Server Error in 644ms (ActiveRecord: 16.0ms)

Errno::ENOTEMPTY (Directory not empty @ dir_s_rmdir - C:/WINDOWS/Temp/d20210726-7560-ai8lv3):

plugins/redmine_more_previews/lib/redmine_more_previews/patches/repository_patch.rb:41:in more_preview' plugins/redmine_more_previews/lib/redmine_more_previews/patches/repositories_controller_patch.rb:94:insend_more_preview' plugins/redmine_more_previews/lib/redmine_more_previews/patches/repositories_controller_patch.rb:61:in block (2 levels) in more_preview' plugins/redmine_more_previews/lib/redmine_more_previews/patches/repositories_controller_patch.rb:60:inmore_preview' lib/redmine/sudo_mode.rb:61:in `sudo_mode' But for option with