I’m getting the following error when trying to import from GitHub:
We’re sorry, something went wrong! Please try again, or try refreshing the editor.
Trying again doesn’t work, nor does refreshing the editor.
From previous threads – eg Import from Github fails everytime - #4 by cori – I see that the git repo in Glitch can get in an inconsistent state and cause this. But how can I debug that or fix it?
I think my only idea would be to go to the console and blow the whole app away and then do another GitHub import. Is that a reasonable thing to do if I’m confident that the version on GitHub is the master copy?
Agreed. The error can happen for a number of reasons and it is never clear why.
Some common reasons why it may not work (this should be said in the error rather than just “We’re sorry, something went wrong! Please try again, or try refreshing the editor.”):
You don’t own the repo (youraccount/yourrepo VS yourgroup/yourrepo)
It just isn’t working (try later)
The fix at the moment is really just to use git on cli.
Is this all in the the Glitch console? Note that I just have a repo in GitHub and am trying to overwrite what’s in Glitch with what’s in GitHub, exactly as the built-in “Import from GitHub” feature does (when it works).
I documented the problem in this thread. If you want to remediate the issue after your project has been made, you’ll need to add your repository as a remote then git reset --hard master.
In the case that your repository is private, you’ll likely be prompted for credentials on the command line. The default storage mechanism for Git credentials dumps it all in a plaintext file so be weary if your project is shared with another user.
When I make an export from my Glitch project to an existing GitHub repo (of which I’m the owner), the export fails. At least, in Glitch. But when I go to GitHub, I can see a new branch made, named glitch with all the changes that I had exported. This shows that the export did take place, and that the UI was misleading.
For importing from a repo, the import simply fails, and once, my whole project got emptied with nothing but the README and the .env. But the last part might not be involved because the Glitch API was facing downtime.
@glitch_support, I’d appreciate it if you would take a look into this matter.
I’m almost positive that the UI always displays an error message as if the import/export failed regardless of whether or not it actually did. There might be a missing await somewhere in the client code.
Did your project have a README.md with something along the lines of the project loading, etc.?
Ah, that would’ve been a wonderful explanation from my point of view, but, alas, it’s failing the same way today. This is road-staging.glitch.me if you want to take a look. Otherwise I can try git clone https://github.com/ORGNAME/REPONAME.git from the Glitch console.