Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events
SOLVED

Saving graphql queries throws 409 error conflict

Avatar

Level 2

Hi There,

please will someone explain why am getting error when saving queries.

<head><title>409 Conflict</title></head>
<body>
<h1>Conflict</h1>
<p>Cannot serve request to /graphql/persist.json/myfolder/test in org.apache.sling.jcr.webdav.impl.servlets.SimpleWebDavServlet</p>

<h3>Request Progress:</h3>

 

 

Kindest regards,

Anele

1 Accepted Solution

Avatar

Level 2

If you look at the stacktrace, you will understand the root of the issue.
The request is being handled by wrong servlet i.e. webdav servlet rather than the PersistedQueryServlet.

 

This can be fixed by adding "/graphql/" to the property "Execution Paths" of the OSGi config: "Apache Sling Servlet/Script Resolver and Error Handler"

8 Replies

Avatar

Employee Advisor

@AneleMzinyati Please share the AEM version you are using, if it is Cloud or Non Cloud version.

 

Request is trying to save GraphQL persisted query on above location: graphql/persist.json/myfolder/test 
Does this path exist? 
Also, a screen shot would be appreciated.

Avatar

Level 2

 @krati_garg it is Cloud  Version 2022.10.9398.20221020T071514Z

Screenshot 2023-05-17 at 11.28.59.pngScreenshot 2023-05-17 at 11.29.21.pngScreenshot 2023-05-17 at 11.29.38.png

Avatar

Employee Advisor

@AneleMzinyati Which endpoint have you chosen. Is it Global Endpoint or Custom Endpoint.
If you are trying to save persisted query to Custom Endpoint, you might have to add access permissions to your custom endpoint defined at /content/cq:graphql/<<custom endpoint>>

Also, it can be possible that a persisted query with "my-query" name already exist. You might have to click on + button for creating another persisted query

Avatar

Level 2

Actually even the Global Endpoint is throwing the 409 error

Avatar

Level 2

If you look at the stacktrace, you will understand the root of the issue.
The request is being handled by wrong servlet i.e. webdav servlet rather than the PersistedQueryServlet.

 

This can be fixed by adding "/graphql/" to the property "Execution Paths" of the OSGi config: "Apache Sling Servlet/Script Resolver and Error Handler"

Avatar

Community Advisor

@AneleMzinyati it looks like there is a node with the same name, try giving a different name while saving queries. Sometimes it might persist in some past information, try clearing the cache and re-login too.