Content
View differences
Updated by Oliver Günther almost 2 years ago
### Before filing a report
_Before you file a report, please ensure you are running the latest version of OpenProject and_
_have searched for similar bug reports._
### Steps to reproduce
_Please write down the steps to reproduce. Try to write down all necessary preconditions (what permissions do you have, are other users involved?). Example:_
1. Create notification for work package X in project A
2. Move work package X to project B
3. destroy project A
4. Go to notifications
5. You get an internal error as the notification#project\_id is still pointing to project A
### Workaround
Re-assign the notifications to the correct project:
**Packaged installation**
`openproject run bundle exec rails runner "Notification.where.not(project_id: Project.select(:id)).each { |notification| notification.update_column(:project_id, notification.resource.project_id) }"`
**Docker installation**
`docker exec -it <container ID> bundle exec rails console`
`Notification.where.not(project_id: Project.select(:id)).each { |notification| notification.update_column(:project_id, notification.resource.project_id) }`
###
https://appsignal.com/openproject-gmbh/sites/632371afd2a5e463ef717ecb/exceptions/incidents/6263/samples/632371afd2a5e463ef717ecb-501342606796993921117241490202
_Before you file a report, please ensure you are running the latest version of OpenProject and_
_have searched for similar bug reports._
### Steps to reproduce
_Please write down the steps to reproduce. Try to write down all necessary preconditions (what permissions do you have, are other users involved?). Example:_
1. Create notification for work package X in project A
2. Move work package X to project B
3. destroy project A
4. Go to notifications
5. You get an internal error as the notification#project\_id is still pointing to project A
### Workaround
Re-assign the notifications to the correct project:
**Packaged installation**
`openproject run bundle exec rails runner "Notification.where.not(project_id: Project.select(:id)).each { |notification| notification.update_column(:project_id, notification.resource.project_id) }"`
**Docker installation**
`docker exec -it <container ID> bundle exec rails console`
`Notification.where.not(project_id: Project.select(:id)).each { |notification| notification.update_column(:project_id, notification.resource.project_id) }`
https://appsignal.com/openproject-gmbh/sites/632371afd2a5e463ef717ecb/exceptions/incidents/6263/samples/632371afd2a5e463ef717ecb-501342606796993921117241490202