Skip to content

gel-go client fails to detect project-linked instances on Windows due to path hashing mismatch #397

Description

@craigdrayton

Root Cause:
The gel-go client and GEL CLI calculate different SHA1 hashes for the same project path on Windows:
1. GEL CLI creates stash at: $LOCALAPPDATA/EdgeDB/config/projects/server-e2e0b37462f9ec0199f908c8257247f970288a66
- Hashes the path as: C:\Code\project-name\server
2. gel-go client looks for stash at: $LOCALAPPDATA/EdgeDB/config/projects/server-f83cec2984c976035cc7e5ce45040da60951ec86
- Hashes the path with Windows long path prefix: \?\C:\Code\project-name\server

Code Location:

  • File: github.com/geldata/gel-go@v1.4.3/internal/client/connutils.go
  • Function: stashPath() at line 1519
  • Issue at lines 1525-1527:
    if runtime.GOOS == "windows" && !strings.HasPrefix(p, \\) {
    p = \\?\ + p // This prefix is added before hashing
    }

Impact:

  • Project linking doesn't work on Windows
  • Developers must use EDGEDB_INSTANCE= environment variable as a workaround
  • Error message: "Found gel.toml but the project is not initialized. Run gel project init."

Workaround:
Set EDGEDB_INSTANCE=server environment variable or programmatically set it in the application code.

Fix Recommendation:
Either:

  1. The GEL CLI should also use the \?\ prefix when creating the stash directory hash on Windows
  2. Or the gel-go client should not add the \?\ prefix before hashing the path

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions