Users Are Unable to Upload Attachements to Issues

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

When trying to upload attachments to any issue in Jira, the upload fails and users see a "attachment failed" message in the upper-right corner of the screen.

(Auto-migrated image: description temporarily unavailable)

Environment

9.4.0

.

Diagnosis

In the atlassian-jira.log file, you will see an error message like this one below.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 https-openssl-nio-443-exec-11 ERROR /rest/internal/2/AttachTemporaryFile [c.a.p.r.c.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: null java.lang.NullPointerException     at com.atlassian.applinks.cors.auth.DefaultCorsService.matchesOrigin(DefaultCorsService.java:92)     at com.atlassian.applinks.cors.auth.DefaultCorsService.getApplicationLinksByUri(DefaultCorsService.java:68)     at com.atlassian.applinks.cors.auth.DefaultCorsService.getApplicationLinksByOrigin(DefaultCorsService.java:62)     at com.atlassian.applinks.cors.auth.AppLinksCorsDefaults.allowsOrigin(AppLinksCorsDefaults.java:36)     at com.atlassian.plugins.rest.common.security.jersey.CorsResourceFilter.lambda$allowsOrigin$1(CorsResourceFilter.java:235)     at java.base/java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)     at com.google.common.collect.CollectSpliterators$1.lambda$forEachRemaining$1(CollectSpliterators.java:127)     at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Unknown Source)     at com.google.common.collect.CollectSpliterators$1.forEachRemaining(CollectSpliterators.java:127)     at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)     at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)     at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)

ℹ️ The same error will appear in a HAR file in your browser

Cause

This error indicates that there is a CORS related error caused by broken applinks in your Jira environment. Further investigation will reveal that you encounter additional errors while navigating to Settings > Application > Application Links in Jira.

Solution

To fix this, you will need to perform a database query to determine the appropriate applink identifiers, then delete the applink using Jira's API

⚠️ The queries below may not run on your database due to syntax, formatting, or something else. Please consult with your DBA to ensure that the same data, from the same tables, can be queried on your Jira Environment.

Query 1:

This query pulls the RPC URLs for the AppLinks that are currently configured in Jira. You will need the ID value for your API call and can use the subsequent columns as a reference

1 2 3 4 5 6 7 8 9 10 11 12 SELECT propertyentry.id, property_key , propertyvalue FROM propertystring INNER JOIN propertyentry ON propertyentry.id = propertystring.id WHERE property_key LIKE 'applinks%rpc.url';

Query 2:

This query lists out similar applinks on your Jira environment but the property_key is formatted differently than the other query. You will need the ID value for your API call and can use the subsequent columns as a reference

1 2 3 4 SELECT a.id,substring(a.property_key,16,36), b.propertyvalue FROM propertyentry a join propertystring b on a.id=b.id where a.property_key like 'applinks%name';

API Call

ℹ️ Please ensure that you are using a Personal Access Token when making API calls to Jira. See: Personal Access Tokens in Jira for additional steps to generate a token.

For each ID returned, you will need to delete the associated applink from Jira using the applink API endpoint. You may refer to the example below for reference:

1 curl -X DELETE -H "Authorization: Bearer $token" -H "Accept: application/json" https://$jira_url/rest/applinks/1.0/applicationlink/$appLinkId;
Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.