Content
Attach file triggers internal error
Added by Jan Busk almost 6 years ago
Hi!
I've installed OpenProject via the docker container. When I try to attach a file to a work package all seems to work fine. OP says "uploading file" and then the error message "Internal error" show up.
Any help would be most appreciated!
/Jan B
System:
Docker image running on Ubuntu 16.04
web_stdout.log error msgs
App 497 output: Started POST "/api/v3/work_packages/51/attachments" for xxx.xxx.xxx.xxx at 2018-11-29 06:30:16 +0000
App 497 output: Grape rescuing from error: API::Errors::InternalError
App 497 output:
App 497 output: Original error: #<NoMethodError: undefined method message' for #<#<Class:0x0000564443d7b288>:0x000056443b0827a0>> App 497 output: App 497 output: Stacktrace: App 497 output: App 497 output: /usr/src/app/lib/api/v3/attachments/attachments\_by\_container\_api.rb:105:in
log_attachment_saving_error'
App 497 output: /usr/src/app/lib/api/v3/attachments/attachments_by_container_api.rb:95:in rescue in with\_handled\_create\_errors' App 497 output: /usr/src/app/lib/api/v3/attachments/attachments\_by\_container\_api.rb:90:in
with_handled_create_errors'
App 497 output: /usr/src/app/lib/api/v3/attachments/attachments_by_container_api.rb:84:in build\_and_attach' App 497 output: /usr/src/app/lib/api/v3/attachments/attachments\_by\_container\_api.rb:74:in
parse_and_create'
App 497 output: /usr/src/app/lib/api/v3/attachments/attachments_by_container_api.rb:128:in block in create' App 497 output: /usr/local/bundle/gems/grape-1.1.0/lib/grape/endpoint.rb:57:in
call'
App 497 output: /usr/local/bundle/gems/grape-1.1.0/lib/grape/endpoint.rb:57:in block (2 levels) in generate\_api\_method' App 497 output: /usr/local/bundle/gems/activesupport-5.1.6/lib/active_support/notifications.rb:168:in
instrument'
App 497 output: /usr/local/bundle/gems/grape-1.1.0/lib/grape/endpoint.rb:56:in block in generate\_api\_method' App 497 output: /usr/local/bundle/gems/grape-1.1.0/lib/grape/endpoint.rb:262:in
block in run'
App 497 output: /usr/local/bundle/gems/activesupport-5.1.6/lib/active_support/notifications.rb:168:in instrument' App 497 output: /usr/local/bundle/gems/grape-1.1.0/lib/grape/endpoint.rb:243:in
run'
App 497 output: /usr/local/bundle/gems/grape-1.1.0/lib/grape/endpoint.rb:313:in block in build_stack' App 497 output: /usr/local/bundle/gems/newrelic\_rpm-4.5.0.337/lib/new\_relic/agent/instrumentation/middleware_tracing.rb:92:in
call'
App 497 output: /usr/local/bundle/gems/grape-1.1.0/lib/grape/middleware/base.rb:31:in call!' App 497 output: /usr/local/bundle/gems/grape-1.1.0/lib/grape/middleware/base.rb:24:in
call'
App 497 output: /usr/local/bundle/gems/newrelic_rpm-4.5.0.337/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' App 497 output: /usr/local/bundle/gems/grape-1.1.0/lib/grape/middleware/base.rb:31:in
call!'
App 497 output: /usr/local/bundle/gems/grape-1.1.0/lib/grape/middleware/base.rb:24:in call' App 497 output: /usr/local/bundle/gems/newrelic\_rpm-4.5.0.337/lib/new\_relic/agent/instrumentation/middleware_tracing.rb:92:in
call'
App 497 output: /usr/local/bundle/gems/warden-1.2.7/lib/warden/manager.rb:36:in block in call' App 497 output: /usr/local/bundle/gems/warden-1.2.7/lib/warden/manager.rb:35:in
catch'
App 497 output: /usr/local/bundle/gems/warden-1.2.7/lib/warden/manager.rb:35:in call' App 497 output: /usr/local/bundle/gems/newrelic\_rpm-4.5.0.337/lib/new\_relic/agent/instrumentation/middleware_tracing.rb:92:in
call'
App 497 output: /usr/local/bundle/gems/grape-1.1.0/lib/grape/middleware/error.rb:38:in block in call!' App 497 output: /usr/local/bundle/gems/grape-1.1.0/lib/grape/middleware/error.rb:37:in
catch'
App 497 output: /usr/local/bundle/gems/grape-1.1.0/lib/grape/middleware/error.rb:37:in call!' App 497 output: /usr/local/bundle/gems/grape-1.1.0/lib/grape/middleware/base.rb:24:in
call'
App 497 output: /usr/local/bundle/gems/newrelic_rpm-4.5.0.337/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' App 497 output: /usr/local/bundle/gems/rack-2.0.5/lib/rack/head.rb:12:in
call'
App 497 output: /usr/local/bundle/gems/newrelic_rpm-4.5.0.337/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' App 497 output: /usr/local/bundle/gems/grape-1.1.0/lib/grape/endpoint.rb:227:in
call!'
App 497 output: /usr/local/bundle/gems/grape-1.1.0/lib/grape/endpoint.rb:221:in call' App 497 output: /usr/local/bundle/gems/grape-1.1.0/lib/grape/router/route.rb:72:in
exec'
App 497 output: /usr/local/bundle/gems/grape-1.1.0/lib/grape/router.rb:121:in process_route' App 497 output: /usr/local/bundle/gems/grape-1.1.0/lib/grape/router.rb:74:in
block in identity'
App 497 output: /usr/local/bundle/gems/grape-1.1.0/lib/grape/router.rb:93:in transaction' App 497 output: /usr/local/bundle/gems/grape-1.1.0/lib/grape/router.rb:72:in
identity'
App 497 output: /usr/local/bundle/gems/grape-1.1.0/lib/grape/router.rb:57:in block in call' App 497 output: /usr/local/bundle/gems/grape-1.1.0/lib/grape/router.rb:137:in
with_optimization'
App 497 output: /usr/local/bundle/gems/grape-1.1.0/lib/grape/router.rb:56:in call' App 497 output: /usr/local/bundle/gems/grape-1.1.0/lib/grape/api.rb:119:in
call'
App 497 output: /usr/local/bundle/gems/newrelic_rpm-4.5.0.337/lib/new_relic/agent/instrumentation/grape.rb:115:in call\_with\_new_relic' App 497 output: /usr/local/bundle/gems/grape-1.1.0/lib/grape/api.rb:45:in
call!'
App 497 output: /usr/local/bundle/gems/grape-1.1.0/lib/grape/api.rb:40:in call' App 497 output: /usr/local/bundle/gems/actionpack-5.1.6/lib/action_dispatch/routing/mapper.rb:17:in
block in class:Constraints'
App 497 output: /usr/local/bundle/gems/actionpack-5.1.6/lib/action_dispatch/routing/mapper.rb:46:in serve' App 497 output: /usr/local/bundle/gems/actionpack-5.1.6/lib/action_dispatch/journey/router.rb:50:in
block in serve'
App 497 output: /usr/local/bundle/gems/actionpack-5.1.6/lib/action_dispatch/journey/router.rb:33:in each' App 497 output: /usr/local/bundle/gems/actionpack-5.1.6/lib/action_dispatch/journey/router.rb:33:in
serve'
App 497 output: /usr/local/bundle/gems/actionpack-5.1.6/lib/action_dispatch/routing/route_set.rb:844:in call' App 497 output: /usr/local/bundle/gems/newrelic\_rpm-4.5.0.337/lib/new\_relic/agent/instrumentation/middleware_tracing.rb:92:in
call'
App 497 output: /usr/local/bundle/bundler/gems/omniauth-40c6f5f751d2/lib/omniauth/builder.rb:63:in call' App 497 output: /usr/local/bundle/gems/newrelic\_rpm-4.5.0.337/lib/new\_relic/agent/instrumentation/middleware_tracing.rb:92:in
call'
App 497 output: /usr/local/bundle/bundler/gems/omniauth-40c6f5f751d2/lib/omniauth/strategy.rb:189:in call!' App 497 output: /usr/local/bundle/bundler/gems/omniauth-40c6f5f751d2/lib/omniauth/strategy.rb:167:in
call'
App 497 output: /usr/local/bundle/gems/newrelic_rpm-4.5.0.337/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' App 497 output: /usr/local/bundle/bundler/gems/omniauth-40c6f5f751d2/lib/omniauth/builder.rb:63:in
call'
App 497 output: /usr/local/bundle/gems/newrelic_rpm-4.5.0.337/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' App 497 output: /usr/local/bundle/gems/newrelic\_rpm-4.5.0.337/lib/new\_relic/rack/agent\_hooks.rb:30:in
traced_call'
App 497 output: /usr/local/bundle/gems/newrelic_rpm-4.5.0.337/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' App 497 output: /usr/local/bundle/gems/newrelic\_rpm-4.5.0.337/lib/new\_relic/rack/browser\_monitoring.rb:32:in
traced_call'
App 497 output: /usr/local/bundle/gems/newrelic_rpm-4.5.0.337/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' App 497 output: /usr/local/bundle/bundler/gems/omniauth-40c6f5f751d2/lib/omniauth/builder.rb:63:in
call'
App 497 output: /usr/local/bundle/gems/newrelic_rpm-4.5.0.337/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' App 497 output: /usr/src/app/app/middleware/reset\_current\_user.rb:47:in
call'
App 497 output: /usr/local/bundle/gems/newrelic_rpm-4.5.0.337/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' App 497 output: /usr/local/bundle/gems/rack-2.0.5/lib/rack/tempfile_reaper.rb:15:in
call'
App 497 output: /usr/local/bundle/gems/newrelic_rpm-4.5.0.337/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' App 497 output: /usr/local/bundle/gems/rack-attack-5.2.0/lib/rack/attack.rb:172:in
call'
App 497 output: /usr/local/bundle/gems/newrelic_rpm-4.5.0.337/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' App 497 output: /usr/local/bundle/gems/rack-2.0.5/lib/rack/etag.rb:25:in
call'
App 497 output: /usr/local/bundle/gems/newrelic_rpm-4.5.0.337/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' App 497 output: /usr/local/bundle/gems/rack-2.0.5/lib/rack/deflater.rb:34:in
call'
App 497 output: /usr/local/bundle/gems/newrelic_rpm-4.5.0.337/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' App 497 output: /usr/local/bundle/gems/rack-2.0.5/lib/rack/conditional_get.rb:38:in
call'
App 497 output: /usr/local/bundle/gems/newrelic_rpm-4.5.0.337/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' App 497 output: /usr/local/bundle/gems/rack-2.0.5/lib/rack/head.rb:12:in
call'
App 497 output: /usr/local/bundle/gems/newrelic_rpm-4.5.0.337/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' App 497 output: /usr/local/bundle/gems/rack-2.0.5/lib/rack/session/abstract/id.rb:232:in
context'
App 497 output: /usr/local/bundle/gems/rack-2.0.5/lib/rack/session/abstract/id.rb:226:in call' App 497 output: /usr/local/bundle/gems/newrelic\_rpm-4.5.0.337/lib/new\_relic/agent/instrumentation/middleware_tracing.rb:92:in
call'
App 497 output: /usr/local/bundle/gems/ac
App 497 output: tionpack-5.1.6/lib/action_dispatch/middleware/cookies.rb:613:in call' App 497 output: /usr/local/bundle/gems/newrelic\_rpm-4.5.0.337/lib/new\_relic/agent/instrumentation/middleware_tracing.rb:92:in
call'
App 497 output: /usr/local/bundle/gems/actionpack-5.1.6/lib/action_dispatch/middleware/callbacks.rb:26:in block in call' App 497 output: /usr/local/bundle/gems/activesupport-5.1.6/lib/active\_support/callbacks.rb:97:in
run_callbacks'
App 497 output: /usr/local/bundle/gems/actionpack-5.1.6/lib/action_dispatch/middleware/callbacks.rb:24:in call' App 497 output: /usr/local/bundle/gems/newrelic\_rpm-4.5.0.337/lib/new\_relic/agent/instrumentation/middleware_tracing.rb:92:in
call'
App 497 output: /usr/local/bundle/gems/actionpack-5.1.6/lib/action_dispatch/middleware/debug_exceptions.rb:59:in call' App 497 output: /usr/local/bundle/gems/newrelic\_rpm-4.5.0.337/lib/new\_relic/agent/instrumentation/middleware_tracing.rb:92:in
call'
App 497 output: /usr/local/bundle/gems/actionpack-5.1.6/lib/action_dispatch/middleware/show_exceptions.rb:31:in call' App 497 output: /usr/local/bundle/gems/newrelic\_rpm-4.5.0.337/lib/new\_relic/agent/instrumentation/middleware_tracing.rb:92:in
call'
App 497 output: /usr/local/bundle/gems/railties-5.1.6/lib/rails/rack/logger.rb:36:in call_app' App 497 output: /usr/local/bundle/gems/railties-5.1.6/lib/rails/rack/logger.rb:24:in
block in call'
App 497 output: /usr/local/bundle/gems/activesupport-5.1.6/lib/active_support/tagged_logging.rb:69:in block in tagged' App 497 output: /usr/local/bundle/gems/activesupport-5.1.6/lib/active\_support/tagged\_logging.rb:26:in
tagged'
App 497 output: /usr/local/bundle/gems/activesupport-5.1.6/lib/active_support/tagged_logging.rb:69:in tagged' App 497 output: /usr/local/bundle/gems/railties-5.1.6/lib/rails/rack/logger.rb:24:in
call'
App 497 output: /usr/local/bundle/gems/newrelic_rpm-4.5.0.337/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' App 497 output: /usr/local/bundle/gems/actionpack-5.1.6/lib/action\_dispatch/middleware/remote\_ip.rb:79:in
call'
App 497 output: /usr/local/bundle/gems/newrelic_rpm-4.5.0.337/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' App 497 output: /usr/local/bundle/gems/request\_store-1.4.1/lib/request\_store/middleware.rb:19:in
call'
App 497 output: /usr/local/bundle/gems/newrelic_rpm-4.5.0.337/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' App 497 output: /usr/local/bundle/gems/actionpack-5.1.6/lib/action\_dispatch/middleware/request\_id.rb:25:in
call'
App 497 output: /usr/local/bundle/gems/newrelic_rpm-4.5.0.337/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' App 497 output: /usr/local/bundle/gems/rack-2.0.5/lib/rack/method_override.rb:22:in
call'
App 497 output: /usr/local/bundle/gems/newrelic_rpm-4.5.0.337/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' App 497 output: /usr/local/bundle/gems/rack-2.0.5/lib/rack/runtime.rb:22:in
call'
App 497 output: /usr/local/bundle/gems/newrelic_rpm-4.5.0.337/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' App 497 output: /usr/local/bundle/gems/activesupport-5.1.6/lib/active\_support/cache/strategy/local\_cache_middleware.rb:27:in
call'
App 497 output: /usr/local/bundle/gems/newrelic_rpm-4.5.0.337/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' App 497 output: /usr/local/bundle/gems/actionpack-5.1.6/lib/action_dispatch/middleware/executor.rb:12:in
call'
App 497 output: /usr/local/bundle/gems/newrelic_rpm-4.5.0.337/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' App 497 output: /usr/local/bundle/gems/actionpack-5.1.6/lib/action_dispatch/middleware/static.rb:125:in
call'
App 497 output: /usr/local/bundle/gems/newrelic_rpm-4.5.0.337/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' App 497 output: /usr/local/bundle/gems/rack-2.0.5/lib/rack/sendfile.rb:111:in
call'
App 497 output: /usr/local/bundle/gems/newrelic_rpm-4.5.0.337/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' App 497 output: /usr/local/bundle/gems/secure\_headers-5.0.5/lib/secure\_headers/middleware.rb:13:in
call'
App 497 output: /usr/local/bundle/gems/newrelic_rpm-4.5.0.337/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' App 497 output: /usr/local/bundle/gems/railties-5.1.6/lib/rails/engine.rb:522:in
call'
App 497 output: /usr/local/bundle/gems/railties-5.1.6/lib/rails/railtie.rb:185:in public_send' App 497 output: /usr/local/bundle/gems/railties-5.1.6/lib/rails/railtie.rb:185:in
method_missing'
App 497 output: /usr/local/bundle/gems/newrelic_rpm-4.5.0.337/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' App 497 output: /usr/local/bundle/gems/rack-protection-2.0.1/lib/rack/protection/frame_options.rb:31:in
call'
App 497 output: /usr/local/bundle/gems/newrelic_rpm-4.5.0.337/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' App 497 output: /usr/local/bundle/gems/rack-protection-2.0.1/lib/rack/protection/json_csrf.rb:26:in
call'
App 497 output: /usr/local/bundle/gems/newrelic_rpm-4.5.0.337/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' App 497 output: /usr/local/bundle/gems/rack-2.0.5/lib/rack/urlmap.rb:68:in
block in call'
App 497 output: /usr/local/bundle/gems/rack-2.0.5/lib/rack/urlmap.rb:53:in each' App 497 output: /usr/local/bundle/gems/rack-2.0.5/lib/rack/urlmap.rb:53:in
call'
App 497 output: /usr/local/bundle/gems/newrelic_rpm-4.5.0.337/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' App 497 output: /usr/local/bundle/gems/passenger-5.3.3/src/ruby\_supportlib/phusion\_passenger/rack/thread\_handler\_extension.rb:97:in
process_request'
App 497 output: /usr/local/bundle/gems/passenger-5.3.3/src/ruby_supportlib/phusion_passenger/request_handler/thread_handler.rb:157:in accept\_and\_process\_next\_request' App 497 output: /usr/local/bundle/gems/passenger-5.3.3/src/ruby\_supportlib/phusion\_passenger/request\_handler/thread\_handler.rb:110:in
main_loop'
App 497 output: /usr/local/bundle/gems/passenger-5.3.3/src/ruby_supportlib/phusion_passenger/request_handler.rb:415:in block (3 levels) in start\_threads' App 497 output: /usr/local/bundle/gems/passenger-5.3.3/src/ruby\_supportlib/phusion\_passenger/utils.rb:113:in
block in create_thread_and_abort_on_exception'
[ N 2018-11-29 06:32:23.4891 404/T3 age/Cor/CoreMain.cpp:1028 ]: Checking whether to disconnect long-running connections for process 2117, application /usr/src/app (production)
Replies (3)
Dear Jan,
the actual error is shadowed by a syntax error in the exception handling. I assume the underyling error could have something to do with insufficient permission by the system to write into the attachment storage path.
Did you modify the
ATTACHMENTS_STORAGE_PATH
or change permissions? What kind of installation are you using?Could you apply the following patch to improve the error message?
https://github.com/opf/openproject/commit/a290203bdd.patch
Download the patch and check whether it applies: From your OpenProject root folder:
⟩ curl -o patchfile https://github.com/opf/openproject/commit/a290203bdd.patch
Check whether the patch applies cleanly
⟩ git apply --check patchfile
If nothing is output, it applies cleanly. Then, actually apply the patch:
⟩ git apply patchfile
You will then need to restart your server with (packaged installation)
service openproject restart
orsystemctl restart openproject
depending on your distribution. In a manual installation, restart your application server respectively.To reverse the patch again, run
git apply -R <patchfile>
Best,
Oliver
Thanks for coming back to me Oliver!
I run the openproject docker container on an ubuntu 16.04 machine. I haven't done any permission changes or changes to configuration.yml. I will try to apply the patch inside the docker container.
As far as I know all changes inside the container will be temporary and disappear when the docker container is stopped.
Anyways I'll try to apply the patch and come back with the result.
Being new to docker it took me a while (googling and head scratching) before I manged to tty to the docker container. Applying the patch went flawless but I could not restart the openproject service since it does not exist. Restarting the container will reset all changes so I'm kind of lost here.
Referring to the installation guide for the docker install, I guess that starting the container with
would mean that attachments would be stored on the local machine at /var/lib/openproject/static? I have checked that it has rw access for all users.