Failed to import repository

When importing into bolt.dir I get

Failed to import repository

and this in my logs:

app-dev-1  | Git proxy error: TypeError: fetch failed
app-dev-1  |     at node:internal/deps/undici/undici:13185:13
app-dev-1  |     at processTicksAndRejections (node:internal/process/task_queues:95:5)
app-dev-1  |     at handleProxyRequest (/app/app/routes/api.git-proxy.$.ts:30:22)
app-dev-1  |     at Object.callRouteLoader (/app/node_modules/.pnpm/@remix-run+server-runtime@2.15.0_typescript@5.7.2/node_modules/@remix-run/server-runtime/dist/data.js:59:16)
app-dev-1  |     at /app/node_modules/.pnpm/@remix-run+router@1.21.0/node_modules/@remix-run/router/router.ts:4899:19
app-dev-1  |     at callLoaderOrAction (/app/node_modules/.pnpm/@remix-run+router@1.21.0/node_modules/@remix-run/router/router.ts:4963:16)
app-dev-1  |     at async Promise.all (index 0)
app-dev-1  |     at defaultDataStrategy (/app/node_modules/.pnpm/@remix-run+router@1.21.0/node_modules/@remix-run/router/router.ts:4772:17)
app-dev-1  |     at callDataStrategyImpl (/app/node_modules/.pnpm/@remix-run+router@1.21.0/node_modules/@remix-run/router/router.ts:4835:17)
app-dev-1  |     at callDataStrategy (/app/node_modules/.pnpm/@remix-run+router@1.21.0/node_modules/@remix-run/router/router.ts:3992:19)
app-dev-1  |     at loadRouteData (/app/node_modules/.pnpm/@remix-run+router@1.21.0/node_modules/@remix-run/router/router.ts:3937:19)
app-dev-1  |     at queryImpl (/app/node_modules/.pnpm/@remix-run+router@1.21.0/node_modules/@remix-run/router/router.ts:3696:20)
app-dev-1  |     at Object.queryRoute (/app/node_modules/.pnpm/@remix-run+router@1.21.0/node_modules/@remix-run/router/router.ts:3629:18)
app-dev-1  |     at handleResourceRequest (/app/node_modules/.pnpm/@remix-run+server-runtime@2.15.0_typescript@5.7.2/node_modules/@remix-run/server-runtime/dist/server.js:402:20)
app-dev-1  |     at requestHandler (/app/node_modules/.pnpm/@remix-run+server-runtime@2.15.0_typescript@5.7.2/node_modules/@remix-run/server-runtime/dist/server.js:156:18)
app-dev-1  |     at /app/node_modules/.pnpm/@remix-run+dev@2.15.0_@remix-run+react@2.15.0_react-dom@18.3.1_react@18.3.1__react@18.3.1_typ_3djlhh3t6jbfog2cydlrvgreoy/node_modules/@remix-run/dev/dist/vite/cloudflare-proxy-plugin.js:70:25 {
app-dev-1  |   [cause]: InvalidArgumentError: invalid connection header
app-dev-1  |       at processHeader (node:internal/deps/undici/undici:2153:17)
app-dev-1  |       at new Request (node:internal/deps/undici/undici:1983:15)
app-dev-1  |       at Client.[dispatch] (node:internal/deps/undici/undici:7502:25)
app-dev-1  |       at Intercept (node:internal/deps/undici/undici:7237:20)
app-dev-1  |       at Client.[Intercepted Dispatch] (node:internal/deps/undici/undici:557:16)
app-dev-1  |       at Client.dispatch (node:internal/deps/undici/undici:573:44)
app-dev-1  |       at Pool.[dispatch] (node:internal/deps/undici/undici:804:32)
app-dev-1  |       at Pool.dispatch (node:internal/deps/undici/undici:573:44)
app-dev-1  |       at Agent.[dispatch] (node:internal/deps/undici/undici:7924:27)
app-dev-1  |       at Agent.Intercept (node:internal/deps/undici/undici:7237:20)
app-dev-1  |       at Agent.dispatch (node:internal/deps/undici/undici:573:44)
app-dev-1  |       at node:internal/deps/undici/undici:10834:55
app-dev-1  |       at new Promise (<anonymous>)
app-dev-1  |       at dispatch (node:internal/deps/undici/undici:10834:16)
app-dev-1  |       at httpNetworkFetch (node:internal/deps/undici/undici:10731:73)
app-dev-1  |       at httpNetworkOrCacheFetch (node:internal/deps/undici/undici:10617:39)
app-dev-1  |       at httpFetch (node:internal/deps/undici/undici:10450:43)
app-dev-1  |       at schemeFetch (node:internal/deps/undici/undici:10367:18)
app-dev-1  |       at node:internal/deps/undici/undici:10212:26
app-dev-1  |       at mainFetch (node:internal/deps/undici/undici:10231:11)
app-dev-1  |       at fetching (node:internal/deps/undici/undici:10179:7)
app-dev-1  |       at fetch (node:internal/deps/undici/undici:10048:20)
app-dev-1  |       at fetch (node:internal/deps/undici/undici:13183:10)
app-dev-1  |       at fetch (node:internal/bootstrap/web/exposed-window-or-worker:72:12)
app-dev-1  |       at handleProxyRequest (/app/app/routes/api.git-proxy.$.ts:30:28)
app-dev-1  |       at loader (/app/app/routes/api.git-proxy.$.ts:20:10)
app-dev-1  |       at Object.callRouteLoader (/app/node_modules/.pnpm/@remix-run+server-runtime@2.15.0_typescript@5.7.2/node_modules/@remix-run/server-runtime/dist/data.js:59:22)
app-dev-1  |       at handler (/app/node_modules/.pnpm/@remix-run+server-runtime@2.15.0_typescript@5.7.2/node_modules/@remix-run/server-runtime/dist/routes.js:54:39)
app-dev-1  |       at actualHandler (/app/node_modules/.pnpm/@remix-run+router@1.21.0/node_modules/@remix-run/router/router.ts:4887:14)
app-dev-1  |       at /app/node_modules/.pnpm/@remix-run+router@1.21.0/node_modules/@remix-run/router/router.ts:4901:13
app-dev-1  |       at runHandler (/app/node_modules/.pnpm/@remix-run+router@1.21.0/node_modules/@remix-run/router/router.ts:4906:6)
app-dev-1  |       at callLoaderOrAction (/app/node_modules/.pnpm/@remix-run+router@1.21.0/node_modules/@remix-run/router/router.ts:4963:22)
app-dev-1  |       at Object.resolve (/app/node_modules/.pnpm/@remix-run+router@1.21.0/node_modules/@remix-run/router/router.ts:4814:11)
app-dev-1  |       at map (/app/node_modules/.pnpm/@remix-run+router@1.21.0/node_modules/@remix-run/router/router.ts:4772:62)
app-dev-1  |       at Array.map (<anonymous>)
app-dev-1  |       at dataStrategyImpl (/app/node_modules/.pnpm/@remix-run+router@1.21.0/node_modules/@remix-run/router/router.ts:4772:49)
app-dev-1  |       at callDataStrategyImpl (/app/node_modules/.pnpm/@remix-run+router@1.21.0/node_modules/@remix-run/router/router.ts:4835:23)
app-dev-1  |       at callDataStrategy (/app/node_modules/.pnpm/@remix-run+router@1.21.0/node_modules/@remix-run/router/router.ts:3992:25)
app-dev-1  |       at loadRouteData (/app/node_modules/.pnpm/@remix-run+router@1.21.0/node_modules/@remix-run/router/router.ts:3937:25)
app-dev-1  |       at queryImpl (/app/node_modules/.pnpm/@remix-run+router@1.21.0/node_modules/@remix-run/router/router.ts:3696:26)
app-dev-1  |       at Object.queryRoute (/app/node_modules/.pnpm/@remix-run+router@1.21.0/node_modules/@remix-run/router/router.ts:3629:24)
app-dev-1  |       at handleResourceRequest (/app/node_modules/.pnpm/@remix-run+server-runtime@2.15.0_typescript@5.7.2/node_modules/@remix-run/server-runtime/dist/server.js:402:40)
app-dev-1  |       at requestHandler (/app/node_modules/.pnpm/@remix-run+server-runtime@2.15.0_typescript@5.7.2/node_modules/@remix-run/server-runtime/dist/server.js:156:24)
app-dev-1  |       at /app/node_modules/.pnpm/@remix-run+dev@2.15.0_@remix-run+react@2.15.0_react-dom@18.3.1_react@18.3.1__react@18.3.1_typ_3djlhh3t6jbfog2cydlrvgreoy/node_modules/@remix-run/dev/dist/vite/cloudflare-proxy-plugin.js:70:31
app-dev-1  |       at processTicksAndRejections (node:internal/process/task_queues:95:5) {
app-dev-1  |     code: 'UND_ERR_INVALID_ARG'
app-dev-1  |   }
app-dev-1  | }

is import repo working?

I do have my github personal access token set in the UI

Hi,
which URL did you use? It needs to be the URL in the browser, not the git clone URL.

actually ideally it should be the git clone url with .git at the end

but somehow for github the browser url also seems to work

@thecodacus git github (.git) url never worked for me in my tests. if this works now, then there was a change. I also mentioned this somewhere in an issue/PR

can you try with the latest ?

also the url has to be the https one not the ssh one

yes, with the latest it is working. (main branch)

I am on the main branch ( I do not see a latest branch), at this commit

(base) ➜  bolt.diy git:(main) ✗ git log -n1|cat
commit 137e2689432ef8e0a061bea6d13ead98a0e007ec
Author: Anirban Kar <thecodacus@gmail.com>
Date:   Thu Jan 30 01:22:29 2025 +0530

    fix: tune the system prompt to avoid diff writing (#1218)

When I pull it says already up to date? Should I be on another branch?

And this is the URL I am using, I got bolt to create it at one point, but have not gotten it to use it:

also tried appending .git to that URL with no success.

I also tried recreating the token following this: https://www.youtube.com/watch?v=FxMjyEzTtvY&t=1453s
same result.

no main is ok and latest just mean you should pull and to be up to date, as you did.

Just tried it to clone, without problems:

How exactly did you try to clone it? from the startpage button “Clone a git Repo”, right?

yep that is correct, I notice this little bit in my logs

app-dev-1  |     at /app/node_modules/.pnpm/@remix-run+dev@2.15.0_@remix-run+react@2.15.0_react-dom@18.3.1_react@18.3.1__react@18.3.1_typ_3djlhh3t6jbfog2cydlrvgreoy/node_modules/@remix-run/dev/dist/vite/cloudflare-proxy-plugin.js:70:25 {
app-dev-1  |   [cause]: InvalidArgumentError: invalid connection header

I am using TLS thru cloudlfare, this seems to be the issue?

Also, of note, which might be related, if I turn on basic auth, I can log in and see the site, but once I try to “clone a git repo” it puts me in a basic auth loop, even though I am already logged in.

Ok, that was a important detail you missed in your first post, that you are on cloudflare :smiley:

=> @aliasfox can you take a look please?

Yeah, I think this is more of a Cloudflare Configuration, maybe SSL/TLS issue. I’m not sure as I’ve had my Cloudflare instance running for a long time and haven’t had to set all that stuff up in years. But I found a this:

So, remove proxy_set_header Connection 'Upgrade'; in nginx did the trick:

References:

This actually doesn’t make any sense to me, because I hadn’t configured nginx or anything, but hopefully it might help.

So this did fix my problem on the git clone, but not my issues with the basic auth, which I guess I’ll gather more data and open a separate issue.

if anyone could give me some assistance on basic auth; Basic Auth breaks github import or vice versa