sot/skare3_tools

Seems to be missing a valid .netrc file in automated masters processing

Closed this issue · 6 comments

Ska.ftp is showing as a fail on the dashboard and the log seems to imply that the failures are related to .netrc and authentication probelms.

Locally Ska.ftp at the same version is passing tests for me.

And it appears the chandra_aca test failure has the same root cause ValueError: user and password or "occweb" machine definition in ~/.netrc are required for OCCweb authentication

This also appears to be the problem in the kadi regression test, which is showing HAS_OCCWEB as false, meaning that it cannot access OCCweb for generating the Major Events list.

I had not realized. I don't think this is a skare3_tools issue, but it arises from the wrong netrc file. I still do not know why it happened, but it happened when I was experimenting with building the documentation as part of a workflow (https://github.com/sot/skare3_tools/runs/1157733652).

At the time, I thought of asking if you had any ideas. Basically, the runner that does the workflow is running as me. The workflow uses two actions that use git (one for checking out, one for checking into the gh-pages branch). I tried with three different environment variables, and at least one of them caused something to overwrite the netrc file. I could not figure out what caused the issue.

And if you look into the log of the workflow I linked above, you will see an error due to authentication. It turns out that, if the netrc file has any github credentials, the requests module ignores the token you pass explicitly in the headers. It writes the header using the netrc credentials anyway.

What are the environment variables?

What are the environment variables?

Nothing that should do such a thing. GITHUB_TOKEN and GITHUB_API_TOKEN. The last one is my own, and is the one I use most of the time. Perhaps the github checkout action creates the netrc file when one passes GITHUB_TOKEN. The thing is... it also happened in my laptop (which would point to git, and not github, being the culprit). I have no idea what caused it. Nothing in my code has the word netrc in it.

ah! but now that I remember... I did run a github runner in my laptop before, using a private repository to test locally. So it might be github after all.