mikitex70/redmine_drawio

Error saving draw.io as issue attachment

Closed this issue · 5 comments

I have an error when saving diagram as attachment in issue.
No any problems with dmsf in issue, and no any problems with both attachment and dmsf in Wiki.

Steps to reproduce:

  • Add new issue comment with {{drawio_attach(Test.png)}} macros
  • Double-click yellow button and draw something
  • Save
  • Now diagram shows up in comment, but error pop-ups: Make sure WebDAV capabilities of DMSF module is enabled (seems to be 404 in code)
  • Attachment is not saved
  • After page refresh yellow button appears again

Redmine 3.4 on Ubuntu 14.04
Latest plugin code from master branch.

Please see my logs below. Notice ActionController::RoutingError (No route matches [GET] "/issues/30814/.json")

Started POST "/uploads.json?filename=Test_1.svg" for XXX.XXX.XXX.XXX at 2020-05-04 16:40:12 +0300
Processing by AttachmentsController#upload as JSON
  Parameters: {"filename"=>"Test_1.svg"}
  Current user: XXX (id=3)
= Running shared code for Attachment (#) "#<Attachment:0x007fe62f14cef0>"
= Finished running shared code for Attachment (#) "#<Attachment:0x007fe62f14cef0>"
Saving attachment '/opt/bitnami/apps/redmine/htdocs/files/2020/05/200504164012_Test_1.svg' (1415 bytes)
  Rendered attachments/upload.api.rsb (0.7ms)
Completed 201 Created in 58ms (Views: 2.0ms | ActiveRecord: 31.4ms)
Started GET "/issues/30814/.json?include=journals" for XXX.XXX.XXX.XXX at 2020-05-04 16:40:12 +0300

ActionController::RoutingError (No route matches [GET] "/issues/30814/.json"):
  vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.8/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
  vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.8/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  vendor/bundle/ruby/2.3.0/gems/railties-4.2.8/lib/rails/rack/logger.rb:38:in `call_app'
  vendor/bundle/ruby/2.3.0/gems/railties-4.2.8/lib/rails/rack/logger.rb:20:in `block in call'
  vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/tagged_logging.rb:68:in `block in tagged'
  vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/tagged_logging.rb:26:in `tagged'
  vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/tagged_logging.rb:68:in `tagged'
  vendor/bundle/ruby/2.3.0/gems/railties-4.2.8/lib/rails/rack/logger.rb:20:in `call'
  vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.8/lib/action_dispatch/middleware/request_id.rb:21:in `call'
  vendor/bundle/ruby/2.3.0/gems/rack-1.6.11/lib/rack/methodoverride.rb:22:in `call'
  vendor/bundle/ruby/2.3.0/gems/rack-1.6.11/lib/rack/runtime.rb:18:in `call'
  vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
  vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.8/lib/action_dispatch/middleware/static.rb:120:in `call'
  vendor/bundle/ruby/2.3.0/gems/rack-1.6.11/lib/rack/content_length.rb:15:in `call'
  vendor/bundle/ruby/2.3.0/gems/rack-1.6.11/lib/rack/sendfile.rb:113:in `call'
  vendor/bundle/ruby/2.3.0/gems/railties-4.2.8/lib/rails/engine.rb:518:in `call'
  vendor/bundle/ruby/2.3.0/gems/railties-4.2.8/lib/rails/application.rb:165:in `call'
  vendor/bundle/ruby/2.3.0/gems/railties-4.2.8/lib/rails/railtie.rb:194:in `public_send'
  vendor/bundle/ruby/2.3.0/gems/railties-4.2.8/lib/rails/railtie.rb:194:in `method_missing'
  passenger (5.1.2) src/ruby_supportlib/phusion_passenger/rack/thread_handler_extension.rb:97:in `process_request'
  passenger (5.1.2) src/ruby_supportlib/phusion_passenger/request_handler/thread_handler.rb:152:in `accept_and_process_next_request'
  passenger (5.1.2) src/ruby_supportlib/phusion_passenger/request_handler/thread_handler.rb:113:in `main_loop'
  passenger (5.1.2) src/ruby_supportlib/phusion_passenger/request_handler.rb:416:in `block (3 levels) in start_threads'
  passenger (5.1.2) src/ruby_supportlib/phusion_passenger/utils.rb:113:in `block in create_thread_and_abort_on_exception'

See #76, it's a problem only with the main wiki page, other are working fine.
Download version 0.9.4 which fixes this issue.

@mikitex70 i think my issue is not a dupe, but a consequences of that fix.
I've cloned your repo just half a day ago, #76 was already fixed there.
Please notice that i have error with Issue, not with Wiki.

And now when i reverted e2201bb, error is gone.
It seems to be a regress so.

Ok, I will check your issue. I've not tested issues so maybe I've introduced a new bug.

You were right, I've introduced a new bug with last fix.
Try version 0.9.5, which now fixes also the bug with issues.
Sorry for the drawback.

Thanks, now it's working!