Content
View differences
Updated by Maximilian Hippler about 5 years ago
### **Environment**:
Your OpenProject Version: Self hosted 11.x with 0 <= x <= 2 Version (Docker all in one container)
Operating System / Browser / OpenProject language: Not a frontend issue, docker container on linux/macOS Host system
### **Logs**
```text
I, [2021-04-25T20:13:13.323898 #139] INFO -- : [ActiveJob] [Projects::DeleteProjectJob] [90657ec3-f01d-44c1-87b8-136939f9151a] Performed Projects::DeleteProjectJob (Job ID: 90657ec3-f01d-44c1-87b8-136939f9151a) from DelayedJob(default) in 31.18ms
[Worker(host:8fd6feff5f5b pid:139)] Job Projects::DeleteProjectJob [90657ec3-f01d-44c1-87b8-136939f9151a] from DelayedJob(default) with arguments: [{"user_id"=>1, "project_id"=>5, "_aj_ruby2_keywords"=>["user_id", "project_id"]}] (id=8) (queue=default) COMPLETED after 0.0409
I, [2021-04-25T20:13:13.332805 #139] INFO -- : 2021-04-25T20:13:13+0000: [Worker(host:8fd6feff5f5b pid:139)] Job Projects::DeleteProjectJob [90657ec3-f01d-44c1-87b8-136939f9151a] from DelayedJob(default) with arguments: [{"user_id"=>1, "project_id"=>5, "_aj_ruby2_keywords"=>["user_id", "project_id"]}] (id=8) (queue=default) COMPLETED after 0.0409
[Worker(host:8fd6feff5f5b pid:139)] 1 jobs processed at 20.6073 j/s, 0 failed
I, [2021-04-25T20:13:13.335336 #139] INFO -- : 2021-04-25T20:13:13+0000: [Worker(host:8fd6feff5f5b pid:139)] 1 jobs processed at 20.6073 j/s, 0 failed
[Worker(host:8fd6feff5f5b pid:139)] Job Projects::DeleteProjectJob [7f07e3d1-30da-49d8-a450-5b3e3011dc2b] from DelayedJob(default) with arguments: [{"user_id"=>1, "project_id"=>6, "_aj_ruby2_keywords"=>["user_id", "project_id"]}] (id=9) (queue=default) RUNNING
I, [2021-04-25T20:13:23.361934 #139] INFO -- : 2021-04-25T20:13:23+0000: [Worker(host:8fd6feff5f5b pid:139)] Job Projects::DeleteProjectJob [7f07e3d1-30da-49d8-a450-5b3e3011dc2b] from DelayedJob(default) with arguments: [{"user_id"=>1, "project_id"=>6, "_aj_ruby2_keywords"=>["user_id", "project_id"]}] (id=9) (queue=default) RUNNING
I, [2021-04-25T20:13:23.362603 #139] INFO -- : [ActiveJob] [Projects::DeleteProjectJob] [7f07e3d1-30da-49d8-a450-5b3e3011dc2b] Performing Projects::DeleteProjectJob (Job ID: 7f07e3d1-30da-49d8-a450-5b3e3011dc2b) from DelayedJob(default) enqueued at 2021-04-25T20:13:18Z
I, [2021-04-25T20:13:23.386552 #139] INFO -- : [ActiveJob] [Projects::DeleteProjectJob] [7f07e3d1-30da-49d8-a450-5b3e3011dc2b] Skipped delivery of mail openproject.project-1-6.20210425201318@example.net as `perform_deliveries` is false
E, [2021-04-25T20:13:23.389334 #139] ERROR -- : [ActiveJob] [Projects::DeleteProjectJob] [7f07e3d1-30da-49d8-a450-5b3e3011dc2b] Encountered an error when trying to delete project '6' : undefined method `join' for #<ActiveModel::Errors:0x000055f2ee46aeb0> /app/app/workers/projects/delete_project_job.rb:66:in `log_service_failure'
/app/app/workers/projects/delete_project_job.rb:46:in `perform'
/app/vendor/bundle/ruby/2.7.0/gems/activejob-6.1.2.1/lib/active_job/execution.rb:48:in `block in perform_now'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/callbacks.rb:117:in `block in run_callbacks'
/app/app/workers/application_job.rb:41:in `block (2 levels) in <class:ApplicationJob>'
/app/app/workers/application_job.rb:78:in `with_clean_request_store'
/app/app/workers/application_job.rb:41:in `block in <class:ApplicationJob>'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/callbacks.rb:126:in `instance_exec'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
/app/vendor/bundle/ruby/2.7.0/gems/i18n-1.8.8/lib/i18n.rb:314:in `with_locale'
/app/vendor/bundle/ruby/2.7.0/gems/activejob-6.1.2.1/lib/active_job/translation.rb:9:in `block (2 levels) in <module:Translation>'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/callbacks.rb:126:in `instance_exec'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/core_ext/time/zones.rb:66:in `use_zone'
/app/vendor/bundle/ruby/2.7.0/gems/activejob-6.1.2.1/lib/active_job/timezones.rb:9:in `block (2 levels) in <module:Timezones>'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/callbacks.rb:126:in `instance_exec'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
/app/vendor/bundle/ruby/2.7.0/gems/activejob-6.1.2.1/lib/active_job/instrumentation.rb:21:in `block in instrument'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/notifications.rb:203:in `block in instrument'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/notifications.rb:203:in `instrument'
/app/vendor/bundle/ruby/2.7.0/gems/activejob-6.1.2.1/lib/active_job/instrumentation.rb:31:in `instrument'
/app/vendor/bundle/ruby/2.7.0/gems/activejob-6.1.2.1/lib/active_job/instrumentation.rb:14:in `block (2 levels) in <module:Instrumentation>'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/callbacks.rb:126:in `instance_exec'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
/app/vendor/bundle/ruby/2.7.0/gems/activejob-6.1.2.1/lib/active_job/logging.rb:22:in `block in tag_logger'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/tagged_logging.rb:99:in `block in tagged'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/tagged_logging.rb:37:in `tagged'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/tagged_logging.rb:99:in `tagged'
/app/vendor/bundle/ruby/2.7.0/gems/activejob-6.1.2.1/lib/active_job/logging.rb:22:in `tag_logger'
/app/vendor/bundle/ruby/2.7.0/gems/activejob-6.1.2.1/lib/active_job/logging.rb:15:in `block (2 levels) in <module:Logging>'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/callbacks.rb:126:in `instance_exec'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/callbacks.rb:137:in `run_callbacks'
/app/vendor/bundle/ruby/2.7.0/gems/activejob-6.1.2.1/lib/active_job/execution.rb:47:in `perform_now'
/app/vendor/bundle/ruby/2.7.0/gems/activejob-6.1.2.1/lib/active_job/execution.rb:25:in `block in execute'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/callbacks.rb:117:in `block in run_callbacks'
/app/vendor/bundle/ruby/2.7.0/gems/activejob-6.1.2.1/lib/active_job/railtie.rb:47:in `block (4 levels) in <class:Railtie>'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/execution_wrapper.rb:88:in `wrap'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/reloader.rb:72:in `block in wrap'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/execution_wrapper.rb:88:in `wrap'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/reloader.rb:71:in `wrap'
/app/vendor/bundle/ruby/2.7.0/gems/activejob-6.1.2.1/lib/active_job/railtie.rb:46:in `block (3 levels) in <class:Railtie>'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/callbacks.rb:126:in `instance_exec'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/callbacks.rb:137:in `run_callbacks'
/app/vendor/bundle/ruby/2.7.0/gems/activejob-6.1.2.1/lib/active_job/execution.rb:23:in `execute'
/app/vendor/bundle/ruby/2.7.0/gems/activejob-6.1.2.1/lib/active_job/queue_adapters/delayed_job_adapter.rb:42:in `perform'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/backend/base.rb:81:in `block in invoke_job'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/lifecycle.rb:61:in `block in initialize'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/lifecycle.rb:66:in `execute'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/lifecycle.rb:40:in `run_callbacks'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/backend/base.rb:78:in `invoke_job'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/worker.rb:230:in `block (2 levels) in run'
/usr/local/lib/ruby/2.7.0/timeout.rb:95:in `block in timeout'
/usr/local/lib/ruby/2.7.0/timeout.rb:105:in `timeout'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/worker.rb:230:in `block in run'
/usr/local/lib/ruby/2.7.0/benchmark.rb:308:in `realtime'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/worker.rb:229:in `run'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/worker.rb:312:in `block in reserve_and_run_one_job'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/lifecycle.rb:61:in `block in initialize'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/lifecycle.rb:66:in `execute'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/lifecycle.rb:40:in `run_callbacks'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/worker.rb:312:in `reserve_and_run_one_job'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/worker.rb:213:in `block in work_off'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/worker.rb:212:in `times'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/worker.rb:212:in `work_off'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/worker.rb:175:in `block (4 levels) in start'
/usr/local/lib/ruby/2.7.0/benchmark.rb:308:in `realtime'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/worker.rb:174:in `block (3 levels) in start'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/lifecycle.rb:61:in `block in initialize'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/lifecycle.rb:66:in `execute'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/lifecycle.rb:40:in `run_callbacks'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/worker.rb:173:in `block (2 levels) in start'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/worker.rb:172:in `loop'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/worker.rb:172:in `block in start'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/plugins/clear_locks.rb:7:in `block (2 levels) in <class:ClearLocks>'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/lifecycle.rb:79:in `block (2 levels) in add'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/lifecycle.rb:61:in `block in initialize'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/lifecycle.rb:79:in `block in add'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/lifecycle.rb:66:in `execute'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/lifecycle.rb:40:in `run_callbacks'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/worker.rb:171:in `start'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/tasks.rb:9:in `block (2 levels) in <top (required)>'
/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/task.rb:281:in `block in execute'
/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/task.rb:281:in `each'
/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/task.rb:281:in `execute'
/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/task.rb:199:in `synchronize'
/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/task.rb:199:in `invoke_with_call_chain'
/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/task.rb:188:in `invoke'
/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:160:in `invoke_task'
/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:116:in `each'
/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:116:in `block in top_level'
/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:125:in `run_with_threads'
/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:110:in `top_level'
/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:83:in `block in run'
/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:186:in `standard_exception_handling'
/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:80:in `run'
/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.3/exe/rake:27:in `<top (required)>'
/app/vendor/bundle/ruby/2.7.0/bin/rake:23:in `load'
/app/vendor/bundle/ruby/2.7.0/bin/rake:23:in `<top (required)>'
/usr/local/bundle/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:63:in `load'
/usr/local/bundle/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:63:in `kernel_load'
/usr/local/bundle/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:28:in `run'
/usr/local/bundle/gems/bundler-2.1.4/lib/bundler/cli.rb:476:in `exec'
/usr/local/bundle/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/local/bundle/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/usr/local/bundle/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor.rb:399:in `dispatch'
/usr/local/bundle/gems/bundler-2.1.4/lib/bundler/cli.rb:30:in `dispatch'
/usr/local/bundle/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/base.rb:476:in `start'
/usr/local/bundle/gems/bundler-2.1.4/lib/bundler/cli.rb:24:in `start'
/usr/local/bundle/gems/bundler-2.1.4/exe/bundle:46:in `block in <top (required)>'
/usr/local/bundle/gems/bundler-2.1.4/lib/bundler/friendly_errors.rb:123:in `with_friendly_errors'
/usr/local/bundle/gems/bundler-2.1.4/exe/bundle:34:in `<top (required)>'
/usr/local/bundle/bin/bundle:23:in `load'
/usr/local/bundle/bin/bundle:23:in `<main>'
```
### **Steps to reproduce:**
1. Start Docker all in one container with
```bash
docker run --rm --name openproject -d \
-p 127.0.0.1:8080:80 \
-eOPENPROJECT_AUTHENTICATION_GLOBAL__BASIC__AUTH_USER=admin \
-eOPENPROJECT_AUTHENTICATION_GLOBAL__BASIC__AUTH_PASSWORD=admin \
-eOPENPROJECT_AUTH__SOURCE__SSO_HEADER=X-Remote-User \
-eOPENPROJECT_AUTH__SOURCE__SSO_SECRET=s3cr3t \
-eOPENPROJECT_AUTH__SOURCE__SSO_OPTIONAL=true \
openproject/community:11
```
1. Notice, that the System User in the database has ADMIN=false set
2. Notice, that the following yields to \`admin: true\`
```bash
curl --request GET \
--url http://127.0.0.1:8080/api/v3/users/me \
--header 'Authorization: Basic YWRtaW46YWRtaW4='
```
1. Now for example creating users with the REST API for example is no problem, especially creating users with admin flag set is possible
2. Try to delete a project (for example the example project) via api, a 204 (NO Content) states that the operation was sucessfull
```bash
curl --request DELETE \
--url http://127.0.0.1:8080/api/v3/projects/1 \
--header 'Authorization: Basic YWRtaW46YWRtaW4=' \
--header 'Content-Type: application/json'
```
1. The above error message is printed to log. The original error is not printed since there seems to be also a bug in the [error printing procedure](https://github.com/opf/openproject/blob/dev/app/workers/projects/delete_project_job.rb#L62)
### **Actual Behavior**
Project deletion asynchronous job dies with error
### **Expected Behavior**
Project deletion should be succesfull
Your OpenProject Version: Self hosted 11.x with 0 <= x <= 2 Version (Docker all in one container)
Operating System / Browser / OpenProject language: Not a frontend issue, docker container on linux/macOS Host system
### **Logs**
```text
I, [2021-04-25T20:13:13.323898 #139] INFO -- : [ActiveJob] [Projects::DeleteProjectJob] [90657ec3-f01d-44c1-87b8-136939f9151a] Performed Projects::DeleteProjectJob (Job ID: 90657ec3-f01d-44c1-87b8-136939f9151a) from DelayedJob(default) in 31.18ms
[Worker(host:8fd6feff5f5b pid:139)] Job Projects::DeleteProjectJob [90657ec3-f01d-44c1-87b8-136939f9151a] from DelayedJob(default) with arguments: [{"user_id"=>1, "project_id"=>5, "_aj_ruby2_keywords"=>["user_id", "project_id"]}] (id=8) (queue=default) COMPLETED after 0.0409
I, [2021-04-25T20:13:13.332805 #139] INFO -- : 2021-04-25T20:13:13+0000: [Worker(host:8fd6feff5f5b pid:139)] Job Projects::DeleteProjectJob [90657ec3-f01d-44c1-87b8-136939f9151a] from DelayedJob(default) with arguments: [{"user_id"=>1, "project_id"=>5, "_aj_ruby2_keywords"=>["user_id", "project_id"]}] (id=8) (queue=default) COMPLETED after 0.0409
[Worker(host:8fd6feff5f5b pid:139)] 1 jobs processed at 20.6073 j/s, 0 failed
I, [2021-04-25T20:13:13.335336 #139] INFO -- : 2021-04-25T20:13:13+0000: [Worker(host:8fd6feff5f5b pid:139)] 1 jobs processed at 20.6073 j/s, 0 failed
[Worker(host:8fd6feff5f5b pid:139)] Job Projects::DeleteProjectJob [7f07e3d1-30da-49d8-a450-5b3e3011dc2b] from DelayedJob(default) with arguments: [{"user_id"=>1, "project_id"=>6, "_aj_ruby2_keywords"=>["user_id", "project_id"]}] (id=9) (queue=default) RUNNING
I, [2021-04-25T20:13:23.361934 #139] INFO -- : 2021-04-25T20:13:23+0000: [Worker(host:8fd6feff5f5b pid:139)] Job Projects::DeleteProjectJob [7f07e3d1-30da-49d8-a450-5b3e3011dc2b] from DelayedJob(default) with arguments: [{"user_id"=>1, "project_id"=>6, "_aj_ruby2_keywords"=>["user_id", "project_id"]}] (id=9) (queue=default) RUNNING
I, [2021-04-25T20:13:23.362603 #139] INFO -- : [ActiveJob] [Projects::DeleteProjectJob] [7f07e3d1-30da-49d8-a450-5b3e3011dc2b] Performing Projects::DeleteProjectJob (Job ID: 7f07e3d1-30da-49d8-a450-5b3e3011dc2b) from DelayedJob(default) enqueued at 2021-04-25T20:13:18Z
I, [2021-04-25T20:13:23.386552 #139] INFO -- : [ActiveJob] [Projects::DeleteProjectJob] [7f07e3d1-30da-49d8-a450-5b3e3011dc2b] Skipped delivery of mail openproject.project-1-6.20210425201318@example.net as `perform_deliveries` is false
E, [2021-04-25T20:13:23.389334 #139] ERROR -- : [ActiveJob] [Projects::DeleteProjectJob] [7f07e3d1-30da-49d8-a450-5b3e3011dc2b] Encountered an error when trying to delete project '6' : undefined method `join' for #<ActiveModel::Errors:0x000055f2ee46aeb0> /app/app/workers/projects/delete_project_job.rb:66:in `log_service_failure'
/app/app/workers/projects/delete_project_job.rb:46:in `perform'
/app/vendor/bundle/ruby/2.7.0/gems/activejob-6.1.2.1/lib/active_job/execution.rb:48:in `block in perform_now'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/callbacks.rb:117:in `block in run_callbacks'
/app/app/workers/application_job.rb:41:in `block (2 levels) in <class:ApplicationJob>'
/app/app/workers/application_job.rb:78:in `with_clean_request_store'
/app/app/workers/application_job.rb:41:in `block in <class:ApplicationJob>'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/callbacks.rb:126:in `instance_exec'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
/app/vendor/bundle/ruby/2.7.0/gems/i18n-1.8.8/lib/i18n.rb:314:in `with_locale'
/app/vendor/bundle/ruby/2.7.0/gems/activejob-6.1.2.1/lib/active_job/translation.rb:9:in `block (2 levels) in <module:Translation>'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/callbacks.rb:126:in `instance_exec'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/core_ext/time/zones.rb:66:in `use_zone'
/app/vendor/bundle/ruby/2.7.0/gems/activejob-6.1.2.1/lib/active_job/timezones.rb:9:in `block (2 levels) in <module:Timezones>'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/callbacks.rb:126:in `instance_exec'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
/app/vendor/bundle/ruby/2.7.0/gems/activejob-6.1.2.1/lib/active_job/instrumentation.rb:21:in `block in instrument'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/notifications.rb:203:in `block in instrument'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/notifications.rb:203:in `instrument'
/app/vendor/bundle/ruby/2.7.0/gems/activejob-6.1.2.1/lib/active_job/instrumentation.rb:31:in `instrument'
/app/vendor/bundle/ruby/2.7.0/gems/activejob-6.1.2.1/lib/active_job/instrumentation.rb:14:in `block (2 levels) in <module:Instrumentation>'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/callbacks.rb:126:in `instance_exec'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
/app/vendor/bundle/ruby/2.7.0/gems/activejob-6.1.2.1/lib/active_job/logging.rb:22:in `block in tag_logger'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/tagged_logging.rb:99:in `block in tagged'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/tagged_logging.rb:37:in `tagged'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/tagged_logging.rb:99:in `tagged'
/app/vendor/bundle/ruby/2.7.0/gems/activejob-6.1.2.1/lib/active_job/logging.rb:22:in `tag_logger'
/app/vendor/bundle/ruby/2.7.0/gems/activejob-6.1.2.1/lib/active_job/logging.rb:15:in `block (2 levels) in <module:Logging>'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/callbacks.rb:126:in `instance_exec'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/callbacks.rb:137:in `run_callbacks'
/app/vendor/bundle/ruby/2.7.0/gems/activejob-6.1.2.1/lib/active_job/execution.rb:47:in `perform_now'
/app/vendor/bundle/ruby/2.7.0/gems/activejob-6.1.2.1/lib/active_job/execution.rb:25:in `block in execute'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/callbacks.rb:117:in `block in run_callbacks'
/app/vendor/bundle/ruby/2.7.0/gems/activejob-6.1.2.1/lib/active_job/railtie.rb:47:in `block (4 levels) in <class:Railtie>'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/execution_wrapper.rb:88:in `wrap'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/reloader.rb:72:in `block in wrap'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/execution_wrapper.rb:88:in `wrap'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/reloader.rb:71:in `wrap'
/app/vendor/bundle/ruby/2.7.0/gems/activejob-6.1.2.1/lib/active_job/railtie.rb:46:in `block (3 levels) in <class:Railtie>'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/callbacks.rb:126:in `instance_exec'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.2.1/lib/active_support/callbacks.rb:137:in `run_callbacks'
/app/vendor/bundle/ruby/2.7.0/gems/activejob-6.1.2.1/lib/active_job/execution.rb:23:in `execute'
/app/vendor/bundle/ruby/2.7.0/gems/activejob-6.1.2.1/lib/active_job/queue_adapters/delayed_job_adapter.rb:42:in `perform'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/backend/base.rb:81:in `block in invoke_job'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/lifecycle.rb:61:in `block in initialize'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/lifecycle.rb:66:in `execute'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/lifecycle.rb:40:in `run_callbacks'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/backend/base.rb:78:in `invoke_job'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/worker.rb:230:in `block (2 levels) in run'
/usr/local/lib/ruby/2.7.0/timeout.rb:95:in `block in timeout'
/usr/local/lib/ruby/2.7.0/timeout.rb:105:in `timeout'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/worker.rb:230:in `block in run'
/usr/local/lib/ruby/2.7.0/benchmark.rb:308:in `realtime'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/worker.rb:229:in `run'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/worker.rb:312:in `block in reserve_and_run_one_job'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/lifecycle.rb:61:in `block in initialize'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/lifecycle.rb:66:in `execute'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/lifecycle.rb:40:in `run_callbacks'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/worker.rb:312:in `reserve_and_run_one_job'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/worker.rb:213:in `block in work_off'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/worker.rb:212:in `times'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/worker.rb:212:in `work_off'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/worker.rb:175:in `block (4 levels) in start'
/usr/local/lib/ruby/2.7.0/benchmark.rb:308:in `realtime'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/worker.rb:174:in `block (3 levels) in start'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/lifecycle.rb:61:in `block in initialize'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/lifecycle.rb:66:in `execute'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/lifecycle.rb:40:in `run_callbacks'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/worker.rb:173:in `block (2 levels) in start'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/worker.rb:172:in `loop'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/worker.rb:172:in `block in start'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/plugins/clear_locks.rb:7:in `block (2 levels) in <class:ClearLocks>'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/lifecycle.rb:79:in `block (2 levels) in add'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/lifecycle.rb:61:in `block in initialize'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/lifecycle.rb:79:in `block in add'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/lifecycle.rb:66:in `execute'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/lifecycle.rb:40:in `run_callbacks'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/worker.rb:171:in `start'
/app/vendor/bundle/ruby/2.7.0/gems/delayed_job-4.1.9/lib/delayed/tasks.rb:9:in `block (2 levels) in <top (required)>'
/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/task.rb:281:in `block in execute'
/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/task.rb:281:in `each'
/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/task.rb:281:in `execute'
/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/task.rb:199:in `synchronize'
/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/task.rb:199:in `invoke_with_call_chain'
/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/task.rb:188:in `invoke'
/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:160:in `invoke_task'
/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:116:in `each'
/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:116:in `block in top_level'
/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:125:in `run_with_threads'
/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:110:in `top_level'
/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:83:in `block in run'
/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:186:in `standard_exception_handling'
/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:80:in `run'
/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.3/exe/rake:27:in `<top (required)>'
/app/vendor/bundle/ruby/2.7.0/bin/rake:23:in `load'
/app/vendor/bundle/ruby/2.7.0/bin/rake:23:in `<top (required)>'
/usr/local/bundle/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:63:in `load'
/usr/local/bundle/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:63:in `kernel_load'
/usr/local/bundle/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:28:in `run'
/usr/local/bundle/gems/bundler-2.1.4/lib/bundler/cli.rb:476:in `exec'
/usr/local/bundle/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/local/bundle/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/usr/local/bundle/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor.rb:399:in `dispatch'
/usr/local/bundle/gems/bundler-2.1.4/lib/bundler/cli.rb:30:in `dispatch'
/usr/local/bundle/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/base.rb:476:in `start'
/usr/local/bundle/gems/bundler-2.1.4/lib/bundler/cli.rb:24:in `start'
/usr/local/bundle/gems/bundler-2.1.4/exe/bundle:46:in `block in <top (required)>'
/usr/local/bundle/gems/bundler-2.1.4/lib/bundler/friendly_errors.rb:123:in `with_friendly_errors'
/usr/local/bundle/gems/bundler-2.1.4/exe/bundle:34:in `<top (required)>'
/usr/local/bundle/bin/bundle:23:in `load'
/usr/local/bundle/bin/bundle:23:in `<main>'
```
### **Steps to reproduce:**
1. Start Docker all in one container with
```bash
docker run --rm --name openproject -d \
-p 127.0.0.1:8080:80 \
-eOPENPROJECT_AUTHENTICATION_GLOBAL__BASIC__AUTH_USER=admin \
-eOPENPROJECT_AUTHENTICATION_GLOBAL__BASIC__AUTH_PASSWORD=admin \
-eOPENPROJECT_AUTH__SOURCE__SSO_HEADER=X-Remote-User \
-eOPENPROJECT_AUTH__SOURCE__SSO_SECRET=s3cr3t \
-eOPENPROJECT_AUTH__SOURCE__SSO_OPTIONAL=true \
openproject/community:11
```
1. Notice, that the System User in the database has ADMIN=false set
2. Notice, that the following yields to \`admin: true\`
```bash
curl --request GET \
--url http://127.0.0.1:8080/api/v3/users/me \
--header 'Authorization: Basic YWRtaW46YWRtaW4='
```
1. Now for example creating users with the REST API for example is no problem, especially creating users with admin flag set is possible
2. Try to delete a project (for example the example project) via api, a 204 (NO Content) states that the operation was sucessfull
```bash
curl --request DELETE \
--url http://127.0.0.1:8080/api/v3/projects/1 \
--header 'Authorization: Basic YWRtaW46YWRtaW4=' \
--header 'Content-Type: application/json'
```
1. The above error message is printed to log. The original error is not printed since there seems to be also a bug in the [error printing procedure](https://github.com/opf/openproject/blob/dev/app/workers/projects/delete_project_job.rb#L62)
### **Actual Behavior**
Project deletion asynchronous job dies with error
### **Expected Behavior**
Project deletion should be succesfull