# Bug OP-15761 - Application error when viewing activity page of an inactive user

Project: OpenProject
Status: closed
URL: https://community.openproject.org/work_packages/OP-15761

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module |  |
| Target versions | 14.6.0 |
| Observed in versions | 14.4.0 |
| Sprint | 14.6.0 |
| Backlog bucket |  |
| Bug found in version (deprecated) | 14.4.x |
| Found in mobile app version |  |
| Follow-up feedback e-mail |  |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable | Pavel Balashou |
| Product manager |  |
| Developers |  |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Votes |  |
| Work |  |
| Labor costs |  |

## Description

<https://appsignal.com/openproject-gmbh/sites/66b224a4d30d867bed8a1772/exceptions/incidents/461>

# AppSignal incidents:

<https://appsignal.com/openproject-gmbh/sites/66b224a4d30d867bed8a1772/exceptions/incidents/461>

## [Sample 1](https://appsignal.com/openproject-gmbh/sites/66b224a4d30d867bed8a1772/exceptions/incidents/461/samples/66b224a4d30d867bed8a1772-884796401650667813417254311001)

**Message**

```` text
Couldn't find User with 'id'=70948 [WHERE "users"."type" IN ($1, $2, $3, $4) AND "users"."type" NOT IN ($5, $6, $7) AND "users"."status" = $8]```

**Backtrace (last 10 lines)**

```text
app/controllers/activities_controller.rb:109 determine_author	
vendor/plugins/openproject-multitenancy/lib/multitenancy/elevators/mapped_domain_elevator.rb:106 block in call_tenant	
vendor/plugins/openproject-multitenancy/lib/multitenancy/elevators/mapped_domain_elevator.rb:103 call_tenant	
vendor/plugins/openproject-multitenancy/lib/multitenancy/elevators/mapped_domain_elevator.rb:69 try_tenant	
vendor/plugins/openproject-multitenancy/lib/multitenancy/elevators/mapped_domain_elevator.rb:39 call	
````

### Reproduction:

Call `https://openproject.local/projects/dev-large/activity?user_id=777` with inactive or not existent user's id in place of `777`.

To reproduce it from the app, go to an activity thread, click a user name to see their profile, then click on the "Activity" at the top of the page.

<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/197659/content">

It displays the activity of this user.

Now if that user is locked or inactive by any other mean, it will trigger the error seen above.
