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

Cant Access Files Repos | Internal Error, Exit status 128 #12659

Closed
2 of 7 tasks
KnudH opened this issue Aug 31, 2020 · 11 comments · Fixed by #12668
Closed
2 of 7 tasks

Cant Access Files Repos | Internal Error, Exit status 128 #12659

KnudH opened this issue Aug 31, 2020 · 11 comments · Fixed by #12668
Labels
skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. type/bug

Comments

@KnudH
Copy link
Contributor

KnudH commented Aug 31, 2020

  • Gitea version (or commit ref): latest (Digest:sha256:f0d790a2cb78726bd8ec0baa8c1b9e00906cfd836ca89188da54c99e84472849), then switched back to
    1.12.3 built with GNU Make 4.2.1, go1.14.6 : bindata, sqlite, sqlite_unlock_notify but still not working
  • Git version: 2.24.3
  • Operating system: buster (docker)
  • 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:

Description

After updating today, I cant push or pull from my gitea-server. Before it was working fine. I tried many clients and all are showing the same error (see below). Also I cant edit files in WebUI. History is showing fine, but if i click on "edit" it is showing "loading" all the time. I cant find any entrys inside the log files (or am I looing at the wrong place?).

Screenshots

grafik

@KnudH KnudH changed the title Cant Access Repos CamelCase Problem Cant Access Repos Aug 31, 2020
@KnudH KnudH changed the title Cant Access Repos Cant Access Files Repos | Internal Error, Exit status 128 Aug 31, 2020
@Tobi823
Copy link

Tobi823 commented Aug 31, 2020

I have the same issue. Suddenly I can't push or pull from my repositories (tested it on my Arch Linux computer and Apple MacBook) after my sunday update script updated my Docker Gitea instance.
But I can see and edit my files via the web-interface.

When I revert to docker version 1.12.3 and then open a repository in the web-interface, I see a 500-error message.
Reverting back to version latest, the 500-error messages are gone, but I still can push or pull.

  • Gitea version (or commit ref): Docker Image latest (from 8/30/2020 at 11:47 pm) - but I don't know the exact git commit
  • Git version: 2.28.0 (Arch Linux), 2.27.0 (MacBook)
  • Operating system: Debian 10 4.19.0-10-amd64
  • 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 (with docker logs when I'm trying to clone a repository - I replaced the IP and the key-hash with random data):
Accepted publickey for git from 12.34.567.89 port 54050 ssh2: ED25519 SHA256:abcdefghijklmnopqrstuvwxyzabcdefghijklmnoyz
[Macaron] 2020-08-31 12:50:54: Started GET /api/internal/serv/command/6/bachelorarbeit/java-graalvm?mode=1&verb=git-upload-pack for 127.0.0.1
[Macaron] 2020-08-31 12:50:54: Completed GET /api/internal/serv/command/6/bachelorarbeit/java-graalvm?mode=1&verb=git-upload-pack 200 OK in 12.13158ms
Received disconnect from 12.34.567.89 port 54050:11: disconnected by user
Disconnected from user git 12.34.567.89 port 54050

@Tobi823
Copy link

Tobi823 commented Aug 31, 2020

Update: I can clone my repo via HTTPS but not via SSH - maybe there is a issue with the integrated SSH server?

@Tobi823
Copy link

Tobi823 commented Aug 31, 2020

When I try to connect to the internal SSH server with SSD, I get this good-looking message:

PTY allocation request failed on channel 0
Hi there, tobias! You've successfully authenticated with the key named ABCDEFGI, but Gitea does not provide shell access.
If this is unexpected, please log in with password and setup Gitea under another user.
Connection JKLMNOPQRSTU.VW closed.

=> the SSH server is somehow working

I try to debug with GIT_SSH_COMMAND="ssh -v" git clone but I have not seen anything special.

I also try Wireshark, but the connection was obviously encryption. Nothing special except that the last three TCP-messages are retransmission packages from my computer to my server

@gsantner
Copy link

gsantner commented Aug 31, 2020

I also use ssh (the system ssh server as usual), and get error 128 as well.

gitea log that shows up at push/pull in screenshot.

Screenshot_20200831-154829

Running Gitea 1.13.0+dev-495-g9bc69ff26, repo and contents are there and I haved pushed/pulled from it daily without any issues in the past.

What I could think off being relevant: 7ba6fea ( Use shellquote to unpack arguments to gitea serv (#12624) )

--
I reverted back to the dl.gitea.io build from 28. august, all works fine there. So something has been merged between 28. august and today that resulted in the bug.

Screenshot_20200831-155306

@zeripath
Copy link
Contributor

Could you add --debug after the gitea serv on the authorized_keys line.

@zeripath
Copy link
Contributor

Sorry that might actually make things worse... it would be better to change the RUN_MODE setting in app.ini to RUN_MODE=dev

@eyriewow
Copy link

eyriewow commented Aug 31, 2020

As I posted on discord I had a similar (the same?) issue but for me it only affected repos with CamelCase names.
So "testrepo1" would work no problem but "TestRepo2" would throw the error in the first post's screenshot when pushing/pulling via ssh. Pushing/pulling via https would work in both cases.

I reverted to version 1.13.0+dev-481-gd3b5edacb, which fixed the issue for me.

@gsantner
Copy link

In my case repo is camelcase as well (myScripts).

I can see some calls of strings.ToLower( in commits, might be related to the issue?

@zeripath
Copy link
Contributor

Yeah I just noticed that. I'll have a PR up momentarily.

zeripath added a commit to zeripath/gitea that referenced this issue Aug 31, 2020
go-gitea#12624 missed lowering the provided repoPath.

(Additionally make a few fixes to the way the debug flag works.)

Fix go-gitea#12659
Fix go-gitea#12667

Signed-off-by: Andrew Thornton <art27@cantab.net>
@Tobi823
Copy link

Tobi823 commented Aug 31, 2020

@zeripath Here is my log.
I changed /data/gitea/conf/app.ini (I'm using the docker image):
RUN_MODE=dev
[log]
LEVEL = debug

The new logs when I try to push to my Git repository:

2020/08/31 16:04:46 ...s/context/context.go:332:func1() [D] Session ID: secret ;)
2020/08/31 16:04:46 ...s/context/context.go:333:func1() [D] CSRF Token: secret ;)
2020/08/31 16:04:46 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] SELECT repository.* FROM "repository" INNER JOIN "user" ON "user".id = repository.owner_id WHERE (repository.lower_name = $1) AND ("user".lower_name = $2) LIMIT 1 [java-wasi bachelorarbeit] - 4.460528ms
2020/08/31 16:04:46 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] SELECT "id", "owner_id", "name", "fingerprint", "content", "mode", "type", "login_source_id", "created_unix", "updated_unix" FROM "public_key" WHERE "id"=$1 LIMIT 1 [6] - 1.259779ms
2020/08/31 16:04:46 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] SELECT "id", "lower_name", "name", "full_name", "email", "keep_email_private", "email_notifications_preference", "passwd", "passwd_hash_algo", "must_change_password", "login_type", "login_source", "login_name", "type", "location", "website", "rands", "salt", "language", "description", "created_unix", "updated_unix", "last_login_unix", "last_repo_visibility", "max_repo_creation", "is_active", "is_admin", "is_restricted", "allow_git_hook", "allow_import_local", "allow_create_organization", "prohibit_login", "avatar", "avatar_email", "use_custom_avatar", "num_followers", "num_following", "num_stars", "num_repos", "num_teams", "num_members", "visibility", "repo_admin_change_team_access", "diff_view_style", "theme", "keep_activity_private" FROM "user" WHERE "id"=$1 LIMIT 1 [2] - 1.172674ms
2020/08/31 16:04:46 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] SELECT "id", "repo_id", "user_id", "mode" FROM "collaboration" WHERE "repo_id"=$1 AND "user_id"=$2 LIMIT 1 [47 2] - 843.441µs
2020/08/31 16:04:46 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] SELECT "id", "lower_name", "name", "full_name", "email", "keep_email_private", "email_notifications_preference", "passwd", "passwd_hash_algo", "must_change_password", "login_type", "login_source", "login_name", "type", "location", "website", "rands", "salt", "language", "description", "created_unix", "updated_unix", "last_login_unix", "last_repo_visibility", "max_repo_creation", "is_active", "is_admin", "is_restricted", "allow_git_hook", "allow_import_local", "allow_create_organization", "prohibit_login", "avatar", "avatar_email", "use_custom_avatar", "num_followers", "num_following", "num_stars", "num_repos", "num_teams", "num_members", "visibility", "repo_admin_change_team_access", "diff_view_style", "theme", "keep_activity_private" FROM "user" WHERE "id"=$1 LIMIT 1 [3] - 1.137425ms
2020/08/31 16:04:46 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] SELECT * FROM "org_user"  WHERE (uid=$1) AND (org_id=$2) LIMIT 1 [2 3] - 677.473µs
2020/08/31 16:04:46 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] SELECT "id", "repo_id", "type", "config", "created_unix" FROM "repo_unit" WHERE (repo_id = $1) [47] - 679.305µs
2020/08/31 16:04:46 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] SELECT "id", "user_id", "repo_id", "mode" FROM "access" WHERE "user_id"=$1 AND "repo_id"=$2 LIMIT 1 [2 47] - 608.421µs
2020/08/31 16:04:46 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] SELECT * FROM "team" INNER JOIN "team_user" ON team_user.team_id = team.id INNER JOIN "team_repo" ON team_repo.team_id = team.id WHERE (team.org_id = $1) AND (team_user.uid=$2) AND (team_repo.repo_id=$3) [3 2 47] - 1.189024ms
2020/08/31 16:04:46 ...ters/private/serv.go:363:ServCommand() [D] Serv Results:
        IsWiki: false
        IsDeployKey: false
        KeyID: 6        KeyName: 22.12.2019
        UserName: tobias
        UserID: 2
        OwnerName: bachelorarbeit
        RepoName: java-wasi
        RepoID: 47

docker logs gitea returns:

Accepted publickey for git from secret;) port 50314 ssh2: ED25519 SHA256:secret;)
[Macaron] 2020-08-31 16:04:46: Started GET /api/internal/serv/command/6/bachelorarbeit/java-wasi?mode=2&verb=git-receive-pack for 127.0.0.1
[Macaron] 2020-08-31 16:04:46: Completed GET /api/internal/serv/command/6/bachelorarbeit/java-wasi?mode=2&verb=git-receive-pack 200 OK in 18.168331ms
Received disconnect from secret;) port 50314:11: disconnected by user
Disconnected from user git secret;) port 50314

@zeripath
Copy link
Contributor

So I'd worked out that the shell-quote bit was not to blame as the gsanter was getting the repository back - which was confusing as hell because it was clear that #12624 had to be the cause.

It was only on looking a bit further that I noticed that I'd removed a ToLower on the repoPath. It appeared unnecessary because there was no comment attached to it to explain why it was there and all the test cases worked. I've added it back in with a comment in #12668 and fixed some problems with the debug flag too.

zeripath added a commit that referenced this issue Aug 31, 2020
#12624 missed lowering the provided repoPath.

(Additionally make a few fixes to the way the debug flag works.)

Fix #12659
Fix #12667

Signed-off-by: Andrew Thornton <art27@cantab.net>
@lunny lunny added type/bug skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. labels Sep 1, 2020
@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
skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants