Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1597096 - invalid REST requests return 200
Summary: invalid REST requests return 200
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Bugzilla
Classification: Community
Component: Bugzilla General
Version: 5.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified vote
Target Milestone: 5.0
Assignee: Jeff Fearn ๐Ÿž
QA Contact: tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-07-02 03:55 UTC by Hongwei Liu
Modified: 2019-04-05 00:00 UTC (History)
4 users (show)

Fixed In Version: 5.0.4-rh6
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-07-26 01:02:33 UTC


Attachments (Terms of Use)

Description Hongwei Liu 2018-07-02 03:55:26 UTC
Description of problem:
Meet error 'Null manifest retrieved' when adding https://bugzilla5.redhat.com to application link of JIRA-BZ sync plugin on JIRA Dev instance

Version-Release number of selected component (if applicable):
BZ5 https://bugzilla5.redhat.com
JIR Dev: https://projects.devel.engineering.redhat.com

How reproducible:
always

Steps to Reproduce:
1. Go to JIRA Dev Application Links configuration page https://projects.devel.engineering.redhat.com/plugins/servlet/applinks/listApplicationLinks

2. Add 'https://bugzilla5.redhat.com' to the text input box and click 'Create new link'

Actual Result: The page is always trying to create new application but always loading. Below error is reported in /srv/jira/app/logs/catalina.out on JIRA Dev instance

'2018-07-02 01:01:20,452 http-nio-8080-exec-101 ERROR hongliu 61x429304x3 1c0njy6 10.72.12.40,127.0.0.1 /rest/applinks/3.0/applicationlinkForm/manifest.json [c.a.a.c.rest.ui.CreateApplicationLinkUIResource] Null manifest retrieved'

 

Expected Result: The page should direct to next page.

 

Addition infor: I can add Partner BZ5 https://partner-bugzilla5.redhat.comto application link and will use it to do sync plugin test, but I think it is better we debug why we can't add https://bugzilla5.redhat.com and why we have manifest error. Thanks.

Comment 1 Jeff Fearn ๐Ÿž 2018-07-03 01:09:07 UTC
Please include the actual response you got from the RPC call to Bugzilla.

Comment 2 Hongwei Liu 2018-07-03 02:10:39 UTC
(In reply to Jeff Fearn from comment #1)
> Please include the actual response you got from the RPC call to Bugzilla.

The whole log in catalina.out after I click 'Create new link', does it make sense? Thanks.

2018-07-03 02:08:02,460 http-nio-8080-exec-43 ERROR hongliu 128x468259x2 160o08j 10.66.136.12,127.0.0.1 /rest/applinks/3.0/applicationlinkForm/manifest.json [c.a.a.c.rest.ui.CreateApplicationLinkUIResource] ManifestNotFoundException thrown while retrieving manifest
com.atlassian.applinks.spi.manifest.ManifestNotFoundException: com.atlassian.applinks.internal.common.net.ResponseContentException
	at com.atlassian.applinks.core.manifest.AppLinksManifestDownloader.doDownload(AppLinksManifestDownloader.java:198)
	at com.atlassian.applinks.core.manifest.AppLinksManifestDownloader.access$000(AppLinksManifestDownloader.java:50)
	at com.atlassian.applinks.core.manifest.AppLinksManifestDownloader$1$1.<init>(AppLinksManifestDownloader.java:127)
	at com.atlassian.applinks.core.manifest.AppLinksManifestDownloader$1.load(AppLinksManifestDownloader.java:121)
	at com.atlassian.applinks.core.manifest.AppLinksManifestDownloader$1.load(AppLinksManifestDownloader.java:118)
	at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3527)
	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2319)
	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2282)
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2197)
	at com.google.common.cache.LocalCache.get(LocalCache.java:3937)
	at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3941)
	at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4824)
	at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4830)
	at com.atlassian.applinks.core.manifest.AppLinksManifestDownloader.downloadInternal(AppLinksManifestDownloader.java:106)
	at com.atlassian.applinks.core.manifest.AppLinksManifestDownloader.download(AppLinksManifestDownloader.java:84)
	at com.atlassian.applinks.core.manifest.ManifestRetrieverDispatcher.getManifest(ManifestRetrieverDispatcher.java:43)
	at com.atlassian.applinks.core.rest.ui.CreateApplicationLinkUIResource.tryToFetchManifest(CreateApplicationLinkUIResource.java:140)
	... 2 filtered
	at java.lang.reflect.Method.invoke(Method.java:497)
	... 3 filtered
	at com.atlassian.applinks.internal.rest.interceptor.NoCacheHeaderInterceptor.intercept(NoCacheHeaderInterceptor.java:13)
	... 1 filtered
	at com.atlassian.applinks.core.rest.auth.AdminApplicationLinksInterceptor.intercept(AdminApplicationLinksInterceptor.java:35)
	... 1 filtered
	at com.atlassian.applinks.core.rest.context.ContextInterceptor.intercept(ContextInterceptor.java:16)
	... 15 filtered
	at com.atlassian.plugins.rest.module.RestDelegatingServletFilter$JerseyOsgiServletContainer.doFilter(RestDelegatingServletFilter.java:154)
	... 1 filtered
	at com.atlassian.plugins.rest.module.RestDelegatingServletFilter.doFilter(RestDelegatingServletFilter.java:68)
	... 36 filtered
	at com.atlassian.applinks.cors.rest.CorsFilter.doFilter(CorsFilter.java:99)
	... 3 filtered
	at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21)
	... 49 filtered
	at com.atlassian.jira.security.JiraSecurityFilter.lambda$doFilter$0(JiraSecurityFilter.java:80)
	... 1 filtered
	at com.atlassian.jira.security.JiraSecurityFilter.doFilter(JiraSecurityFilter.java:78)
	... 16 filtered
	at com.atlassian.plugins.rest.module.servlet.RestSeraphFilter.doFilter(RestSeraphFilter.java:37)
	... 20 filtered
	at com.atlassian.jira.servermetrics.CorrelationIdPopulatorFilter.doFilter(CorrelationIdPopulatorFilter.java:30)
	... 10 filtered
	at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21)
	... 4 filtered
	at com.atlassian.web.servlet.plugin.LocationCleanerFilter.doFilter(LocationCleanerFilter.java:36)
	... 29 filtered
	at com.atlassian.jira.servermetrics.MetricsCollectorFilter.doFilter(MetricsCollectorFilter.java:25)
	... 28 filtered
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)
Caused by: com.atlassian.applinks.internal.common.net.ResponseContentException
	at com.atlassian.applinks.core.manifest.AppLinksManifestDownloader$2.handle(AppLinksManifestDownloader.java:181)
	at com.atlassian.plugins.rest.module.jersey.JerseyRequest$1.handle(JerseyRequest.java:115)
	at com.atlassian.plugins.rest.module.jersey.JerseyRequest$1.handle(JerseyRequest.java:113)
	at com.atlassian.plugins.rest.module.jersey.JerseyRequest$2.handle(JerseyRequest.java:134)
	at com.atlassian.sal.core.net.HttpClientRequest.executeAndReturn(HttpClientRequest.java:104)
	at com.atlassian.plugins.rest.module.jersey.JerseyRequest.execute(JerseyRequest.java:113)
	at com.atlassian.applinks.core.manifest.AppLinksManifestDownloader.doDownload(AppLinksManifestDownloader.java:165)
	... 254 more
Caused by: com.atlassian.plugins.rest.module.jersey.EntityConversionException: org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field "documentation" (Class com.atlassian.applinks.core.rest.model.ManifestEntity), not marked as ignorable
 at [Source: java.io.ByteArrayInputStream@29187755; line: 1, column: 19] (through reference chain: com.atlassian.applinks.core.rest.model.ManifestEntity["documentation"])
	at com.atlassian.plugins.rest.module.jersey.JerseyResponse.getEntity(JerseyResponse.java:43)
	at com.atlassian.applinks.core.manifest.AppLinksManifestDownloader$2.handle(AppLinksManifestDownloader.java:179)
	... 261 more
Caused by: org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field "documentation" (Class com.atlassian.applinks.core.rest.model.ManifestEntity), not marked as ignorable
	at org.codehaus.jackson.map.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:53)
	at org.codehaus.jackson.map.deser.StdDeserializationContext.unknownFieldException(StdDeserializationContext.java:267)
	at org.codehaus.jackson.map.deser.std.StdDeserializer.reportUnknownProperty(StdDeserializer.java:673)
	at org.codehaus.jackson.map.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:659)
	at org.codehaus.jackson.map.deser.BeanDeserializer.handleUnknownProperty(BeanDeserializer.java:1365)
	at org.codehaus.jackson.map.deser.BeanDeserializer._handleUnknown(BeanDeserializer.java:725)
	at org.codehaus.jackson.map.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:703)
	at org.codehaus.jackson.map.deser.BeanDeserializer.deserialize(BeanDeserializer.java:580)
	at org.codehaus.jackson.map.ObjectMapper._readValue(ObjectMapper.java:2704)
	at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1315)
	at org.codehaus.jackson.jaxrs.JacksonJsonProvider.readFrom(JacksonJsonProvider.java:419)
	at com.atlassian.plugins.rest.module.jersey.JerseyEntityHandler.unmarshall(JerseyEntityHandler.java:203)
	at com.atlassian.plugins.rest.module.jersey.JerseyResponse.getEntity(JerseyResponse.java:41)
	... 262 more
2018-07-03 02:08:02,467 http-nio-8080-exec-43 ERROR hongliu 128x468259x2 160o08j 10.66.136.12,127.0.0.1 /rest/applinks/3.0/applicationlinkForm/manifest.json [c.a.a.c.rest.ui.CreateApplicationLinkUIResource] Null manifest retrieved

Comment 3 Jeff Fearn ๐Ÿž 2018-07-03 03:06:54 UTC
(In reply to Hongwei Liu from comment #2)
> (In reply to Jeff Fearn from comment #1)
> > Please include the actual response you got from the RPC call to Bugzilla.
> 
> The whole log in catalina.out after I click 'Create new link', does it make
> sense? Thanks.

I can't see anything in there indicating this is a Bugzilla issue.

Comment 4 yuli wang 2018-07-04 06:55:28 UTC
Added comments from Jira Dev comments in https://projects.engineering.redhat.com/browse/JIRA-2944:

 I check the errors and reproduce it in local, it reports something like:
Caused by: org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field "documentation" (Class com.atlassian.applinks.core.rest.model.ManifestEntity), not marked as ignorable

I'm not sure whether it is caused by some unnecessary json field not annotated as '@JsonIgnoreProperties' in code from Bugzilla 5 when sending data back. (That will be appreciated if BZ devel team could have a look on the 'documentation' data)
If we consider to fix in JIRA side, I still don't find a workround for that, still need time to investigate on that.

Comment 5 Jeff Fearn ๐Ÿž 2018-07-04 07:26:56 UTC
I can't look up RPC calls unless someone tells us what it actually is.

Comment 6 Rony Gong ๐Ÿ”ฅ 2018-07-05 03:10:38 UTC
I got the same error and the same log of comment 2, and I google search this failed cause, maybe this link could help you to find the root cause.

https://confluence.atlassian.com/kb/application-link-not-working-due-to-manifestnotfoundexception-393904879.html

Comment 7 Jeff Fearn ๐Ÿž 2018-07-05 03:28:37 UTC
(In reply to Rony Gong from comment #6)
> I got the same error and the same log of comment 2, and I google search this
> failed cause, maybe this link could help you to find the root cause.

It doesn't appear to be related to Bugzilla, someone who can triage Jira issues will need to look in to it.

> https://confluence.atlassian.com/kb/application-link-not-working-due-to-
> manifestnotfoundexception-393904879.html

"applicationlinkForm" is step 1, which appears to be internal to Jira.

Comment 8 yma 2018-07-05 09:24:01 UTC
(In reply to Jeff Fearn from comment #7)
> (In reply to Rony Gong from comment #6)
> > I got the same error and the same log of comment 2, and I google search this
> > failed cause, maybe this link could help you to find the root cause.
> 
> It doesn't appear to be related to Bugzilla, someone who can triage Jira
> issues will need to look in to it.
> 
> > https://confluence.atlassian.com/kb/application-link-not-working-due-to-
> > manifestnotfoundexception-393904879.html
> 
> "applicationlinkForm" is step 1, which appears to be internal to Jira.

Thanks for your findings, Rony.

Jeff, as this doc, atlassian should access bz links below in STEP 2 when retrieving the mainfest:

https://bugzilla5.redhat.com/rest/applinks/3.0/manifest.json
https://partner-bugzilla5.redhat.com/rest/applinks/3.0/manifest.json

I found it return 304 in browse window, or return 404 using curl but with the json: {"documentation":"https://partner-bugzilla5.redhat.com/docs/en/html/api/index.html","error":true,"code":32614,"message":"A REST API resource was not found for 'GET /applinks/3.0/manifest.json'."}

But for current Bugzilla:
https://bugzilla.redhat.com/rest/applinks/3.0/manifest.json

It returns 404 with no additional response json body.

Atlassian should switch different branches of ways for the target applicationโ€™s different return.
So that's reason why it reports:
org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field "documentation" (Class com.atlassian.applinks.core.rest.model.ManifestEntity), not marked as ignorable
around the ManifestNotFoundException.

Could we keep this as the regular 404 return for empty pages and check the json return for that?

Comment 9 Jeff Fearn ๐Ÿž 2018-07-05 23:22:05 UTC
(In reply to yma from comment #8)
> (In reply to Jeff Fearn from comment #7)
> > (In reply to Rony Gong from comment #6)
> > > I got the same error and the same log of comment 2, and I google search this
> > > failed cause, maybe this link could help you to find the root cause.
> > 
> > It doesn't appear to be related to Bugzilla, someone who can triage Jira
> > issues will need to look in to it.
> > 
> > > https://confluence.atlassian.com/kb/application-link-not-working-due-to-
> > > manifestnotfoundexception-393904879.html
> > 
> > "applicationlinkForm" is step 1, which appears to be internal to Jira.
> 
> Thanks for your findings, Rony.
> 
> Jeff, as this doc, atlassian should access bz links below in STEP 2 when
> retrieving the mainfest:
> 
> https://bugzilla5.redhat.com/rest/applinks/3.0/manifest.json
> https://partner-bugzilla5.redhat.com/rest/applinks/3.0/manifest.json
> 
> I found it return 304 in browse window, or return 404 using curl but with
> the json:
> {"documentation":"https://partner-bugzilla5.redhat.com/docs/en/html/api/
> index.html","error":true,"code":32614,"message":"A REST API resource was not
> found for 'GET /applinks/3.0/manifest.json'."}
> 
> But for current Bugzilla:
> https://bugzilla.redhat.com/rest/applinks/3.0/manifest.json
> 
> It returns 404 with no additional response json body.

Bugzilla 4 does not have a rest interface, Bugzilla 5 does, so it's not surprising something has changed in how invalid requests are handled.

> Atlassian should switch different branches of ways for the target
> applicationโ€™s different return.
> So that's reason why it reports:
> org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized
> field "documentation" (Class
> com.atlassian.applinks.core.rest.model.ManifestEntity), not marked as
> ignorable
> around the ManifestNotFoundException.
> 
> Could we keep this as the regular 404 return for empty pages and check the
> json return for that?

I'll ask upstream if the currently approach is how handling invalid requests should be handled in REST.

Comment 10 Jeff Fearn ๐Ÿž 2018-07-06 00:44:32 UTC
There was a change to mod_perl introduced to allow the REST interface to return a custom json payload, I'm going to revert that for our use.

Comment 11 Rony Gong ๐Ÿ”ฅ 2018-07-10 06:45:41 UTC
Tested on QA environment
Result: Pass
It can be added https://projects.devel.engineering.redhat.com/plugins/servlet/applinks/listApplicationLinks

Comment 12 Jeff Fearn ๐Ÿž 2018-07-26 01:02:33 UTC
This issue has been resolved and is available for testing on https://beta-bugzilla.redhat.com it will be available in production after the Bugzilla 5 migration.

If you find an issue when testing on Beta Bugzilla please open a new bug.


Note You need to log in before you can comment on or make changes to this bug.