git archive wrong error if repo missed #10418

Open
opened 2025-11-02 09:06:55 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @Abyss777 on GitHub (Mar 12, 2023).

Description

I'm trying to download one file via git archive with next command:

$git archive --remote=ssh://git@gitea/soho/netbackup.git HEAD devices.db -o devices.tar.gz
Gitea: Unauthorized
fatal: the remote end hung up unexpectedly

And get next strings in trace log

2023-03-12T05:56:29.754471519Z Accepted publickey for git from 10.0.3.52 port 43900 ssh2: ED25519 SHA256:tqWVM8GRPZ5Ph9meqwBJxOBbZXSEccsXRYwmxNvIlCg

2023-03-12T05:56:30.208460819Z 2023/03/12 10:56:30 ...s/process/manager.go:171:Add() [T] [640d6971-2] Start 640d698e: GET: /api/internal/serv/command/6/soho/netbackup?mode=1&verb=git-upload-archive (request)

2023-03-12T05:56:30.208804021Z 2023/03/12 10:56:30 [640d698e] router: started   GET /api/internal/serv/command/6/soho/netbackup?mode=1&verb=git-upload-archive for 10.0.3.52:0

2023-03-12T05:56:30.227586749Z 2023/03/12 10:56:30 [640d698e] router: completed GET /api/internal/serv/command/6/soho/netbackup?mode=1&verb=git-upload-archive for 10.0.3.52:0, 403 Forbidden in 18.6ms @ private/serv.go:81(private.ServCommand)

2023-03-12T05:56:30.232637184Z 2023/03/12 10:56:30 [640d698e-2] router: started   POST /api/internal/ssh/log for 10.0.3.52:0

2023-03-12T05:56:30.232759785Z 2023/03/12 10:56:30 ...s/process/manager.go:208:remove() [T] [640d698e] Done 640d698e: GET: /api/internal/serv/command/6/soho/netbackup?mode=1&verb=git-upload-archive

2023-03-12T05:56:30.232887986Z 2023/03/12 10:56:30 ...s/process/manager.go:171:Add() [T] [640d6971-2] Start 640d698e-2: POST: /api/internal/ssh/log (request)

2023-03-12T05:56:30.233459790Z 2023/03/12 10:56:30 [640d698e-2] router: completed POST /api/internal/ssh/log for 10.0.3.52:0, 200 OK in 1.0ms @ private/ssh_log.go:18(private.SSHLog)

2023-03-12T05:56:30.233654991Z 2023/03/12 10:56:30 ...s/private/ssh_log.go:27:SSHLog() [E] [640d698e-2] ssh: Push to create is not enabled for organizations.: 

2023-03-12T05:56:30.235552404Z 2023/03/12 10:56:30 ...s/process/manager.go:208:remove() [T] [640d698e-2] Done 640d698e-2: POST: /api/internal/ssh/log

2023-03-12T05:56:30.250229004Z Received disconnect from 10.0.3.52 port 43900:11: disconnected by user

2023-03-12T05:56:30.250683307Z Disconnected from user git 10.0.3.52 port 43900

The user have read access to repository, can clone it via ssh, and download any file or archive via web.

Gitea Version

1.18.5

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

ubuntu 22.04

How are you running Gitea?

docker image: gitea/gitea:1.18

Database

MySQL

Originally created by @Abyss777 on GitHub (Mar 12, 2023). ### Description I'm trying to download one file via `git archive` with next command: ```bash $git archive --remote=ssh://git@gitea/soho/netbackup.git HEAD devices.db -o devices.tar.gz Gitea: Unauthorized fatal: the remote end hung up unexpectedly ``` And get next strings in trace log ``` 2023-03-12T05:56:29.754471519Z Accepted publickey for git from 10.0.3.52 port 43900 ssh2: ED25519 SHA256:tqWVM8GRPZ5Ph9meqwBJxOBbZXSEccsXRYwmxNvIlCg 2023-03-12T05:56:30.208460819Z 2023/03/12 10:56:30 ...s/process/manager.go:171:Add() [T] [640d6971-2] Start 640d698e: GET: /api/internal/serv/command/6/soho/netbackup?mode=1&verb=git-upload-archive (request) 2023-03-12T05:56:30.208804021Z 2023/03/12 10:56:30 [640d698e] router: started GET /api/internal/serv/command/6/soho/netbackup?mode=1&verb=git-upload-archive for 10.0.3.52:0 2023-03-12T05:56:30.227586749Z 2023/03/12 10:56:30 [640d698e] router: completed GET /api/internal/serv/command/6/soho/netbackup?mode=1&verb=git-upload-archive for 10.0.3.52:0, 403 Forbidden in 18.6ms @ private/serv.go:81(private.ServCommand) 2023-03-12T05:56:30.232637184Z 2023/03/12 10:56:30 [640d698e-2] router: started POST /api/internal/ssh/log for 10.0.3.52:0 2023-03-12T05:56:30.232759785Z 2023/03/12 10:56:30 ...s/process/manager.go:208:remove() [T] [640d698e] Done 640d698e: GET: /api/internal/serv/command/6/soho/netbackup?mode=1&verb=git-upload-archive 2023-03-12T05:56:30.232887986Z 2023/03/12 10:56:30 ...s/process/manager.go:171:Add() [T] [640d6971-2] Start 640d698e-2: POST: /api/internal/ssh/log (request) 2023-03-12T05:56:30.233459790Z 2023/03/12 10:56:30 [640d698e-2] router: completed POST /api/internal/ssh/log for 10.0.3.52:0, 200 OK in 1.0ms @ private/ssh_log.go:18(private.SSHLog) 2023-03-12T05:56:30.233654991Z 2023/03/12 10:56:30 ...s/private/ssh_log.go:27:SSHLog() [E] [640d698e-2] ssh: Push to create is not enabled for organizations.: 2023-03-12T05:56:30.235552404Z 2023/03/12 10:56:30 ...s/process/manager.go:208:remove() [T] [640d698e-2] Done 640d698e-2: POST: /api/internal/ssh/log 2023-03-12T05:56:30.250229004Z Received disconnect from 10.0.3.52 port 43900:11: disconnected by user 2023-03-12T05:56:30.250683307Z Disconnected from user git 10.0.3.52 port 43900 ``` The user have read access to repository, can clone it via ssh, and download any file or archive via web. ### Gitea Version 1.18.5 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System ubuntu 22.04 ### How are you running Gitea? docker image: gitea/gitea:1.18 ### Database MySQL
GiteaMirror added the type/bug label 2025-11-02 09:06:55 -06:00
Author
Owner

@Abyss777 commented on GitHub (Mar 12, 2023):

Oh sorry, I've found my mistake. It is the misprint in repo name.
The error message is visible only in TRACE log.

But still do not understand why gitea tried to "push to create" when I used git archive
I believe the error should be 404 Not found or something.

@Abyss777 commented on GitHub (Mar 12, 2023): Oh sorry, I've found my mistake. It is the misprint in repo name. The error message is visible only in TRACE log. But still do not understand why gitea tried to "push to create" when I used `git archive` I believe the error should be `404 Not found` or something.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#10418