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

Failed to execute Update-GitHubIssue #7621

Closed
Alancere opened this issue Feb 2, 2024 · 7 comments
Closed

Failed to execute Update-GitHubIssue #7621

Alancere opened this issue Feb 2, 2024 · 7 comments
Assignees
Labels
Central-EngSys This issue is owned by the Engineering System team.

Comments

@Alancere
Copy link
Contributor

Alancere commented Feb 2, 2024

It was successful before, but it's a problem now.

Update-GitHubIssue: https://github.com/Azure/azure-sdk-for-go/blob/main/eng/common/scripts/Invoke-GitHubAPI.ps1#L367

pipeline failure link: https://teams.microsoft.com/l/message/19:b76b7ede-5516-43b4-96c2-f580fa4309d7_eaa95837-fda2-47de-949f-654b6771e436@unq.gbl.spaces/1706860464853?context=%7B%22contextType%22%3A%22chat%22%7D

local test:

curl: (successful)

curl -L -X PATCH -H "Authorization: Bearer $env:GITHUB_TOKEN" https://api.github.com/repos/Azure/azure-sdk-for-go/issues/22333 -d '{"state":"open","labels":["Beta"],"assignees":[]}

pwsh Invoke-RestMethod:

Failure: The given key 'Content-Type' was not present in the dictionary.

Invoke-RestMethod -Method PATCH -Body '{"state":"open","labels":["Beta"],"assignees":[]}' -Uri https://api.github.com/repos/Azure/azure-sdk-for-go/issues/22333 -Headers @{"Authorization" = "Bearer $env:GITHUB_TOKEN"} -MaximumRetryCount 3

we ran this test locally using latest powershell 7.4.1.

Adding Content-Type in Headers was successful (Content-Type: "application/json")

Invoke-RestMethod -Method PATCH -Body '{"state":"open","labels":["Beta"],"assignees":[]}' -Uri https://api.github.com/repos/Azure/azure-sdk-for-go/issues/22333 -Headers @{"Authorization" = "Bearer $env:GITHUB_TOKEN"; "Content-Type" = "application/json"} -MaximumRetryCount 3
@github-actions github-actions bot added the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Feb 2, 2024
@raych1
Copy link
Member

raych1 commented Feb 2, 2024

@weshaggard , do you know why this issue doesn't happen in eng sync pipeline? Powershell version is same as 7.4, the only difference I noticed is the OS type. Go pipeline uses Ubuntu while eng sync pipeline uses windows server 2022. We also tested against windows OS locally which ended up with the same error.

@weshaggard
Copy link
Member

I cannot open the teams link for some reason. Can you directly link the failing build so I can have a look? I know that the new PS version has started rolling out to our pipelines and it has causes some encoding issues.

@Alancere
Copy link
Contributor Author

Alancere commented Feb 4, 2024

@Alancere
Copy link
Contributor Author

Alancere commented Feb 4, 2024

It appears that the definition of ContentType was changed in pwsh 7.4
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/invoke-restmethod?view=powershell-7.4#-contenttype

@raych1
Copy link
Member

raych1 commented Feb 5, 2024

@weshaggard content-type has to be set explicitly. Please review the PR which works for pwsh 7.4 and the previous version.

@kurtzeborn
Copy link
Member

Pretty sure this has been fixed by @weshaggard already.

@kurtzeborn kurtzeborn added Central-EngSys This issue is owned by the Engineering System team. and removed needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. labels Jun 17, 2024
@kurtzeborn kurtzeborn moved this from 🤔 Triage to 🔬 Dev in PR in Azure SDK EngSys 🚢🎉 Jun 17, 2024
@weshaggard
Copy link
Member

I believe this was fixed by #8275

@github-project-automation github-project-automation bot moved this from 🔬 Dev in PR to 🎊 Closed in Azure SDK EngSys 🚢🎉 Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Central-EngSys This issue is owned by the Engineering System team.
Projects
Archived in project
Development

No branches or pull requests

4 participants