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

Unable to delete users #7755

Closed
2 of 7 tasks
cschindl opened this issue Aug 5, 2019 · 2 comments · Fixed by #7761
Closed
2 of 7 tasks

Unable to delete users #7755

cschindl opened this issue Aug 5, 2019 · 2 comments · Fixed by #7761
Labels
Milestone

Comments

@cschindl
Copy link

cschindl commented Aug 5, 2019

  • Gitea version (or commit ref): 1.9.0+rc2-19-gd4044b9c9
  • Git version: git version 1.9.5.msysgit.1
  • Operating system: Windows Server 2012 R2
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:
    2019/08/05 09:50:47 ...uters/admin/users.go:255:DeleteUser() [E] DeleteUser: rename C:\Users\Administrator\.ssh\authorized_keys.tmp C:\Users\Administrator\.ssh\authorized_keys: The process cannot access the file because it is used by another process.
    2019/08/05 09:50:47 ...s/context/context.go:137:HTML() [D] Template: status/500
    [Macaron] 2019-08-05 09:50:47: Completed POST /admin/users/10/delete 500 Internal Server Error in 36.1925ms

Description

If you click on "Delete user", the upper error is thrown in the log. There is no hint in the user interface that something did not work. No SSH server is running on the computer and the internal SSH server is deactivated. Gitea is running with administrative privileges, so all access rights should be present.

@zeripath
Copy link
Contributor

zeripath commented Aug 6, 2019

Ooh that's interesting - something is locking the authorized keys file. Two things come to mind: a) not being able to edit the authorized_keys file immediately should not cause everything to fail - so maybe we should just add a time delayed authorized keys goroutine. b) is it possible that Gitea has locked the authorized keys file itself?

Ok. Just in case it's not Gitea could you please just confirm that it's Gitea that has locked the file. Look at https://superuser.com/questions/117902/find-out-which-process-is-locking-a-file-or-folder-in-windows and tell us if it's definitely Gitea holding the file.

How are you running SSH services? Are you even running SSH?

For a workaround whilst this is going on, if you need to delete the user you can tell Gitea not to use the authorized_keys file. Then you should be able to delete this user.

Given Windows locking behaviour - it might be that we have to recommend the use of the authorized keys command on doze.

@cschindl
Copy link
Author

cschindl commented Aug 6, 2019

I tried to find out if gitea locks the file "authorized_keys" itself but the process is too fast to check with the Windows resource monitor. Since I don't use a SSH server and use the values (DISABLE_SSH = true, START_SSH_SERVER = false) in the configuration, no other process should be responsible. Why is it actually tried to change the file "authorized_keys" if I have set "DISABLE_SSH = true" in the configuration?

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants