Issue with GitHub import

Hello everyone. I’ve made a project (Discord Bot) and he’s on a GitHub repo.

There is a problem. When I want to import from GitHub, Glitch asks me to connect to GitHub, but I already linked my account. When I click on : “Connect”, the page refreshes. But, when I click on “Import from GitHub”, I enter the repo (I’ve checked), Glitch’s loading, and it says to me : “Arg, something went wrong. Try again ? :@”

I tried with an another account, on my smartphone, with an another GitHub account, and the same error is here. Help me please !

1 Like

Hey @PulsI0, sorry for the bother! We’ll need a little more info in order to troubleshoot this, I think. Sometimes there can be problems with the repo itself, and sometimes the Glitch project gets stuck. Can you provide the repo url and the project name so we can take a closer look?

No problem, my repo is private, I’ve set it on public, and this is the link : https://github.com/PulsI0/CupcakeDBM

But this is weird, because all my repos have the same error… :confused:

Hi @PulsI0, I was able to clone that repo without any difficulty and the fact that you’re seeing this across all your repos indicates that it’s likely related to your GitHub authentication information. I think the next thing to try is to see if reassociating your Glitch account with your GitHub account might help; to that end I’ve removed your GitHub token from your account. Can you try again to grant access to your GitHub account and try the import again to see if that’s helped work things out? You may need to use an emailed login secret to log into Glitch to start with.

Let us know how that goes!

Hi, thanks you for your answer, but I’ve created a New account, and I had this : https://image.noelshack.com/fichiers/2019/34/1/1566238008-screenshot-20190819-200530.png

And I just created my account, that’s the problem. :confused:

Thanks for the info. Do you man you’ve _just) experienced this and that you’re still having trouble? I don’t see that error code in our logs, although sometimes they take a few minutes to show up.

Yup, right After your answer, I created a New account, I click on Connect to GitHub, the page refreshes, and this error code appears :frowning:

I have some news, and this is VERY weird. I launched my VPN and I connect to my original account, I click on GitHub Connect, and I didn’t have an error :open_mouth:, I can now Import… And no. I still can’t import from GitHub… :frowning:

I am also having issues with importing a repository onto Glitch.

In my case, the repository I am attempting to import is a private GitHub repository; however, I logged onto Glitch using the GitHub account the private repository was associated with and granted Glitch OAuth permissions when prompted. When I attempt to import the private repository through the “clone from Git repo” button, the code editor hangs with a “loading project” message.

After a few failed attempts of importing, I tried to import the private repository using basic authorization in the repo URL as described in this article. That too hung with the “loading project” message.

Note that the GitHub account I am attempting to import the private repository from does not have 2FA.

I realized Glitch hadn’t actually requested the necessary permissions for importing private repositories when I attempted to clone it earlier. I snooped around and realized a button existed on the sidebar of the code editor which, after pressed, prompted me for more in-depth permissions.

It looks like that fixed it.

Where is this button ?

[Tools] then, under the Extras section, [Git, Import, and Export]. You might have to click it twice—first to be prompted for permissions then again to actually import the repository.

Yes, but this is my problem. When I click on GitHub, Glitch says : Arg, something went wrong. Try again ? :@

I found a solution, I click on New Project and Import from GitHub repo, and my repo is prompted ! :slight_smile:

This error was very weird :confused:

@cori Did you ever figure out why cookiebo still wont import anymore? I just tried and she still isn’t working.

After figuring out how to correctly import GitHub repositories (detailed in my most recent post), I was able to successfully clone my repo into one of my Glitch projects yesterday. Sadly, it seems Glitch users lack the capability of directly pulling from their GitHub repositories and, as a result, integrating changes made to the origin outside of the Glitch editor must be re-imported. While I was able to do just that a few times yesterday, I ran into an error after about the third time or so:

Arg, something went wrong. Try again? :@

After viewing the web console, I was able to determine the error was caused by GitHub’s API returning a 404 for my own repository’s web resource, which should be located at https://api.github.com/repos/:username/:repository (of course, where :username is my GitHub username and :repository is the name of my repository).

I’ve revoked OAuth from Glitch on my GitHub account, clicked the “revoke repo access” link on Glitch, deleted cookies and cache from both services, etc.—all multiple times—and still cannot get a non-404 response from GitHub’s API. If the issue is related to authentication, I can’t help but wonder why the folks over at GitHub didn’t bother to use a 401 instead.

The problem of receiving 404s now has me completely dumbfounded as the endpoint was presumably “working” for me just yesterday.

Hey @RA80533 that does indeed seem like a GitHub permissions issue. Returning a 404 for resources you’re not authorized for isn;t terribly unusual - it’s a way to not give out any information you shouldn’t have access to - that way someone doesn’t even know there’s a private project at github.com/RA80533/my-cool-project.

In this case, however, I think you’re running into a problem with the project you’re importing into and the 404 messages from the GitHub API might be a red herring - I’m seeing messages in our log that indicate that the GitHub import code is running into issues with a non-empty directory. If you’re confident you want to overwrite your project with your repo then you should be able to go into your project’s console and use rm -rf /app/* to clean out the project’s root directory and then attempt your import again - I assume that is what you want, but that command is destructive so it’s worth double-checking.

Can you give that a try and let us know how you get on?

I ended up working my way around this issue by simply adding my GitHub repository as a remote in the Glitch console and manually pulling. Checking out my repository effectively cleared my home directory as it was at the time of my post, similar to what would have happened had I removed everything manually.

I’m still not entirely sure why I was receiving the 404s in the first place since, as I mentioned earlier, my project was able to access my GitHub repository for some time before I began having problems.

I researched this behavior and apparently targeting a non-empty directory with git checkout won’t work without some elbow grease. Simply put, it’s normal behavior for Git to throw the errors you’re seeing.