-
Notifications
You must be signed in to change notification settings - Fork 154
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Sometimes, when starting the proxy it immediately crashes due to a mismatch between existing repos in the database and the default authorisedList in proxy.config.json.
Example:
npm run start
> @finos/git-proxy@2.0.0-rc.3 start
> concurrently "npm run server" "npm run client"
[1]
[1] > @finos/git-proxy@2.0.0-rc.3 client
[1] > vite --config vite.config.ts
[1]
[0]
[0] > @finos/git-proxy@2.0.0-rc.3 server
[0] > tsx index.ts
[0]
[1]
[1] VITE v4.5.14 ready in 330 ms
[1]
[1] ➜ Local: http://localhost:3000/
[1] ➜ Network: use --host to expose
[0] Configuration sources are disabled
[0] Configuration loaded successfully
[0] No plugins configured
[0] Found 0 plugin modules
[0] Checking repo git-proxy for project finos in allowed list
[0] Repo git-proxy for project finos not found in allowed list, creating it
[0] creating new repo {"project":"finos","name":"git-proxy","url":"https://github.com/finos/git-proxy.git","users":{"canPush":[],"canAuthorise":[]}}
[0] Initializing proxy router for origins: '["github.com"]'
[0] setting up origin: 'github.com'
[0] setting up catch-all route (github.com) for backwards compatibility
[0] proxy keys registered: ["/github.com/"]
[0] HTTP Proxy Listening on 8000
[0] C:\Users\juan\git-proxy\node_modules\@seald-io\binary-search-tree\lib\avltree.js:261
[0] const err = new Error(`Can't insert key ${JSON.stringify(key)}, it violates the unique constraint`)
[0] ^
[0]
[0] Error: Can't insert key "https://github.com/finos/git-proxy.git", it violates the unique constraint
[0] at _AVLTree.insert (C:\Users\juan\git-proxy\node_modules\@seald-io\binary-search-tree\lib\avltree.js:261:23)
[0] at AVLTree.insert (C:\Users\juan\git-proxy\node_modules\@seald-io\binary-search-tree\lib\avltree.js:23:31)
[0] at Index.insert (C:\Users\juan\git-proxy\node_modules\@seald-io\nedb\lib\indexes.js:117:40)
[0] at Datastore._addToIndexes (C:\Users\juan\git-proxy\node_modules\@seald-io\nedb\lib\datastore.js:534:31)
[0] at Datastore._insertInCache (C:\Users\juan\git-proxy\node_modules\@seald-io\nedb\lib\datastore.js:750:15)
[0] at Datastore._insertAsync (C:\Users\juan\git-proxy\node_modules\@seald-io\nedb\lib\datastore.js:700:10)
[0] at C:\Users\juan\git-proxy\node_modules\@seald-io\nedb\lib\datastore.js:800:47
[0] at C:\Users\juan\git-proxy\node_modules\@seald-io\nedb\lib\waterfall.js:28:16 {
[0] key: 'https://github.com/finos/git-proxy.git',
[0] errorType: 'uniqueViolated'
[0] }
[0]
[0] Node.js v24.11.0
[0] npm run server exited with code 1It's not clear whether the solution is to edit the repo matching logic in the proxyPreparations at /src/proxy/index.ts, or find where the invalid repo is being added and fix that up.
Additional context
This is likely related to the multiple Git hosts support in #1042.
@kriswest Any thoughts?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working