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

Error: Cannot read properties of undefined (reading 'length') #40

Closed
jarrodmillman opened this issue Apr 11, 2023 · 13 comments
Closed

Error: Cannot read properties of undefined (reading 'length') #40

jarrodmillman opened this issue Apr 11, 2023 · 13 comments

Comments

@rflamary
Copy link

We are also getting here

https://github.com/PythonOT/POT/actions/runs/4661515618

@QuLogic
Copy link

QuLogic commented Apr 11, 2023

@larsoner
Copy link
Collaborator

Uh oh 😱 I'll try to look soon but if anyone has ideas or wants to try in the meantime feel free...

@larsoner
Copy link
Collaborator

From MNE-Python see:

https://github.com/mne-tools/mne-python/actions/runs/4670258124/jobs/8269763706

##[debug]Considering CircleCI jobs named: ci/circleci: build_docs,ci/circleci: build_docs_main
##[debug]context:    ci/circleci: build_docs
##[debug]state:      pending
##[debug]target_url: https://circleci.com/gh/mne-tools/mne-python/538[26](https://github.com/mne-tools/mne-python/actions/runs/4670258124/jobs/8269763706#step:2:27)
##[debug]org:   mne-tools
##[debug]repo:  mne-python
##[debug]build: 53826
##[debug]Fetching JSON: https://circleci.com/api/v2/project/gh/mne-tools/mne-python/53826/artifacts
##[debug]Artifacts JSON (status=404):
##[debug]{"message":"Job not found."}

Looks like #38 was "bad request" and this is "Job not found" so... that's something.

@larsoner
Copy link
Collaborator

... and looking at

https://circleci.com/api/v2/project/gh/mne-tools/mne-python/53826/artifacts

myself does not work. This always at least used to work for me in my web browser given my login credentials etc. This seems like a bug at the CircleCI end. I'll see if I can open a support bug report with them.

@larsoner
Copy link
Collaborator

... okay no, it is another access problem. I even added a api-token and it still fails in #41 even though this URL works fine for me in my browser given my CircleCI permissions:

https://circleci.com/api/v2/project/gh/larsoner/circleci-artifacts-redirector-action/202/artifacts

So somehow when GitHub tries to load this URL it gets a 404, when I load it in Chrome I get the correct JSON:

{
    "next_page_token": null,
    "items": [
        {
            "path": "test_artifacts/root_artifact.md",
            "node_index": 0,
            "url": "https://output.circle-artifacts.com/output/job/08a1256b-8142-4bf5-93dc-b1dd392f5a56/artifacts/0/test_artifacts/root_artifact.md"
        }
    ]
}

So this will require a bit more debugging at our end I think. Next step is probably to look at what headers Chrome is sending vs trying curl or something directly. I did something like this in #38.

@larsoner
Copy link
Collaborator

larsoner commented Apr 12, 2023

Argh, okay the token must be a personal API token, not a project token at the CircleCI end as those aren't supported yet.

  1. You can create a personal CircleCI token here (I named mine CIRCLE_STATUS): https://app.circleci.com/settings/user/tokens
  2. Add the token value (from the CircleCI website) it to the secrets of your org or project, e.g., for MNE-Python I added it under the name CIRCLE_TOKEN for the org to https://github.com/organizations/mne-tools/settings/secrets/actions
  3. Add it to the action as api-token: ${{ secrets.CIRCLECI_TOKEN }} in the with for the action

I'll close but feel free to comment if this doesn't work and we can investigate further!

@jschueller
Copy link

I think this is working again with your recommendations, thanks!

@larsoner
Copy link
Collaborator

Great! And norry for the hassle, CircleCI's API just seems to be a bit of moving target :(

melissawm added a commit to melissawm/napari that referenced this issue Apr 12, 2023
melissawm added a commit to melissawm/napari that referenced this issue Apr 12, 2023
stefanv added a commit to stefanv/scikit-image that referenced this issue Apr 14, 2023
jni pushed a commit to napari/docs that referenced this issue Apr 15, 2023
# Description

An upstream bug has caused our docs preview link to stop working (see
scientific-python/circleci-artifacts-redirector-action#40 (comment)
for context)

# References
See also #135
@rflamary
Copy link

Hello @larsoner thanks for the fix, it does work on POT (PythonOT/POT#460) but it still fails in some cases.

Since the token is a secret it will not run for PR from oher repos where we need to look at the artifact the most. Are there any ways to make this work?

@QuLogic
Copy link

QuLogic commented Apr 18, 2023

The workflow runs on status events, which should still be posted on your main repo as long as the forks have PRs out of them.

@rflamary
Copy link

Thanks @QuLogic for the explanation, it makes sens. But then I have no idea why a few worked and now everything is failing :
https://github.com/PythonOT/POT/actions/workflows/circleci-redirector.yml

@rflamary
Copy link

OK I found my bug sorry for bothering you all and again thank to @larsoner for this extremely usefull action!

melissawm added a commit to melissawm/napari-docs that referenced this issue Apr 26, 2023
# Description

An upstream bug has caused our docs preview link to stop working (see
scientific-python/circleci-artifacts-redirector-action#40 (comment)
for context)

# References
See also napari#135
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

No branches or pull requests

5 participants