Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: confluence anonymous access is failing after few requests #146

Conversation

baruchiro
Copy link
Contributor

@baruchiro baruchiro commented Jul 24, 2023

Fixes #144

The error is not always reproduced, and when it is, it is reproduced for a different page every time.

Since the error is 500, means that it is a server (Confluence) error, I can't fix it and I must work around it.

I added a retry mechanism and I enabled it only for our request, when it returns 500, it will retry it 3 times.

It looks like this:

11:38:19 WRN confluence credentials were not provided. The scan will be made anonymously only for the public pages
11:38:20 INF  Total of all 4 Spaces detected
11:38:20 INF  Space - secrets have 3 pages
11:38:20 INF  Space - Secrets have 1 pages
11:38:20 INF  Space - Checkmarx Resources have 3 pages
11:38:29 INF  Space - Checkmarx Knowledge Center have 1231 pages
11:38:37 WRN retrying http request https://checkmarx.atlassian.net/wiki/rest/api/content/1375995197?expand=body.storage,version,history.previousVersion
11:38:37 WRN retrying http request https://checkmarx.atlassian.net/wiki/rest/api/content/1312260170?expand=body.storage,version,history.previousVersion
11:38:38 WRN retrying http request https://checkmarx.atlassian.net/wiki/rest/api/content/1188135832?expand=body.storage,version,history.previousVersion
11:38:38 WRN retrying http request https://checkmarx.atlassian.net/wiki/rest/api/content/2093908162?expand=body.storage,version,history.previousVersion
11:38:38 WRN retrying http request https://checkmarx.atlassian.net/wiki/rest/api/content/1829044450?expand=body.storage,version,history.previousVersion
11:38:38 WRN retrying http request https://checkmarx.atlassian.net/wiki/rest/api/content/1534427435?expand=body.storage,version,history.previousVersion
11:38:38 WRN retrying http request https://checkmarx.atlassian.net/wiki/rest/api/content/1383432225?expand=body.storage,version,history.previousVersion
11:38:38 WRN retrying http request https://checkmarx.atlassian.net/wiki/rest/api/content/1191609716?expand=body.storage,version,history.previousVersion
11:38:38 WRN retrying http request https://checkmarx.atlassian.net/wiki/rest/api/content/1636598107?expand=body.storage,version,history.previousVersion
11:38:38 WRN retrying http request https://checkmarx.atlassian.net/wiki/rest/api/content/2031092718?expand=body.storage,version,history.previousVersion
11:38:38 WRN retrying http request https://checkmarx.atlassian.net/wiki/rest/api/content/1998946990?expand=body.storage,version,history.previousVersion
11:38:38 WRN retrying http request https://checkmarx.atlassian.net/wiki/rest/api/content/1995211335?expand=body.storage,version,history.previousVersion
11:38:38 WRN retrying http request https://checkmarx.atlassian.net/wiki/rest/api/content/2100003058?expand=body.storage,version,history.previousVersion
11:38:38 WRN retrying http request https://checkmarx.atlassian.net/wiki/rest/api/content/1192362348?expand=body.storage,version,history.previousVersion
11:38:40 WRN retrying http request https://checkmarx.atlassian.net/wiki/rest/api/content/1169195803?expand=body.storage,version,history.previousVersion
11:38:40 WRN retrying http request https://checkmarx.atlassian.net/wiki/rest/api/content/1131742701?expand=body.storage,version,history.previousVersion
11:38:40 WRN retrying http request https://checkmarx.atlassian.net/wiki/rest/api/content/1947631705?expand=body.storage,version,history.previousVersion
11:38:40 WRN retrying http request https://checkmarx.atlassian.net/wiki/rest/api/content/1158283441?expand=body.storage,version,history.previousVersion
11:38:41 WRN retrying http request https://checkmarx.atlassian.net/wiki/rest/api/content/2490630327?expand=body.storage,version,history.previousVersion
11:38:42 WRN retrying http request https://checkmarx.atlassian.net/wiki/rest/api/content/2600012551?expand=body.storage,version,history.previousVersion
11:38:39 WRN retrying http request https://checkmarx.atlassian.net/wiki/rest/api/content/1186267153?expand=body.storage,version,history.previousVersion
exit status 1
Summary:
totalitemsscanned: 1238
totalsecretsfound: 6

We can see the 500 error code happens once a time and then all the requests will return with 500.

@github-actions
Copy link

kics-logo

KICS version: v1.7.0

Category Results
HIGH HIGH 0
MEDIUM MEDIUM 0
LOW LOW 1
INFO INFO 0
TRACE TRACE 0
TOTAL TOTAL 1
Metric Values
Files scanned placeholder 1
Files parsed placeholder 1
Files failed to scan placeholder 0
Total executed queries placeholder 49
Queries failed to execute placeholder 0
Execution time placeholder 2

@baruchiro baruchiro changed the title Fix: Confluence anonymous access is failing after few requests fix: Confluence anonymous access is failing after few requests Jul 24, 2023
@baruchiro baruchiro requested a review from jossef July 24, 2023 08:43
@baruchiro baruchiro changed the title fix: Confluence anonymous access is failing after few requests fix: confluence anonymous access is failing after few requests Jul 24, 2023
@baruchiro baruchiro enabled auto-merge July 26, 2023 13:17
@baruchiro baruchiro disabled auto-merge July 26, 2023 13:18
@baruchiro baruchiro merged commit e6ab56c into master Jul 26, 2023
7 checks passed
@baruchiro baruchiro deleted the baruchiro/Confluence-anonymous-access-is-failing-after-few-requests branch July 26, 2023 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Confluence anonymous access is failing after few requests
1 participant