codesandbox / codesandbox-client

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

fetch-pack: invalid index-pack output - github error shown when installing NVM or various github repos using https #8482

Closed jkbits1 closed 3 weeks ago

jkbits1 commented 3 months ago

๐Ÿ› bug report

Preflight Checklist

Description of the problem

When using a Devbox for docker or nodejs (or any other type tested) and working in the terminal, I get this error (among other lines) fetch-pack: invalid index-pack output when installing nvm using the standard curl script (specified below) or performing git fetch or git clone on various github repos using https.

git clone or fetch on my own github repos using ssh works fine.

These actions worked a few days ago then worked sometimes. Now, they never work.

In an effort to resolve the issue, all my sandboxes have been deleted (it's not an issue for me to recreate my setup!). The current one specified in the link is my only Devbox and it is a new one with nothing else attempted on it before the specified problems.

Workaround attempts include using the terminal in the Codesandbox web editor on Edge and the terminal in VS Code Desktop. The behaviour is the same in all cases.

I have tried using various git config settings as suggested on StackOverflow and elsewhere with no difference in behaviour.

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

I cannot install NVM or any github repos other than my own.

Currently, I am not able to use Devbox for any prototyping.

To Reproduce

This is a standard method to install nvm on the linux command line. It fails with the error specified above. curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash

git clone over https results in the same error.

Link to sandbox: my repo for prototyping

You are very welcome to make any tests or changes to my repo if it is helpful in diagnosing this error, up to and including deleting it. It contains nothing that is not stored elsewhere.

Your Environment

Software Name/Version
ะกodesandbox 0.0.329
Browser Edge
Operating System Windows/Android
filipelima18 commented 3 months ago

Hi @jkbits1. Can you update the privacy of the Devbox you linked to "Unlisted", so we can investigate further?

jkbits1 commented 3 months ago

Hi @filipelima18 thanks for the response ๐Ÿ‘

The devbox is now unlisted. Let me know if I need to do anything else ๐Ÿ™‚

filipelima18 commented 3 months ago

Thanks! I can reproduce the issue but can't figure out the cause, so I will ask our engineering team to investigate this further.

jkbits1 commented 3 months ago

That's great, thank you

jkbits1 commented 3 months ago

Hi @filipelima18, as requested (outside of this github issue thread), the attached screenshot shows the fetch-pack error for the two Linux terminal commands below.

NVM install (this is the standard method to install NVM) curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash

Git clone over HTTPS git clone https://github.com/jkbits1/purescript-cookbook.git

As mentioned above, if I setup an SSH connection (something done on a now deleted sandbox) it is possible to execute both of these commands without problems. For my own repo, the SSH version of git clone, i.e. git clone git@github.com:jkbits1/purescript-cookbook.git worked fine. As a test, I forked a copy of the relevant NVM repo and cloned it using SSH i.e. git clone git@github.com:jkbits1/nvm.git. That installed into a folder from which it was possible to install and run NVM successfully.

However, these workarounds only got me so far. With my repo, I run into other problems later on with a make command that fails due to the issues with git. Screenshot 2024-06-27 161033

filipelima18 commented 2 months ago

Hi @jkbits1. Just writing to let you know that we are still investigating this issue. We will keep you posted when there's an update.

jkbits1 commented 2 months ago

Hi @filipelima18 thanks for the update ๐Ÿ‘ It is a puzzle ๐Ÿ˜• As mentioned I tried some git config settings without any clear benefit or clarification including specifying a verbose setting for git.

As reports on similar errors (on other projects) suggest some form of bandwidth issue, that suggests there is some set of configuration settings to be found. But whether that is really true and, even so, if there is a clear path to find the relevant settings is unclear.

filipelima18 commented 1 month ago

Hi @jkbits1. Thanks for being patient while we checked this. This seems to be working on the fork of the sandbox. It might have been an issue with an older version of Pitcher that got fixed on restart. Can you try restarting the VM and checking if it fixes the issue?

jkbits1 commented 4 weeks ago

Hi @filipelima18 thank you for your recent update about a fix ๐Ÿ™‚After testing in the existing sandbox and creating a new one, I can confirm that both problems mentioned above (curl install method of nvm and git clone over https) are resolved. It is now possible for me to use codesandbox for prototyping again ๐Ÿ‘

You mention that the problems might have been due to an issue with a previous version of Pitcher, which I understand supports the terminals. If there are problems in the future, is there a way for me to restart/reset Pitcher for my sandboxes to see if this has any effect?

Thanks again to you and the codesandbox team ๐Ÿ‘

filipelima18 commented 3 weeks ago

Hi @jkbits1. Thanks for confirming!

As for Pitcher updates, I don't believe there is a way to update/restart/reset Pitcher manually, but restarting the VM manually might be helpful in those instances. You can restart the VM by clicking the CodeSandbox icon at the top left of the editor -> Restart VM.

jkbits1 commented 3 weeks ago

Hi @filipelima18 thanks for the info and suggestion.

My feeling is restarting the VM won't be enough with Pitcher. Prior to raising this issue I deleted and restarted multiple VMs without success. Maybe with the new Pitcher version that will be different, though.

Thanks again to you and the team ๐Ÿ‘