1

In a Java adapter when we create a new tag using Push Tag (POST) we always get a "The target resource 'PushTag' already exists" 409 response and an error in the log even though the new tag is successfully created

Is this a known issue? Is there a work-around?

In the logs the sequence is like this;

    [INFO   ] 2017-10-16-07:51:48.318 [1363] PostRequest.call http://localhost:9080/imfpush/v1/apps/com.ibm.mfpstartercordova/tags/TAG2203137
    GET
    Authorization: Bearer eyJhbGci...
    [ERROR   ] FPWSE0010E: Internal server error. FPWSE0001E: Not Found - The target resource 'PushTag' does not exist. Check the 'TAG2203137' parameter.
    [ERROR   ] FPWSE0010E: Internal server error. FPWSE0001E: Not Found - The target resource 'PushTag' does not exist. Check the 'TAG2203137' parameter.
    http://localhost:9080/imfpush/v1/apps/com.ibm.mfpstartercordova/tags/TAG2203137
    GET
    404
    {OkHttp-Sent-Millis=1508158308325, Date=Mon, 16 Oct 2017 12:51:48 GMT, Content-Length=125, OkHttp-Received-Millis=1508158308332, Connection=Close, Content-Type=application/json, X-Powered-By=Servlet/3.1}
    {"message":"Not Found - The target resource 'PushTag' does not exist. Check the 'TAG2203137' parameter.","code":"FPWSE0001E"}
    [INFO   ] 2017-10-16-07:51:48.333 [1363] PostRequest.call http://localhost:9080/imfpush/v1/apps/com.ibm.mfpstartercordova/tags
    POST
    Authorization: Bearer eyJhbGci...
    Content-Type: application/json
    {"description":"TAG2203137","name":"TAG2203137"}
    [err] com.ibm.mfp.push.server.exceptions.PushWorksEntityExistsException: FPWSE0002E: Conflict - The target resource 'PushTag' already exists. Check the 'TAG2203137' parameter.
    [err]   at com.ibm.mfp.push.server.rest.resources.TagResource.createTag(TagResource.java:283)
    [err]   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [err]   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    [err]   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    [err]   at java.lang.reflect.Method.invoke(Method.java:606)
    [err]   at org.apache.wink.server.internal.handlers.InvokeMethodHandler.handleRequest(InvokeMethodHandler.java:63)
    [err]   at org.apache.wink.server.handlers.AbstractHandler.handleRequest(AbstractHandler.java:33)
    [err]   at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
    [err]   at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
    [err]   at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:67)
    etc, etc
    [err]   at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1287)
    [err]   at [internal classes]
    [err]   at com.ibm.mfp.push.server.rest.SecurityFilter.doFilter(SecurityFilter.java:93)
    [err]   at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:207)
    [err]   at [internal classes]
    [err]   at com.ibm.mfp.push.server.rest.filter.RequestDetailLogger.doFilter(RequestDetailLogger.java:94)
    [err]   at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:207)
    [err]   at [internal classes]
    [err]   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    [err]   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    [err]   at java.lang.Thread.run(Thread.java:745)
    [ERROR   ] FPWSE0010E: Internal server error. FPWSE0002E: Conflict - The target resource 'PushTag' already exists. Check the 'TAG2203137' parameter.
    http://localhost:9080/imfpush/v1/apps/com.ibm.mfpstartercordova/tags
    POST
    409
    {OkHttp-Sent-Millis=1508158308345, Date=Mon, 16 Oct 2017 12:51:48 GMT, Content-Length=124, OkHttp-Received-Millis=1508158308372, Connection=Close, Content-Type=application/json, X-Powered-By=Servlet/3.1}
    {"message":"Conflict - The target resource 'PushTag' already exists. Check the 'TAG2203137' parameter.","code":"FPWSE0002E"}
    [err] java.io.IOException: Could not create http://localhost:9080/imfpush/v1/apps/com.ibm.mfpstartercordova/tags
    [err]   at com.onemain.mfp.push.PushMessage$oauthInstance.pushToTag(PushMessage.java:153)
    [err]   at com.onemain.mfp.push.pushAdapterApplication.handleMessage(pushAdapterApplication.java:99)
    [err]   at com.onemain.mfp.push.pushAdapterApplication.waitForMessage(pushAdapterApplication.java:127)
    [err]   at com.onemain.mfp.push.pushAdapterApplication.pollLocalMQ(pushAdapterApplication.java:158)
    [err]   at com.onemain.mfp.push.pushAdapterApplication.access$200(pushAdapterApplication.java:48)
    [err]   at com.onemain.mfp.push.pushAdapterApplication$1.run(pushAdapterApplication.java:255)
  • 1
    Is the create Tag being called only once? Could you confirm the call is made only once? If or not, you could verify if the tag exists already before issuing a create tag. – Srinivasan Nanduri Oct 16 '17 at 15:39
  • Yes, the create call is made only once. First we verify if the tag exists or not, using GET call to /imfpush/v1/apps/myApp/tags/theTag Only if that returns a 404 (as shown in the log snippet) do we make the POST call to create tag – Michael Thompson Oct 16 '17 at 15:56
  • You mentioned Java adapter. Are you really calling the REST endpoint from within the Java adapter? 409 refers to concurrency failures - hence the query – Vivin K Oct 16 '17 at 18:09
  • Yes, we are really calling the REST endpoint from within the Java adapter. The adapter has to get messages to be sent from a queue. If the message is for a tag that hasn't already been created, then the adapter creates it. – Michael Thompson Oct 16 '17 at 21:03

0 Answers0