gk-cli icon indicating copy to clipboard operation
gk-cli copied to clipboard

[BUG] Unable to login on Github codespaces using gk auth login

Open robert-flo opened this issue 1 year ago • 2 comments

Description

Attempting to install or run the GitKraken CLI in a GitHub Codespaces environment fails with an invalid cross-device link error. This issue occurs when the installer tries to move the GitKraken binary from a temporary directory (/tmp) to its final destination (/home/codespace/.local/share/GitKrakenCLI)

Steps to Reproduce 👣

  • Launch a GitHub Codespaces environment.
  • Install the GitKraken CLI.
  • Run any GitKraken command in the terminal, such as gk auth login or gk --version.

Commands executed:

gk auth login
gk --version

Expected vs. Actual Results ❌ Expected: The GitKraken CLI core should install successfully, allowing commands to run as expected.

Actual: The GitKraken CLI core installation fails with the following error message: rename /tmp/gkinstall.../gk /home/codespace/.local/share/GitKrakenCLI/versions/gk_3_1_22: invalid cross-device link.

Terminal Output:

➜ /workspaces/nvim (main) $ gk auth login
Installing GitKraken core
rename /tmp/gkinstall2384009306/gk /home/codespace/.local/share/GitKrakenCLI/versions/gk_3_1_22: invalid cross-device link

➜ /workspaces/nvim (main) $ which gk
/home/codespace/.local/bin/gk

➜ /workspaces/nvim (main) $ gk --version
Installing GitKraken core
rename /tmp/gkinstall732985216/gk /home/codespace/.local/share/GitKrakenCLI/versions/gk_3_1_22: invalid cross-device link

➜ /workspaces/nvim (main) $ git --version
git version 2.50.1

System and Application Versions 🖥️ GitKraken CLI Version: v3.1.20 Operating System: GitHub Codespaces (Linux-based) Architecture: x64 Git Version: git version 2.50.1

GitKraken CLI Version

3.1.20

OS Version

GitHub Codespaces environment.

Git Version

git version 2.50.1

Logs, Screenshots, Screen Captures, URLs, etc

Image

robert-flo avatar Sep 13 '25 17:09 robert-flo

workaround:

Initial State and Failed Installation

First, the user checks the location of the gk command using which gk , which shows it's located at /usr/local/bin/gk. This is a standard system-wide location. The user then attempts to log in with gk auth login, which triggers an installation process for the GitKraken core. However, this fails with a specific error: invalid cross-device link.

The Most Important Step: Manual Copy

To bypass the invalid cross-device link error, the user manually copies the GitKraken core binary. This is the most crucial step in the entire process. The command cp -v /tmp/gkinstall3514872770/gk ~/.local/bin copies the gk executable from the temporary directory /tmp/gkinstall... to the user's local binary directory, ~/.local/bin. The -v flag provides a verbose output, confirming the copy operation. This action effectively completes the installation that the automatic process couldn't.

Verification and Successful Login

After manually copying the file, the user verifies the installation by running which gk again. This time, the output is /home/25ASAB015/.local/bin/gk, confirming that the system is now using the newly copied binary in the user's home directory.

The user then successfully runs gk auth login. This command opens a web browser for authentication, and the output confirms a successful login: Welcome to GitKraken CLI, 25ASAB015.

➜  $ which gk
/usr/local/bin/gk

➜  $ gk auth login
Installing GitKraken core
rename /tmp/gkinstall3514872770/gk /home/25ASAB015/.local/share/GitKrakenCLI/versions/gk_3_1_22: invalid cross-device link

➜  $  cp -v /tmp/gkinstall3514872770/gk ~/.local/bin
'/tmp/gkinstall3514872770/gk' -> '/home/25ASAB015/.local/bin/gk'

➜  $ which gk
/home/25ASAB015/.local/bin/gk

➜  $ gk auth login
A browser will open with instructions to follow.
If the browser does not open, use this url: https://gitkraken.dev/login?source=gitkraken_cli
Welcome to GitKraken CLI, 25ASAB015

robert-flo avatar Sep 16 '25 05:09 robert-flo

Fixed in version 3.1.27

miguelb-gk avatar Sep 17 '25 13:09 miguelb-gk