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

Push error #2270

Closed
SemikolonDEV opened this issue Aug 6, 2017 · 10 comments
Closed

Push error #2270

SemikolonDEV opened this issue Aug 6, 2017 · 10 comments
Labels

Comments

@SemikolonDEV
Copy link

@SemikolonDEV SemikolonDEV commented Aug 6, 2017

  • Gitea version (or commit ref): 1.1.2
  • Git version: 2.7.4
  • Operating system: 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

Description

I would pushed to my Repo at the Gitea Server and became this error:

Counting objects: 4, done. Delta compression using up to 4 threads. Compressing objects: 100% (4/4), done. Writing objects: 100% (4/4), 374 bytes | 0 bytes/s, done. Total 4 (delta 2), reused 0 (delta 0) remote: ./hooks/pre-receive.d/gitea: line 2: /opt/gitea/gitea-1.1.2-linux-arm-7: No such file or directory To https://git.tysox.de/Semikolon/PasswordTyper.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.tysox.de/Semikolon/PasswordTyper.git'

@lafriks

This comment has been minimized.

Copy link
Member

@lafriks lafriks commented Aug 6, 2017

If you have changed gitea binary name or location you need to call rewrite hooks from admin dashboard page

@andy0130tw

This comment has been minimized.

Copy link

@andy0130tw andy0130tw commented Aug 7, 2017

Having exactly the same issue above, when installing the latest docker image backed with SQLite as database, the push never succeeds.

Steps to reproduce:

  1. Create a repository via the web interface
  2. Clone it through HTTPS
  3. Make a commit
  4. Push and fail with error message "error: failed to push some refs to ..."

The log file /data/log/hooks/pre-receive is as follows:

2017/08/07 19:49:18 [T] GetProtectedBranchBy: http://localhost:10080/api/internal/branch/1/master
2017/08/07 19:49:18 [...io/gitea/cmd/hook.go:126 runHookPreReceive()] [F] retrieve protected branches information failed

Strangely, adding files via the web interface does not trigger the error.

@lafriks

This comment has been minimized.

Copy link
Member

@lafriks lafriks commented Aug 7, 2017

@andy0130tw can you check if your app.ini has secret token value set?

@andy0130tw

This comment has been minimized.

Copy link

@andy0130tw andy0130tw commented Aug 8, 2017

The file seems to be populated upon the install completes. Below is the [security] section on my server, where [...] is omitted for brevity.

[security]
INTERNAL_TOKEN = eyJhb [...] 5a_kk
INSTALL_LOCK   = true
SECRET_KEY     = HL [...] zb
@exap

This comment has been minimized.

Copy link

@exap exap commented Aug 28, 2017

I had this issue too.

I temporarily fixed it by setting this in app.ini:

LOCAL_ROOT_URL  = http://localhost:3000/
@RickZeeland

This comment has been minimized.

Copy link

@RickZeeland RickZeeland commented Nov 30, 2017

Although the answer by lafriks is probably the correct one:

to call rewrite hooks from admin dashboard

I solved the problem by renaming the Gitea exe to the old name after an update from 1.2.0-RC1 to 1.2.0 on Windows 10.

@canyugs

This comment has been minimized.

Copy link

@canyugs canyugs commented Dec 14, 2017

remote: ./hooks/pre-receive.d/gitea: line 2: /app/gitea/gitea: No such file or directory

Same issue, but solved by the answer from lafriks

In admin dashboard you should see something like this and Run it

Resync pre-receive, update and post-receive hooks of all repositories.

@lafriks

This comment has been minimized.

Copy link
Member

@lafriks lafriks commented Dec 14, 2017

Closing this issue as answered

@lafriks lafriks closed this Dec 14, 2017
@luusl

This comment has been minimized.

Copy link

@luusl luusl commented Feb 12, 2018

I had the same error with the default setting for LOCAL_ROOT_URL = %(PROTOCOL)s://%(HTTP_ADDR)s:%(HTTP_PORT)s/, using a unix socket.

2018/02/12 10:26:45 [T] GetProtectedBranchBy: unix:///var/run/gitea/gitea.sock:3000/api/internal/branch/1/master
2018/02/12 10:26:45 [...io/gitea/cmd/hook.go:115 runHookPreReceive()] [F] retrieve protected branches information failed

After changing this to LOCAL_ROOT_URL = http://localhost:3000/ it worked.

@randyesq

This comment has been minimized.

Copy link

@randyesq randyesq commented May 21, 2019

Changing LOCAL_ROOT_URL = http://localhost:3000/ did not work for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
8 participants
You can’t perform that action at this time.