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

Error 500 on create new repo #7499

Closed
3 of 7 tasks
dimmuboy opened this issue Jul 17, 2019 · 37 comments
Closed
3 of 7 tasks

Error 500 on create new repo #7499

dimmuboy opened this issue Jul 17, 2019 · 37 comments
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail issue/stale

Comments

@dimmuboy
Copy link

dimmuboy commented Jul 17, 2019

  • Gitea version (or commit ref): 1.8.3/1.9.0-rc2
  • Git version: 2.2.2
  • Operating system: Windows 10
  • 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

Hello there,
on fresh new server installation I get Error 500 page after create new repo when I check Initialize Repository otherwise repo is created but can’t push any data.

Gitea log:

2019/07/17 14:17:15 .../xorm/session_get.go:99:nocacheGet() [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `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`, `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`, `diff_view_style`, `theme` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{1}
2019/07/17 14:17:15 ...s/context/context.go:315:func1() [D] Session ID: 710c45021a6c10db
2019/07/17 14:17:15 ...s/context/context.go:316:func1() [D] CSRF Token: rmybewd2agCChqY8KL-nj917umI6MTU2MzM2NTEzNDc2ODQ0NjYwMA==
2019/07/17 14:17:15 .../xorm/session_raw.go:87:queryRow() [I] [SQL] SELECT count(*) FROM `notification` WHERE (user_id = ?) AND (status = ?) []interface {}{1, 0x1}
2019/07/17 14:17:15 ...xorm/session_find.go:199:noCacheFind() [I] [SQL] SELECT * FROM `user` INNER JOIN `team_user` ON `team_user`.org_id=`user`.id INNER JOIN `team` ON `team`.id=`team_user`.team_id WHERE (`team_user`.uid=?) AND (`team`.authorize=?) ORDER BY `updated_unix` DESC, `user`.`name` ASC []interface {}{1, 4}
2019/07/17 14:17:15 ...xorm/xorm/session.go:845:saveLastSQL() [I] [SQL] BEGIN TRANSACTION
2019/07/17 14:17:15 .../xorm/session_get.go:99:nocacheGet() [I] [SQL] SELECT `id`, `owner_id`, `lower_name`, `name`, `description`, `website`, `default_branch`, `num_watches`, `num_stars`, `num_forks`, `num_issues`, `num_closed_issues`, `num_pulls`, `num_closed_pulls`, `num_milestones`, `num_closed_milestones`, `is_private`, `is_empty`, `is_archived`, `is_mirror`, `is_fork`, `fork_id`, `size`, `is_fsck_enabled`, `close_issues_via_commit_in_any_branch`, `topics`, `avatar`, `created_unix`, `updated_unix` FROM `repository` WHERE `owner_id`=? AND `lower_name`=? LIMIT 1 []interface {}{1, "test"}
2019/07/17 14:17:15 ...rm/session_insert.go:513:innerInsert() [I] [SQL] INSERT INTO `repository` (`owner_id`,`lower_name`,`name`,`description`,`website`,`default_branch`,`num_watches`,`num_stars`,`num_forks`,`num_issues`,`num_closed_issues`,`num_pulls`,`num_closed_pulls`,`num_milestones`,`num_closed_milestones`,`is_private`,`is_empty`,`is_archived`,`is_mirror`,`is_fork`,`fork_id`,`size`,`is_fsck_enabled`,`close_issues_via_commit_in_any_branch`,`topics`,`avatar`,`created_unix`,`updated_unix`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{1, "test", "test", "", "", "", 0, 0, 0, 0, 0, 0, 0, 0, 0, false, false, false, false, false, 0, 0, true, false, "null", "", 1563365835, 1563365835}
2019/07/17 14:17:15 ...rm/session_delete.go:211:Delete() [I] [SQL] DELETE FROM `repo_redirect` WHERE `owner_id`=? AND `lower_name`=? []interface {}{1, "test"}
2019/07/17 14:17:15 ...rm/session_insert.go:264:innerInsertMulti() [I] [SQL] INSERT INTO `repo_unit` (`repo_id`, `type`, `config`, `created_unix`) VALUES (?, ?, ?, ?),(?, ?, ?, ?),(?, ?, ?, ?),(?, ?, ?, ?),(?, ?, ?, ?) []interface {}{1, 1, interface {}(nil), 1563365835, 1, 2, "{\"EnableTimetracker\":true,\"AllowOnlyContributorsToTrackTime\":true,\"EnableDependencies\":true}", 1563365835, 1, 3, "{\"IgnoreWhitespaceConflicts\":false,\"AllowMerge\":true,\"AllowRebase\":true,\"AllowRebaseMerge\":true,\"AllowSquash\":true}", 1563365835, 1, 4, interface {}(nil), 1563365835, 1, 5, interface {}(nil), 1563365835}
2019/07/17 14:17:15 ...rm/session_update.go:375:Update() [I] [SQL] UPDATE `user` SET `lower_name` = ?, `name` = ?, `full_name` = ?, `email` = ?, `keep_email_private` = ?, `passwd` = ?, `must_change_password` = ?, `login_type` = ?, `login_source` = ?, `login_name` = ?, `type` = ?, `location` = ?, `website` = ?, `rands` = ?, `salt` = ?, `language` = ?, `description` = ?, `last_login_unix` = ?, `last_repo_visibility` = ?, `max_repo_creation` = ?, `is_active` = ?, `is_admin` = ?, `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` = ?, `diff_view_style` = ?, `theme` = ?, `updated_unix` = ? WHERE `id`=? []interface {}{"*****", "*****", "", "******", false, "0af4f44cca646115c9096d744e4f2e433c60aa6921c29d908f800ed18b54b2e679fb3d7a2503c42dfd8eabfcbf3e305bcff2", false, 0, 0, "", 0, "", "", "w8nGLC4LIl", "6be8WygioK", "en-US", "", 1563365134, false, -1, true, true, false, false, true, false, "fd0290e9e7ab5bcdb48fa58a11bd764e", "******", false, 0, 0, 0, 1, 0, 0, 0, "", "gitea", 1563365835, 1}
2019/07/17 14:17:15 ...xorm/session_find.go:199:noCacheFind() [I] [SQL] SELECT `id`, `repo_id`, `user_id`, `mode` FROM `collaboration` WHERE `repo_id`=? []interface {}{1}
2019/07/17 14:17:15 ...rm/session_delete.go:211:Delete() [I] [SQL] DELETE FROM `access` WHERE `repo_id`=? []interface {}{1}
2019/07/17 14:17:15 .../xorm/session_get.go:99:nocacheGet() [I] [SQL] SELECT `id`, `user_id`, `repo_id` FROM `watch` WHERE `user_id`=? AND `repo_id`=? LIMIT 1 []interface {}{1, 1}
2019/07/17 14:17:15 ...rm/session_insert.go:513:innerInsert() [I] [SQL] INSERT INTO `watch` (`user_id`,`repo_id`) VALUES (?, ?) []interface {}{1, 1}
2019/07/17 14:17:15 .../xorm/session_raw.go:226:Exec() [I] [SQL] UPDATE `repository` SET num_watches = num_watches + 1 WHERE id = ? []interface {}{1}
2019/07/17 14:17:15 ...xorm/session_find.go:199:noCacheFind() [I] [SQL] SELECT * FROM `watch` INNER JOIN `user` ON `user`.id = `watch`.user_id WHERE (`watch`.repo_id=?) AND (`user`.is_active=?) AND (`user`.prohibit_login=?) []interface {}{1, true, false}
2019/07/17 14:17:15 ...rm/session_insert.go:513:innerInsert() [I] [SQL] INSERT INTO `action` (`user_id`,`op_type`,`act_user_id`,`repo_id`,`comment_id`,`is_deleted`,`ref_name`,`is_private`,`content`,`created_unix`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{1, 1, 1, 1, 0, false, "", false, "", 1563365835}
2019/07/17 14:17:15 models/action.go:323:newRepoAction() [T] action.newRepoAction: *****/test
2019/07/17 14:17:15 ...xorm/session_find.go:199:noCacheFind() [I] [SQL] SELECT `id`, `repo_id`, `org_id`, `url`, `signature`, `http_method`, `content_type`, `secret`, `events`, `is_ssl`, `is_active`, `hook_task_type`, `meta`, `last_status`, `created_unix`, `updated_unix` FROM `webhook` WHERE (repo_id=? AND org_id=?) []interface {}{0, 0}
2019/07/17 14:17:16 ...xorm/xorm/session.go:845:saveLastSQL() [I] [SQL] ROLL BACK
2019/07/17 14:17:16 routers/repo/repo.go:148:handleCreateError() [E] CreatePost: initRepository: initRepoCommit: git push: remote: Wsh
  To C:\test\data\repos\*****\test.git
   ! [remote rejected] master -> master (pre-receive hook declined)
  error: failed to push some refs to 'C:\test\data\repos\*****\test.git'
  
2019/07/17 14:17:16 ...s/context/context.go:137:HTML() [D] Template: status/500

Gitea config:

APP_NAME = Gitea: Git with a cup of tea
RUN_USER = TestServer2
RUN_MODE = prod

[oauth2]
JWT_SECRET = 52jm4x5JosPJp6MCcWU5vcVNs1IKU8UyqtbeBGIu0P8

[security]
INTERNAL_TOKEN = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE1NjMzNjAzMjB9.tGJdvYUH5ABP7pZo4XSwdMZUhO4K7ybo2ODkcmKwHPc
INSTALL_LOCK   = true
SECRET_KEY     = 4YNgkae9KsdYPCg2SbYBdQeVNjYJxb9n3o1vbrL7lvp47alENWkqSlmLXcKPUlWo

[database]
DB_TYPE  = sqlite3
HOST     = 127.0.0.1:3306
NAME     = gitea
USER     = gitea
PASSWD   = 
SSL_MODE = disable
CHARSET  = utf8
PATH     = C:/test/data/gitea.db

[repository]
ROOT = C:/test/data/repos

[server]
SSH_DOMAIN       = localhost
DOMAIN           = localhost
HTTP_PORT        = 3000
ROOT_URL         = http://localhost:3000/
DISABLE_SSH      = false
SSH_PORT         = 22
LFS_START_SERVER = true
LFS_CONTENT_PATH = C:/test/data/lfs
LFS_JWT_SECRET   = EbD1G7qlGNDwX_Jpzyl8UEJ4FUgjSCByqwXEw7P5APU
OFFLINE_MODE     = false

[mailer]
ENABLED = false

[service]
REGISTER_EMAIL_CONFIRM            = false
ENABLE_NOTIFY_MAIL                = false
DISABLE_REGISTRATION              = false
ALLOW_ONLY_EXTERNAL_REGISTRATION  = false
ENABLE_CAPTCHA                    = false
REQUIRE_SIGNIN_VIEW               = false
DEFAULT_KEEP_EMAIL_PRIVATE        = false
DEFAULT_ALLOW_CREATE_ORGANIZATION = true
DEFAULT_ENABLE_TIMETRACKING       = true
NO_REPLY_ADDRESS                  = noreply.example.org

[picture]
DISABLE_GRAVATAR        = false
ENABLE_FEDERATED_AVATAR = true

[openid]
ENABLE_OPENID_SIGNIN = true
ENABLE_OPENID_SIGNUP = true

[session]
PROVIDER = file

[log]
MODE      = file
LEVEL     = trace
ROOT_PATH = C:/test/log
@samuelallan72
Copy link

I also am getting this issue. Gitea 1.8.3 (archlinux official package). Was working on previous versions with same config.

@dmorilha
Copy link

Same, very basic error. It already caused a very bad impression as I was just trying to migrate off of gogs...

@dmorilha
Copy link

logs read:

[root@master gitea]# Jul 18 10:35:07 master gitea[4593]: [Macaron] 2019-07-18 10:35:07: Started POST /repo/create for 127.0.0.1
Jul 18 10:35:07 master gitea[4593]: 2019/07/18 10:35:07 [...routers/repo/repo.go:169 CreatePost()] [E] initRepository: InitRepository: chdir /data/gitea/pak/app2.git: no such file or directory
Jul 18 10:35:07 master gitea[4593]: 2019/07/18 10:35:07 [...routers/repo/repo.go:146 handleCreateError()] [E] CreatePost: delete repo directory pak/app2 failed(2): unlinkat /data/gitea/pak/app2.git: read-only file system
Jul 18 10:35:07 master gitea[4593]: [Macaron] 2019-07-18 10:35:07: Completed POST /repo/create 500 Internal Server Error in 43.959367ms

@samuelallan72
Copy link

@dmorilha I get exactly the same log entries. It appears that it never creates the git repository on disk. The filesystem is definitely writable by gitea (confirmed by stat <dir> and the ability to push to existing repositories).

Same, very basic error.

While this is an annoying error, please try to avoid getting annoyed. Remember that this is a community project run by volunteers. :) The issue has been reported and confirmed by multiple users, so now we give the developers a chance to investigate and fix it.

@zeripath
Copy link
Contributor

zeripath commented Jul 19, 2019

Hi peeps.

Sorry you've been suffering this - it sounds really annoying. There might be two different issues here. How are you creating the repos? It looks like you're creating them with default initialisation files? Does the error go away if you don't set that?

@dimmuboy the log above looks like the error is hitting in finding the webhook in the pre-receive hook during initrepository. (Btw those logs are from 1.9-rc not 1.8 - does 1.8 have different logs?)

This might be an initialisation bug - but I don't understand why 1.8 would be affected. Pre-receive should probably not be being called during initialisation as it's unlikely that the repository is set up correctly - although I thought this call was delayed till the repo was correctly set up. Does the equivalent work on try?

@dmorilha your log is a bit more odd. The important bit is the chdir /data/gitea/pak/app2.git: no such file or directory You're running 1.8 not 1.9 so I'm not certain why you're suddenly getting problems like this. If possible could you please run with a higher log level and give us some more information about your configuration in particular tell me whether your repositories are actually supposed to be in /data/gitea - I suspect this is not the case.

I think in either case the place to begin looking is in InitRepository. I won't probably be able to do this until Sunday but hopefully my hint suggests the place in the code to look for the problem for another maintainer.

@samuelallan72
Copy link

samuelallan72 commented Jul 19, 2019

@zeripath

It looks like you're creating them with default initialisation files?

I wasn't, but I get a 500 error whether I check the default initialization files or not.

I get the same log output as @dmorilha and I can confirm that the directory it's mentioning is correct, and is owned by the gitea user and group. (the parent of the {reponame}.git directory that is; I haven't observed the {reponame}.git being created.)

Interestingly if I downgrade to 1.8.0 or 1.8.1, I'm still getting the 500 error and same log output. Could be same unrelated system change that is triggering it then.

@zeripath
Copy link
Contributor

@swalladge how are you running Gitea? Is this docker, systemd or something else?

@dimmuboy
Copy link
Author

dimmuboy commented Jul 19, 2019

v1.8.0, 1.8.1, 1.8.3 still same error

2019/07/19 08:42:50 [...routers/repo/repo.go:146 handleCreateError()] [E] CreatePost: initRepository: initRepoCommit: git push: remote: Wsh
To C:\test\data\repos\*****\test.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'C:\test\data\repos\*****\test.git'

@samuelallan72
Copy link

samuelallan72 commented Jul 19, 2019 via email

@dimmuboy
Copy link
Author

dimmuboy commented Jul 19, 2019

If I try to create repo without initializing it is created but after push I got error

$ git push -u script master
Enumerating objects: 21, done.
Counting objects: 100% (21/21), done.
Delta compression using up to 4 threads
Compressing objects: 100% (21/21), done.
Writing objects: 100% (21/21), 36.04 KiB | 3.00 MiB/s, done.
Total 21 (delta 3), reused 0 (delta 0)
remote: Wsh
To http://localmachine:3000/*****/test.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'http://localmachine:3000/*****/test.git'

@zeripath
Copy link
Contributor

Is your data directory mounted non exec?

That could easily be the cause of your problem.

@zeripath
Copy link
Contributor

@dimmuboy your problem seems to indicate that there is an issue with the hooks on Windows. I don't use doze - have you tried resychronizing hooks on the admin panel?

@lunny, do you have any hints for this? I suspect one of your paths is incorrect.

How are you running Gitea? Is this as a service?

@dimmuboy
Copy link
Author

@zeripath yes I tried it

@lunny
Copy link
Member

lunny commented Jul 20, 2019

@dmorilha I think your have a readonly filesystem which is why it failed.

@zeripath I have tested on Windows 7 x64 and macOS with gitea 1.9.0-rc2 binary. Both are OK.

@dimmuboy Could you test use a new repository directory, i.e. d:\gitea and ensure you have permissions to write it.

@lunny lunny added the issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail label Jul 20, 2019
@MohammedFadin
Copy link

I'm getting the same error with the exact same behaviour on Kubernetes Gitea helm chart

@dimmuboy
Copy link
Author

@dimmuboy Could you test use a new repository directory, i.e. d:\gitea and ensure you have permissions to write it.

Yes of course. This is first thing what I tried and all users have full permissions.

@dimmuboy
Copy link
Author

dimmuboy commented Jul 22, 2019

With Gogs I have totally same problem.
I tried to run as service with hostname in RUN_USER option too.

@zalaps
Copy link

zalaps commented Jul 25, 2019

Hello All,
Same error here.

Gitea version (or commit ref): 1.9.0
Git version: 2.22.0.windows.1
Operating system: Windows 10
Database: SQLite
Can you reproduce the bug at https://try.gitea.io: No
Log gist:
2019/07/25 14:35:30 routers/repo/repo.go:148:handleCreateError() [E] CreatePost: initRepository: InitRepository: exit status 128 - fatal: unable to get current working directory: No such file or directory

@xdevs23
Copy link

xdevs23 commented Aug 22, 2019

Same problem:
delete repo directory halogenOS/android_system_extras failed(2): unlinkat /mnt/bigblock/gitea/repos/halogenos/android_system_extras.git: read-only file system

Gitea version: 1.9.1
OS: Arch Linux

The filesystem is NOT read-only as pushes to other repos work and creating/deleting files using both rm and unlink works too. It's a btrfs filesystem.

EDIT: Rebooting the machine will help if you have luck. Just restarting Gitea doesn't help.
If I create/delete those directories/files manually, it works just fine so I don't think it's an issue on my side.

@holmesb
Copy link

holmesb commented Aug 26, 2019

Same here on v1.9.2 and PostgreSQL. Before first push or initialising, repo is accessible fine. Any push causes it to occur (not just initialising). File system not read-only. I've tried SSH & HTTPS, OpenID & local login and private & non-private. Restarting container\pod doesn't help.

Doesn't happen using https://try.gitea.io. Error, as others have reported, is:

[Macaron] 2019-08-26 18:04:01: Started GET /myorg/myrepo for 10.0.0.2
[Macaron] 2019-08-26 18:04:01: Completed GET /myorg/myrepo 500 Internal Server Error in 58.821377ms
[Macaron] 2019-08-26 18:06:45: Started GET /manifest.json for 10.0.0.2

What is the most recent version without this issue that we can roll back to? v1.82?

@xdevs23
Copy link

xdevs23 commented Aug 26, 2019

Rolling back doesn't help @holmesb, I tried 1.9.0 and 1.8.2. Yes, it should be safe to downgrade to 1.8.2, no obvious issues came to sight (although I upgraded again after realizing it did not help)

@xdevs23
Copy link

xdevs23 commented Aug 26, 2019

this helped me: https://docs.gitea.io/en-us/faq/#can-t-create-repositories-files

I can recall seeing it in a different github comment but I can't seem to find it now.

I added all the paths I needed by simply adding

ReadWritePaths=/path/to/git/repos

in the [Service] section accordingly and that seems to be working fine now.
If you need more than one path, just duplicate the same line over and over like this

ReadWritePaths=/path/to/git/repos
ReadWritePaths=/path/to/git/repos2
ReadWritePaths=/some/other/path

on arch the file is /usr/lib/systemd/system/gitea.service

@holmesb
Copy link

holmesb commented Aug 26, 2019

Sounds plausible @xdevs23. Must be platform\infra related if https://try.gitea.io works. But I'm using the alpine docker image. No systemd, so unsure where to put ReadWritePaths.

@xdevs23
Copy link

xdevs23 commented Aug 26, 2019

That only works if you are running Gitea as a systemd service and a ReadWritePaths= line was already there (which the Arch package does).

@samuelallan72
Copy link

samuelallan72 commented Aug 26, 2019

@xdevs23 :O I can confirm that adding the repos directory to ReadWritePaths solves the issue for me. (For reference, this is running gitea on archlinux with a custom repo directory.)

I don't know how that suddenly became an issue though - perhaps I had originally edited the main service file and then it was overwritten by an update (instead of using a service override file). It also doesn't explain why it only affects creating repositories... 🤔

@xdevs23
Copy link

xdevs23 commented Aug 27, 2019

It affects all write operations but somehow it's delayed. I was able to reboot and create repositories again, it was just a matter of minutes before it stopped working again. This can as well be related to a recent change to systemd or the kennel. Adding the ReadWritePaths definitely fixed the issue for me but it might be worth investigating.

@sapk
Copy link
Member

sapk commented Aug 27, 2019

@holmesb I think that they are multiple issue there are now in this one issue. One specific to windows, one on Archlinux (which seems solved), and yours on docker. All seems to be related to gitea not being able to read some folders for various reason. Please fire an other issue or go to the gitea discord (there is one chan specific for docker) this would help debug your specific case.

@holmesb
Copy link

holmesb commented Aug 28, 2019

Done @sapk

@zxjon22
Copy link

zxjon22 commented Sep 16, 2019

Just came across this myself - never had issues previously.

Turned out to be an incorrect HOST entry in the [mailer] section (my host had just moved mail servers for me and decommissioned the old one. The name still resolves in DNS but the server is inaccessible).

There was nothing in the logs that suggested this was the problem, there was only this:
2019/09/16 19:50:54 [...routers/repo/repo.go:146 handleCreateError()] [E] CreatePost: initRepository: InitRepository: exit status 3221225794

@bigemon
Copy link

bigemon commented Nov 9, 2019

After I upgraded my openwrt, I found that sometimes it might be related to bash/git. By tracking the log file, I found out that my problem occurred in "'bash': No such file or directory" After I installed bash correctly, this problem was ruled out.

↓↓↓↓======= my log=============

2019/11/09 14:31:01 [I] Log Mode: File(Info)
2019/11/09 14:31:01 [I] XORM Log Mode: File(Info)
2019/11/09 14:31:01 [I] Cache Service Enabled
2019/11/09 14:31:01 [I] Session Service Enabled
2019/11/09 14:31:01 [I] Beginning ORM engine initialization.
2019/11/09 14:31:01 [I] ORM engine initialization attempt #1/10...
2019/11/09 14:31:01 [I] ORM engine initialization successful!
2019/11/09 14:31:01 [I] Git Version: 2.16.3
2019/11/09 14:31:01 [I] SQLite3 Supported
2019/11/09 14:31:01 [I] Run Mode: Production
2019/11/09 14:31:02 [I] Listen: http://0.0.0.0:3000
2019/11/09 14:31:02 [I] LFS server enabled
2019/11/09 14:31:14 [...routers/repo/repo.go:146 handleCreateError()] [E] CreatePost: initRepository: initRepoCommit: git push: remote: env: can't execute 'bash': No such file or directory
To /mnt/storage/gitea/repositories/bigemon/iqiyifucker.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '/mnt/storage/gitea/repositories/bigemon/iqiyifucker.git'

@lunny
Copy link
Member

lunny commented Nov 9, 2019

You can change the SCRIPT_TYPE on app.ini.

@LipsonX
Copy link

LipsonX commented Dec 4, 2019

!!!!!
[repository]
SCRIPT_TYPE=sh
!!!!!
this save me

@pangmer
Copy link

pangmer commented Dec 29, 2019

i meet the same question,if you know how to fix it pelease call me

@pangmer
Copy link

pangmer commented Dec 29, 2019

It's strange that my log didn't report the wrong information,only web show 500 status code

@stale
Copy link

stale bot commented Feb 27, 2020

This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.

@stale stale bot added the issue/stale label Feb 27, 2020
@stale
Copy link

stale bot commented Mar 12, 2020

This issue has been automatically closed because of inactivity. You can re-open it if needed.

@stale stale bot closed this as completed Mar 12, 2020
@xpader
Copy link

xpader commented Mar 20, 2020

!!!!!
[repository]
SCRIPT_TYPE=sh
!!!!!
this save me

That fix for me.

And I see the log:
`2020/03/21 01:45:45 models/repo.go:1073:initRepoCommit() [E] Failed to push back to master: Stdout:
Error: exit status 1 - remote: env: bash: No such file or directory
To /usr/local/git/gitea-repositories/pader/testproj.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '/usr/local/git/gitea-repositories/pader/testproj.git'

2020/03/21 01:45:45 routers/repo/repo.go:159:handleCreateError() [E] CreatePost: initRepository: initRepoCommit: git push: exit status 1 - remote: env: bash: No such file or directory
To /usr/local/git/gitea-repositories/pader/testproj.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '/usr/local/git/gitea-repositories/pader/testproj.git'`

Looks like gitea can no found the bash command, and I was in FreeBSD, there's no bash..
So I changed SCRIPT_TYPE=sh, everything good.

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
@go-gitea go-gitea unlocked this conversation Apr 19, 2021
@go-gitea go-gitea locked and limited conversation to collaborators Apr 19, 2021
@go-gitea go-gitea unlocked this conversation May 5, 2021
@go-gitea go-gitea locked and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail issue/stale
Projects
None yet
Development

No branches or pull requests