See the logs.
The query is EXACTLY the same but it fails the second time.
Can anyone explain why?
How do I get this fixed?
09/10/2020 04:41:56 AM Coordinated Universal Time ******STARTING******
09/10/2020 04:41:56 AM Coordinated Universal Time check time is (workaround - conf rest api will -1 hour)2020/09/10 05:41
09/10/2020 04:41:56 AM Coordinated Universal Time New Page Check query is: type=page and space in ('SIS') and created >= "2020/09/10 05:41"
09/10/2020 04:41:57 AM Coordinated Universal Time Modified Page Check query is: type=page and space in ('SIS') and lastmodified >= "2020/09/10 05:41" and created<"2020/09/10 05:41"
09/10/2020 04:41:57 AM Coordinated Universal Time Processing pages created after check time
09/10/2020 04:41:57 AM Coordinated Universal Time Processing pages created before check time but modified since
09/10/2020 04:41:57 AM Coordinated Universal Time []
09/10/2020 04:41:57 AM Coordinated Universal Time parse_confluence took 0.437488317489624 seconds to execute
09/10/2020 04:42:12 AM Coordinated Universal Time ******STARTING******
09/10/2020 04:42:12 AM Coordinated Universal Time check time is (workaround - conf rest api will -1 hour)2020/09/10 05:41
09/10/2020 04:42:12 AM Coordinated Universal Time New Page Check query is: type=page and space in ('SIS') and created >= "2020/09/10 05:41"
09/10/2020 04:42:12 AM Coordinated Universal Time Confluence Server Error
09/10/2020 04:42:12 AM Coordinated Universal Time message
Traceback (most recent call last):
File "C:\Python\Python38\lib\site-packages\atlassian\confluence.py", line 1589, in cql
response = self.get('rest/api/search', params=params)
File "C:\Python\Python38\lib\site-packages\atlassian\rest_client.py", line 176, in get
response = self.request('GET', path=path, flags=flags, params=params, data=data, headers=headers,
File "C:\Python\Python38\lib\site-packages\atlassian\rest_client.py", line 161, in request
response.raise_for_status()
File "C:\Python\Python38\lib\site-packages\requests\models.py", line 941, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://srb-integration-showcase.atlassian.net/wiki/rest/api/search?start=0&limit=1000&cql=type%3Dpage+and+space+in+%28%27SIS%27%29+and+created+%3E%3D+%222020%2F09%2F10+05%3A41%22
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Code\Integrations\int\scripts\integrations\parse_confluence.py", line 62, in parse_confluence
new_pages=confluence.cql(cql_created_after_check, start=0, limit=1000)
File "C:\Python\Python38\lib\site-packages\atlassian\confluence.py", line 1592, in cql
raise ApiValueError("The query cannot be parsed", reason=e)
atlassian.errors.ApiValueError: The query cannot be parsed
Hi @Anurag Gulati ,
Please refer this : https://community.atlassian.com/t5/Confluence-questions/Search-content-API-fails-with-CQL-error-for-cql-lastModified-gt/qaq-p/1552066#U1553018
Hope this helps !
Hello @Anurag Gulati ,
Welcome to the Atlassian Community!
If I understand correctly you are calling twice (or more times) the same REST API endpoint with the same parameters in your code and while everything works fine the first time, at the successive attempt you get answer 400 (bad request) with error message "The query cannot be parsed". Is this correct?
If this is correct, can you kindly let us know:
curl -D- -u <EMAIL>:<API_TOKEN> -X GET 'https://srb-integration-showcase.atlassian.net/wiki/rest/api/search?start=0&limit=1000&cql=type%3Dpage+and+space+in+%28%27SIS%27%29+and+created+%3E%3D+%222020%2F09%2F10+05%3A41%22'
Cheers,
Dario
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.