training-manual icon indicating copy to clipboard operation
training-manual copied to clipboard

recurring 403 errors while provisioning the conflict-practices repositories

Open UncleBats opened this issue 3 years ago • 6 comments

Problem: The generation of the conflict-practices repositories cannot be handled unattended. It requires a lot of reruns on bigger classes and takes full concentration that you cannot give your class while resolving this. The bigger the class the bigger the problem

Observed behavior: The generation of the conflict-practices repositories (option 4 in the scrip) is giving recurring 403 errors. Every 4th repository it is trying to make results into HTTP 403 Forbidden warning. Every consecutive repos gets the same.

Workaround: This requires you to rerun the script, skipping every repository you already created. You will need to do this roughly for the #contributors / 4.

Expected behavior: Script generates conflict-practices repositories unattended while I can focus on teaching the class

I have provided a the full log and console log console log.txt log.txt

UncleBats avatar Mar 01 '22 12:03 UncleBats

This part immediately looks strange to me:

Username for 'https://github.com': ericksegaar
Password for 'https://[email protected]':

Do you have your class tokens properly set up? I never get asked for a username or password.

amyschoen avatar Mar 01 '22 14:03 amyschoen

Ther are two ways to authenticate with the scripts, first is the .trainingmanualrc which contains the token for the GH commands. There is another authentication required for the git commands, that is what you see here.

I believer ther is a separate issue for that.

The only thing this part is doong is asking for authentication for git. As iam using wsl and normally dont use wsl for day to day work I run into all kind of issues. Most of them are already known in other issues (OSTYPE for the sed command, git credential manager so i use a pat token, the missing validation vor correct httpie version that support —quiet)

this is just a line asking me for a git token

UncleBats avatar Mar 01 '22 14:03 UncleBats

I've been running on Mac for years with no issues like you're seeing. Max class size around 30 or so but typically around 20. I wonder if there's some weird quirk specific to WSL.

amyschoen avatar Mar 01 '22 14:03 amyschoen

My guess is you use your mac for day 2 day development work too and have it set up correctly in that manner. I only use WSL to run the scripts. Normally pscore is my script of choice on windows. If the credential manager is set up it will take care of the git authentication, that's why you are not asked to put in username:token. Also the script has some more if statement like if [[ "$OSTYPE" = "msys" ]] then that should be if [[ "$OSTYPE" = "msys" || "$OSTYPE" = "linux-gnu" ]]; then to work in the create-files. Just as an example stated that there are some alternative code flows

UncleBats avatar Mar 01 '22 14:03 UncleBats

When following the flow just before the first 403 I track it down to a function in the shared_functions:300 if http --check-status --ignore-stdin --quiet --auth \ "$TOKEN_OWNER:$TEACHER_PAT" "$org_repos_endpoint/$repo/pulls" \ title="$title" \ head="$head" \ base="$base" \ body="$body"; then echo "Done." fi

This is using the token from the .trainersmanualrc and is not related to the Git authentication that was discussed above.

Commonality between all different tries is that it always starts with the "Creating pull request: Minor CSS fixes" after that first failure it constantly fails for all creating PR calls. Other calls can still succeed.

UncleBats avatar Mar 01 '22 15:03 UncleBats

I have the same issue on mac and also have to rerun the script several times. Also the cleanup scripts are not working.

wulfland avatar Mar 01 '22 18:03 wulfland