# Bug OP-10224 -  undefined method `path' for nil:NilClass when click attanchment

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

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module |  |
| Target versions | 14.4.0 |
| Observed in versions | 12.0.0 |
| Sprint | 14.4.0 |
| Backlog bucket |  |
| Bug found in version (deprecated) | 12.0.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 |  |
| Product manager |  |
| Developers |  |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

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

## Costs

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

## Description

### **Environment**:

openproject 12.0.10

all-in-one container on kubernetes

### **Logs**

Started GET "/api/v3/users/346" for 172.16.81.63 at 2022-04-08 09:40:23 +0800  
I, [2022-04-08T09:40:23.130454 <mention class="mention" data-id="302" data-type="work_package" data-text="#302">#302</mention>]  INFO -- : duration=9.82 db=1.77 view=8.05 status=200 method=GET path=/api/v3/users/346 params={} host=openproject.xxx.com user=346  
I, [2022-04-08T09:40:23.160885 <mention class="mention" data-id="302" data-type="work_package" data-text="#302">#302</mention>]  INFO -- : Started GET "/api/v3/attachments/13420/content" for 172.16.81.63 at 2022-04-08 09:40:23 +0800  
E, [2022-04-08T09:40:23.178842 <mention class="mention" data-id="302" data-type="work_package" data-text="#302">#302</mention>] ERROR -- : user=346 undefined method `path' for nil:NilClass: undefined method `path' for nil:NilClass  
I, [2022-04-08T09:40:23.179466 <mention class="mention" data-id="302" data-type="work_package" data-text="#302">#302</mention>]  INFO -- : duration=15.95 db=2.57 view=13.38 status=500 method=GET path=/api/v3/attachments/13420/content params={} host=openproject.xxx.com user=346

### **Steps to reproduce:**

1.  when I When I restore the database and attachment data to the container, accessing openproject everything works fine, but I get an internal error when clicking the attachmen

### **Actual Behavior**

<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/30606/content"></div></figure>

### **Expected Behavior**

A 404 should be returned instead.
