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

Source Control no longer works on Ubuntu 20.04 #147797

Closed
xinthose opened this issue Apr 20, 2022 · 15 comments
Closed

Source Control no longer works on Ubuntu 20.04 #147797

xinthose opened this issue Apr 20, 2022 · 15 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) git GIT issues

Comments

@xinthose
Copy link

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.66.2
  • OS Version: Ubuntu 20.04.4 LTS

Steps to Reproduce:

  1. open a visual studio workspace
  2. click the source control button
  3. all that is shown is "Initialize Repository" and "Publish to GitHub".

I have a .git folder in the same directory as the workspace. Running git init on the directory, or doing a fresh checkout does not help. This same folder/repository has worked for years with VS Code Source Control without issues until last week. I tried reverting the version back to March, but that did not help either.

@lszomoru lszomoru added git GIT issues upstream Issue identified as 'upstream' component related (exists outside of VS Code) and removed upstream Issue identified as 'upstream' component related (exists outside of VS Code) labels Apr 21, 2022
@lszomoru
Copy link
Member

Have you recently upgraded your version of Git? What version of Git are you using?

@xinthose
Copy link
Author

xinthose commented Apr 21, 2022

@lszomoru I am not sure. I do update the packages when Ubuntu gives me the popup occasionally. git version: 2.25.1.
Git.enabled is true in VS Code settings.

@lszomoru
Copy link
Member

I see. Could you please open the folder/workspace, and then invoke the Git: Show Git Output command from the command palette. Could you please share the contents of the git output window as that will hopefully tell us more about the repository discovery.

@lszomoru lszomoru added the info-needed Issue requires more information from poster label Apr 21, 2022
@xinthose
Copy link
Author

xinthose commented Apr 21, 2022

@lszomoru OK. Here is the output:

[2022-04-21T18:19:30.361Z] Validating found git in: git
[2022-04-21T18:19:30.567Z] Using git 2.25.1 from git

The directory does exist. I am using portalogic_station.code-workspace:

root@linux-laptop:~/Documents/github/portalogic/portalogic_station# ls -la
total 44
drwxrwxrwx  6 root    root    4096 Apr 20 14:24 .
drwxrwxrwx 10 elemech elemech 4096 Apr 20 14:24 ..
drwxrwxrwx 13 root    root    4096 Apr 20 14:24 back_end
drwxrwxrwx  4 root    root    4096 Apr 20 14:24 client
drwxrwxrwx  8 root    root    4096 Apr 21 08:05 .git
-rwxrwxrwx  1 root    root     407 Apr 20 14:24 .gitattributes
-rwxrwxrwx  1 root    root    1327 Apr 20 14:24 .gitignore
-rwxrwxrwx  1 root    root    2000 Apr 20 14:24 portalogic_station.code-workspace
-rwxrwxrwx  1 root    root       5 Apr 20 14:24 .prettierignore
-rwxrwxrwx  1 root    root     372 Apr 20 14:24 README.md
drwxrwxrwx  2 root    root    4096 Apr 20 14:24 .vscode
root@linux-laptop:~/Documents/github/portalogic/portalogic_station# ls .git
branches  config  description  HEAD  hooks  index  info  logs  objects  packed-refs  refs

The same repository works fine in Windows VS Code with Source Control.

@just-trey
Copy link

just-trey commented Apr 22, 2022

I have the same issue here is my output

[2022-04-22T00:13:06.031Z] Validating found git in: git
[2022-04-22T00:13:06.048Z] Using git 2.32.0 from git
[2022-04-22T00:14:36.216Z] > git init [2ms]

@rysmith504
Copy link

i am having the same issue as well but I am running ubuntu on windows

@SalmanOz
Copy link

i am having the same issue as well but I am running ubuntu on windows

same and, having the same issue. I click the initialize repository and choose the my project folder but nothing happens.

@xinthose
Copy link
Author

xinthose commented May 2, 2022

I suppose Microsoft does not care about fixing this seeing as how there are 5k+ open issues. Reverting back to version Nov 2021 allows GitHub source control to work again: https://code.visualstudio.com/updates/v1_63. You have to make sure the repository has been checked out with a personal access code token and run chmod -R 777 . and git config --global --add safe.directory /path/to/git/repo on the directory.

@Andrew-HT
Copy link

Andrew-HT commented May 4, 2022

I am having the same issue.

VS Code Version: 1.66.2
OS Version: Ubuntu 18.04.6 LTS (in VirtualBox v6.1.22)

I reverted to VSCode version 1.65.2 and the issue was present there too. I can still use git through the CLI and do pulls and commits with no problem. It's just that the source control in VSCode is not working.

I suppose Microsoft does not care about fixing this seeing as how there are 5k+ open issues. Reverting back to version Nov 2021 allows GitHub source control to work again: https://code.visualstudio.com/updates/v1_63. You have to make sure the repository has been checked out with a personal access code token and run chmod -R 777 . on the directory first.

Unfortunately, this workaround didn't work for me. I switched to version 1.63.2 of VSCode, git cloned my repo and authenticated with my personal access token, re-set the remote set-url origin with the personal access token, chmod, git init in the directory, restarted VSCode - no dice. I still have the same source control screen where the "Initialize Repository" button does nothing.

I also attempted to go through the "Publish to GitHub" method and that did nothing either.

VirtualBoxVM_UWLXAURHZL
(Ignore where the cursor is, not sure why the capture has my cursor offset from where it actually is.)

This could be related:
microsoft/vscode-remote-release#6637

@lszomoru
Copy link
Member

Apologies for not getting back to you on this issue until now. The latest Insiders release (2022-05-16), contains logging improvements, as well as additional logging to the code that detects git repositories which will hopefully track down the root cause of the problem. Could you please:

  1. Enable verbose logging as documented on this wiki
  2. Open the folder/workspace that contains the git repository
  3. Open the git output channel and share the contents of it

@Andrew-HT
Copy link

Installed version 1.68.0-insiders and enabled Trace level logging.
Here's what I get:

[2022-05-19T18:18:39.256Z] > git init [7ms]
[2022-05-19T18:18:39.819Z] [trace] Opening repository: myrepo
[2022-05-19T18:18:39.833Z] > git rev-parse --show-toplevel [4ms]
[2022-05-19T18:18:39.833Z] fatal: unsafe repository ('myrepo' is owned by someone else)
To add an exception for this directory, call:

git config --global --add safe.directory myrepo

[2022-05-19T18:18:39.834Z] [trace] Opening repository for path='myrepo' failed; ex=Failed to execute git {
"exitCode": 128,
"gitCommand": "rev-parse",
"stdout": "",
"stderr": "fatal: unsafe repository ('myrepo' is owned by someone else)\nTo add an exception for this directory, call:\n\n\tgit config --global --add safe.directory myrepo\n"
}

I already tried running the add safe.directory command and I don't notice any change. Same error in the log appears. From Googling this, it looks like it's related to the recent Git vulnerability?

https://github.blog/2022-04-12-git-security-vulnerability-announced/

Hope this helps.

@xinthose
Copy link
Author

xinthose commented Jun 7, 2022

I was able to get the latest version of VS Code (1.67.2) to work on Ubuntu 22.04 with git. I had to run this command first as non root git config --global --add safe.directory /path/to/my/repo and clone the repo with a personal access token.

@lszomoru
Copy link
Member

lszomoru commented Jul 1, 2022

@xinthose, sorry for not getting back to you on this until now.
I am glad to hear that you were able to get things working.

@lszomoru lszomoru closed this as completed Jul 1, 2022
@lszomoru lszomoru added upstream Issue identified as 'upstream' component related (exists outside of VS Code) and removed info-needed Issue requires more information from poster labels Jul 1, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Aug 15, 2022
@lszomoru
Copy link
Member

lszomoru commented Dec 6, 2022

Duplicate of #157159. This will be included in VS Code 1.74.

@lszomoru lszomoru added *duplicate Issue identified as a duplicate of another issue(s) and removed upstream Issue identified as 'upstream' component related (exists outside of VS Code) labels Dec 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) git GIT issues
Projects
None yet
Development

No branches or pull requests

6 participants