codesandbox-client icon indicating copy to clipboard operation
codesandbox-client copied to clipboard

GitHub repository sandboxes are not fetched

Open Haroenv opened this issue 2 years ago • 24 comments

🐛 bug report

Preflight Checklist

  • [x] I have read the Contributing Guidelines for this project.
  • [x] I agree to follow the Code of Conduct that this project adheres to.
  • [x] I have searched the issue tracker for an issue that matches the one I want to file, without success.

Description of the problem

Hey @sannek / @lbogdan, it seems that certain repositories no longer correctly seem fetched. No information or files can be found:

Screenshot 2022-02-03 at 13 18 45

I think this may be the same issue as happened back in September in https://github.com/codesandbox/codesandbox-client/issues/6109

How has this issue affected you? What are you trying to accomplish?

Examples in our documentation no longer work

To Reproduce

  • https://codesandbox.io/s/github/algolia/doc-code-samples/tree/master/React%20InstantSearch/injected-content
  • https://codesandbox.io/s/github/algolia/doc-code-samples/tree/master/React+InstantSearch/injected-content

Link to sandbox: https://codesandbox.io/s/github/algolia/doc-code-samples/tree/master/React%20InstantSearch/injected-content

Your Environment

Software Name/Version
Сodesandbox 54f46eeec
Browser Safari / Chrome
Operating System macOS

Haroenv avatar Feb 03 '22 12:02 Haroenv

I just pushed an empty commit and the sandbox works again, but I guess it's just some cache that should be cleared you can't do automatically or via the UI?

Haroenv avatar Feb 03 '22 12:02 Haroenv

@Haroenv - They all seem to be working on this end. Have you been able to reproduce this?

JamesACS avatar Feb 03 '22 14:02 JamesACS

I did an empty commit, and since then that repository worked again, but in the past this same behaviour happened too, so I think it's a recurring problem, which in this case seems to coincide with a big GitHub downtime yesterday?

Haroenv avatar Feb 03 '22 14:02 Haroenv

It'd make sense for the Github downtime to be the cause this time - but please do keep an eye out for this and if you find a way to reproduce it - let us know!

JamesACS avatar Feb 03 '22 15:02 JamesACS

I'm having the same issue again: https://codesandbox.io/s/github/algolia/doc-code-samples/tree/master/React%20InstantSearch/routing-basic

Haroenv avatar Feb 07 '22 08:02 Haroenv

As the sandboxes are linked from our documentation I have to fix it by pushing an empty commit again. Luckily that still does the trick, but the issue can be quite annoying as we have no idea what causes it, so when to push a fake commit

Haroenv avatar Feb 07 '22 08:02 Haroenv

@Haroenv - That Sandbox seems to be loading fine for me? The previous examples also seem to have been deleted

JamesACS avatar Feb 15 '22 10:02 JamesACS

Yes @JamesACS, as we have it in the documentation, we can't afford having broken files unfortunately so I push an empty commit and the files work again, but this issue comes up fairly frequently (usually after GitHub downtime I think)

Haroenv avatar Feb 15 '22 10:02 Haroenv

Right now I just had the issue with https://codesandbox.io/s/github/algolia/doc-code-samples/tree/master/Angular%20InstantSearch/algolia-insights

The return from https://codesandbox.io/api/v1/sandboxes/github/algolia/doc-code-samples/tree/master/Angular%20InstantSearch/algolia-insights is:

{"data":{"original_git_commit_sha":null,"original_git":null,"feature_flags":{"comments":false,"container_lsp":false},"pr_number":null,"custom_template":{"color":"#61DAFB","icon_url":"github","id":"119053c7-9806-4f28-b62c-0ca1bf54eaf7","official":false,"published":true,"title":"algolia/doc-code-samples","url":null},"forked_template":null,"entry":"index.html","screenshot_url":"https://screenshots.codesandbox.io/ov5y5m7y5z/58.png","id":"ov5y5m7y5z","base_git":null,"is_sse":false,"template":"parcel","directories":[],"fork_count":6,"author":null,"user_liked":false,"description":null,"tags":[],"git":{"branch":"master","commit_sha":"71710ff0078b527219760adf5e55911fdf8ce689","path":"Angular+InstantSearch/algolia-insights","repo":"doc-code-samples","username":"algolia"},"npm_dependencies":{},"preview_secret":null,"privacy":0,"updated_at":"2022-02-12T22:46:56","owned":false,"modules":[],"like_count":0,"view_count":405,"team":null,"collection":false,"is_frozen":false,"forked_template_sandbox":null,"inserted_at":"2019-02-18T11:09:17","alias":"algolia-doc-code-samples-ov5y5m7y5z","title":"algolia/doc-code-samples","permissions":{"prevent_sandbox_export":false,"prevent_sandbox_leaving":false},"external_resources":[],"forked_from_sandbox":null,"picks":[],"source_id":"2003a470-eedb-4c58-b363-f0a307a320d5","authorization":"read","always_on":false,"npm_registries":[],"version":58,"room_id":null}}

It seems like GitHub isn't fetched correctly? Although the sha does show up

Haroenv avatar Feb 15 '22 12:02 Haroenv

Sorry for the delay @Haroenv - has this been happening regularly since? I'm still having trouble reproducing this with any consistency

JamesACS avatar Feb 21 '22 17:02 JamesACS

Sorry, I haven't seen it since last week.

Haroenv avatar Feb 21 '22 19:02 Haroenv

Thanks @Haroenv - I'll keep looking into this from our end but if you encounter it again please let me know!

JamesACS avatar Feb 22 '22 10:02 JamesACS

What would be most useful to share when I see it next? A HAR?

Haroenv avatar Feb 22 '22 10:02 Haroenv

That would be fantastic

JamesACS avatar Feb 22 '22 10:02 JamesACS

Hi @JamesACS, the same issue can be visible here:

  • https://codesandbox.io/s/github/algolia/doc-code-samples/tree/master/React%20InstantSearch/injected-content

You can note that it works when the repo is referenced by a SHA hash instead of a ref.

I have saved a full HAR archive, but before posting it here, are there things I should remove from it (access tokens, etc.)? As the file is 50mb it is difficult to find out myself. I can also send it to you privately that works for you.

dhayab avatar Mar 01 '22 10:03 dhayab

For me that link works right now, I guess because the cache has been busted since?

Haroenv avatar Mar 01 '22 12:03 Haroenv

@Haroenv indeed, most probably due to the empty commit I pushed on the repo after I saved a HAR archive for troubleshooting (I could not let the sandboxes be unavailable for too long).

dhayab avatar Mar 01 '22 13:03 dhayab

This happened multiple times last Friday when GitHub was partially down, and it persisted until there was an empty commit again

Haroenv avatar Mar 21 '22 14:03 Haroenv

@JamesACS We're seeing similar with this sandbox:

https://codesandbox.io/s/github/carbon-design-system/carbon/tree/main/examples/codesandbox

Could not fetch dependencies, please try again in a couple seconds: Cannot read properties of null (reading 'match')

Could not fetch dependencies, please try again in a couple seconds: Cannot read properties of null (reading 'match')

Specifying a version tag ref avoids the issue:

https://codesandbox.io/s/github/carbon-design-system/carbon/tree/v11.2.0/examples/codesandbox

We pushed a commit to the repo for this sandbox but the problem has not resolved.

tay1orjones avatar May 02 '22 16:05 tay1orjones

It's happening right now with https://codesandbox.io/s/github/algolia/doc-code-samples/tree/master/React%20InstantSearch%20Hooks/algolia-insights, but not https://codesandbox.io/s/github/algolia/doc-code-samples/tree/master/React%20InstantSearch/injected-content for example

I created a new branch test, but that fails too https://codesandbox.io/s/github/algolia/doc-code-samples/tree/test/React%20InstantSearch%20Hooks/algolia-insights

Haroenv avatar May 24 '22 12:05 Haroenv

@JamesACS, the link I sent still fails =)

Haroenv avatar Jun 06 '22 11:06 Haroenv

Having this with those previous links, and also with https://codesandbox.io/s/github/algolia/doc-code-samples/tree/master/React%20InstantSearch%20Hooks/routing-seo-friendly https://codesandbox.io/s/github/algolia/doc-code-samples/tree/master/React%20InstantSearch%20Hooks/routing-basic

Is there something wrong with the repository that this happens so much @JamesACS ?

Haroenv avatar Jun 29 '22 06:06 Haroenv

@Haroenv -- I'm looking into this this morning (apologies for the delay!).

I've figured out the cause (apparently there is an edge case related to spaces in folder names...), but I'm having a think on how to fix this without introducing a whole new set of edge cases. I'll get back to you when I have a fix -- hopefully by the end of today!

It's quite confusing though, because this bug seems to be caused by the fix I introduced in #6109 (now the fact that we do convert the spaces to + seems to be the problem)

sannek avatar Jun 30 '22 09:06 sannek

We'll migrate to non-spaces URLs, I didn't know this could cause issues!

Haroenv avatar Jul 04 '22 08:07 Haroenv

the same problem here: https://codesandbox.io/s/github/tiavina-mika/creatable-autocomplete-mui-hook-form have you found a solution? image

tiavina-mika avatar May 26 '23 11:05 tiavina-mika