Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Persisting credentials for submodules" step failed with "Error: ENOENT: no such file or directory" when the submodule name contains non-ASCII characters #1959

Open
brlin-tw opened this issue Oct 27, 2024 · 2 comments

Comments

@brlin-tw
Copy link

brlin-tw commented Oct 27, 2024

The checkout operation failed during the "Persisting credentials for submodules" step when I specified the submodules input parameter to true:

Fetching submodules
  /usr/bin/git submodule sync
  /usr/bin/git -c protocol.version=2 submodule update --init --force --depth=100
  Submodule '軟體包管理器 Package managers' (https://gitlab.com/libre-knowledge/package-managers.git) registered for path '軟體包管理器 Package managers'
  Cloning into '/home/runner/work/software-distribution/software-distribution/軟體包管理器 Package managers'...
  Submodule path '軟體包管理器 Package managers': checked out '1e47d1a22d8ebaf51d97854ff7c11d7e357392da'
  /usr/bin/git submodule foreach git config --local gc.auto 0
  Entering '軟體包管理器 Package managers'
Persisting credentials for submodules
  /usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'url\.https\:\/\/github\.com\/\.insteadOf' && git config --local --unset-all 'url.https://github.com/.insteadOf' || :"
  Entering '軟體包管理器 Package managers'
  /usr/bin/git submodule foreach sh -c "git config --local 'http.https://github.com/.extraheader' 'AUTHORIZATION: basic ***' && git config --local --show-origin --name-only --get-regexp remote.origin.url"
  Entering '軟體包管理器 Package managers'
  file:"/home/runner/work/software-distribution/software-distribution/.git/modules/\350\273\237\351\253\224\345\214\205\347\256\241\347\220\206\345\231\250 Package managers/config"	remote.origin.url
  Error: ENOENT: no such file or directory, open '"/home/runner/work/software-distribution/software-distribution/.git/modules/\350\273\237\351\253\224\345\214\205\347\256\241\347\220\206\345\231\250 Package managers/config"'

The .gitmodules file in my Git repository:

[submodule "軟體包管理器 Package managers"]
	path = 軟體包管理器 Package managers
	url = https://gitlab.com/libre-knowledge/package-managers.git
	ignore = dirty

I suspect that the bug is triggered by the non-ASCII, space-including submodule name "軟體包管理器 Package managers", but I'm not exactly sure.

brlin-tw added a commit to libre-knowledge/software-distribution that referenced this issue Oct 27, 2024
The GitHub Action doesn't seem to like submodules with non-ASCII names.

Signed-off-by: 林博仁(Buo-ren Lin) <[email protected]>
@brlin-tw
Copy link
Author

I can verify that renaming the submodule name to exclude all non-ASCII characters(libre-knowledge/software-distribution@2761e0b8) workarounds this problem.

Workflow step output:

Fetching submodules
  /usr/bin/git submodule sync
  /usr/bin/git -c protocol.version=2 submodule update --init --force --depth=100
  Submodule 'Package managers' (https://gitlab.com/libre-knowledge/package-managers.git) registered for path '軟體包管理器 Package managers'
  Cloning into '/home/runner/work/software-distribution/software-distribution/軟體包管理器 Package managers'...
  Submodule path '軟體包管理器 Package managers': checked out '1e47d1a22d8ebaf51d97854ff7c11d7e357392da'
  /usr/bin/git submodule foreach git config --local gc.auto 0
  Entering '軟體包管理器 Package managers'
Persisting credentials for submodules
  /usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'url\.https\:\/\/github\.com\/\.insteadOf' && git config --local --unset-all 'url.https://github.com/.insteadOf' || :"
  Entering '軟體包管理器 Package managers'
  /usr/bin/git submodule foreach sh -c "git config --local 'http.https://github.com/.extraheader' 'AUTHORIZATION: basic ***' && git config --local --show-origin --name-only --get-regexp remote.origin.url"
  Entering '軟體包管理器 Package managers'
  file:/home/runner/work/software-distribution/software-distribution/.git/modules/Package managers/config	remote.origin.url
  /usr/bin/git submodule foreach git config --local --add 'url.https://github.com/.insteadOf' '[email protected]:'
  Entering '軟體包管理器 Package managers'
  /usr/bin/git submodule foreach git config --local --add 'url.https://github.com/.insteadOf' '[email protected]:'
  Entering '軟體包管理器 Package managers'

@brlin-tw brlin-tw changed the title "Persisting credentials for submodules" step failed with "Error: ENOENT: no such file or directory" error "Persisting credentials for submodules" step failed with "Error: ENOENT: no such file or directory" when the submodule name contains non-ASCII characters Oct 27, 2024
brlin-tw added a commit to libre-knowledge/software-distribution that referenced this issue Oct 27, 2024
Not going to rename submodule name because of this, we workaround it by other ways.

This reverts commit 2761e0b.

Signed-off-by: 林博仁(Buo-ren Lin) <[email protected]>
brlin-tw added a commit to libre-knowledge/software-distribution that referenced this issue Oct 27, 2024
The GitHub Action doesn't seem to like submodules with non-ASCII names, this patch workarounds it by doing the checkout manually.

Signed-off-by: 林博仁(Buo-ren Lin) <[email protected]>
brlin-tw added a commit to libre-knowledge/software-distribution that referenced this issue Oct 27, 2024
Wrong git submodule subcommand.

Signed-off-by: 林博仁(Buo-ren Lin) <[email protected]>
@brlin-tw
Copy link
Author

Another workaround is to implement the submodule checkout manually:

libre-knowledge/software-distribution@91802d1...main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant