codesandbox / codesandbox-client

An online IDE for rapid web development
https://codesandbox.io
Other
13.1k stars 2.28k forks source link

GitHub repository sandboxes are not fetched #6443

Open Haroenv opened 2 years ago

Haroenv commented 2 years ago

🐛 bug report

Preflight Checklist

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

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 commented 2 years ago

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?

JamesACS commented 2 years ago

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

Haroenv commented 2 years ago

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?

JamesACS commented 2 years ago

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!

Haroenv commented 2 years ago

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

Haroenv commented 2 years ago

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

JamesACS commented 2 years ago

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

Haroenv commented 2 years ago

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 commented 2 years ago

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

JamesACS commented 2 years ago

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

Haroenv commented 2 years ago

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

JamesACS commented 2 years ago

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

Haroenv commented 2 years ago

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

JamesACS commented 2 years ago

That would be fantastic

dhayab commented 2 years ago

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

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.

Haroenv commented 2 years ago

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

dhayab commented 2 years ago

@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).

Haroenv commented 2 years ago

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

tay1orjones commented 2 years ago

@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.

Haroenv commented 2 years ago

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 commented 2 years ago

@JamesACS, the link I sent still fails =)

Haroenv commented 2 years ago

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 ?

sannek commented 2 years ago

@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)

Haroenv commented 2 years ago

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

tiavina-mika commented 1 year ago

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

duoluodexiaoxiaoyuan commented 2 months ago

image

I often encounter this problem. When submitting an issue, I need to provide an online demo. At this time, I don’t know what to do.