Skip to content

Repositories Always Show Quick-Start Guide #2665

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
2 of 7 tasks
ghost opened this issue Oct 6, 2017 · 19 comments
Closed
2 of 7 tasks

Repositories Always Show Quick-Start Guide #2665

ghost opened this issue Oct 6, 2017 · 19 comments
Labels
type/question Issue needs no code to be fixed, only a description on how to fix it yourself.

Comments

@ghost
Copy link

ghost commented Oct 6, 2017

  • Gitea version (or commit ref): 26e49b8
  • Git version: 26e49b8 (?)
  • Operating system: Ubuntu Linux x86_64
  • 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

I'm using a dockerised gitea setup, approximately according to the normal instructions. I set up a /gitea path and I have it proxied through Caddy with the /caddy path removed (this was necessary to get Gitea to work, sadly; it doesn't like not being on the root?

Everything now seems to work OK, except that when I create a repository and push to it, the webapp continues to display the "Quick Guide" permanently. I looked in browser console; everything's loading OK. If I pull from the repo in another directory, then it's pulling the files correctly; so the SSH back-end is working fine, too. But the webapp is not able to detect the new information, it seems?

I'm wondering whether this is a backend:frontend confusion caused by my configuration. I have the ports forwarded to different numbers, so in my app.ini file, my "SSH_DOMAIN" setting is the domain name and the externally facing port, not 10022, and the DOMAIN setting is also the domain with this port appended.. I've since learned that ssh paths like domain.tld:23:user/path don't work, so nonstandard ports require a git config entry. Is it possible that Gitea is using the "SSH_DOMAIN" setting to access its own back-end by the wrong port; e.g. 23 rather than 10022?

Screenshots

Nothing looks unusual, it's just the standard Quick Guide screen for a new repo.

@lafriks lafriks added the type/question Issue needs no code to be fixed, only a description on how to fix it yourself. label Oct 6, 2017
@ghost
Copy link
Author

ghost commented Oct 10, 2017

So, exploring the codebase a little, the mistaken template rendering is happening here.

That implies that in Go-land, the repo isn't getting the same information as the repo in the clone-path.

But, Go-land was able to initialise the repository correctly so that I could push/pull it.

I'll continue by digging into the logic behind ctx.Repo.Repository.IsBare and see if I can learn more.
Meanwhile if anyone else already knows what's going on here I'd love the assist.

@ghost
Copy link
Author

ghost commented Oct 10, 2017

So, I fixed this on a single-repository basis by opening the SQLite database and manually setting the "is_bare" field to 0; the repository in question now displays correctly. But, whatever caused this issue hasn't gone away, so I won't close this issue. I've just worked around it, for now.

@lafriks
Copy link
Member

lafriks commented Oct 21, 2017

@cathalgarvey can it be that it was just cached by caddy somehow as I can not reproduce such issue

@ghost
Copy link
Author

ghost commented Oct 21, 2017 via email

@ghost
Copy link
Author

ghost commented Nov 14, 2017

Still experiencing this problem, but for others who are having this problem (like #2898) - the patch is to open the Database and run UPDATE repository SET is_bare = 0;. You're trading one problem for another, because when you do this, empty repositories will show a 500 error instead of the quickstart guide, until you make a push. But, I consider that a better situation. :)

@smaeul
Copy link

smaeul commented Jan 5, 2018

See my comment on #2898. Maybe it's the same issue, or helps you find yours.

@ghost
Copy link
Author

ghost commented Jan 5, 2018

Wow, thanks for the detailed writeup @smaeul - This could completely explain my issue, I've got my Docker volumes mounted from a USB drive that's probably noexec, and if noexec propagates into a docker volume (for security reasons, it surely would) then that would explain it!

If so, I can fix my issue.. but perhaps Gitea should have a fallback method to mark repos as "non empty" in the absence of git hooks, and perhaps even a way to detect noexec'd hooks and warn the user, if they are relevant?

@lunny
Copy link
Member

lunny commented Jan 5, 2018

@cathalgarvey maybe a PR to check if there is exec permission on the repo's hooks.

@ghost
Copy link
Author

ghost commented Jan 8, 2018

I edited my fstab to remove the noexec flag from the drive where my Docker mounts are located, and the problem is resolved, for me. Thanks @smaeul for your writeup in #2898!

@ghost ghost closed this as completed Jan 8, 2018
@James-E-A
Copy link

This issue is still present...

  • Ubuntu 18.04
  • Git 2.17.1
  • Gitea 1.6.1 and/or 1.7.0-rc2 (precomp executable binary)

On this system, ensuring the repo area was executable (it already was) did NOT fix the bug:

root@tritium:/var/storage/gitea/repositories# touch test
root@tritium:/var/storage/gitea/repositories# chmod +x test
root@tritium:/var/storage/gitea/repositories# ls -l
total 0
drwxrwxr-x 1 git  git  170 Jan 14 20:21 james
drwxrwxr-x 1 git  git   44 Dec 14 19:51 mirrors
-rwxr-xr-x 1 root root   0 Jan 14 20:52 test
root@tritium:/var/storage/gitea/repositories#

despite pushing commits to two branches, I'm still getting the quickstart guide when logged in / "This repository does not contain any content." when logged out.

@James-E-A
Copy link

And the canned command(s) for anyone else still affected, stumbling across this thread and (as was I) inexperienced with sqlite3 is:

$ service gitea stop #or whatever
$ sqlite3 "${GITEA_WORK_DIR}/data/gitea.db" #or wherever gitea.db lies
sqlite> SELECT * FROM repository ;
-- FAR-LEFT COLUMN OF THE REPO IS THE ID
-- REPLACE 12345 WITH YOUR ID:
sqlite> UPDATE repository SET is_bare = 0 WHERE id = 12345 ;
sqlite> <<Ctrl-D or other EOF>>
$ service gitea start

@nandoflorestan
Copy link

A heads up for other people reading this:

I am running gitea 1.9.1 and by now the is_bare column no longer exists in the repository table, but you know what? The column is_empty exists and setting it to 0 achieves the same as before.

@vladtcvs
Copy link

Still present.
Postgresql, gitea 1.9.5, git 2.24.0

@zeripath
Copy link
Contributor

@vladtcvs What do you mean it is still present?

@Flameborn
Copy link

The issue is still present here as well, via Gitea 1.9.5.

I am running on Arch linux Arm via a custom-compiled Go binary (not dockerized).

I created a fresh repo, and chose to not initialize it. When pushing to it, Gitea still displays the quick guide, despite a few pushes, and I am not seeing files via the web UI.

@guillep2k
Copy link
Member

@Flameborn Your problem may be due to a different cause than that of this issue. It's most probably a configuration problem, but if it isn't please try opening a new issue describing your setup. Some things to check for:

  • Make sure to re-initialize all pre-receive, etc git hooks (there's an option in the admin menu for that).
  • Make sure to re-initialize the authorized_keys file (there's also an option in the admin menu for that).

@Flameborn
Copy link

Flameborn commented Nov 17, 2019 via email

@zeripath
Copy link
Contributor

@Flameborn how are you pushing to these repos?

Are you pushing locally direct to their file path and not through Gitea? If so that's your problem - that is not supported and finally in 1.11 it will tell you that.

If not are your repositories on a non exec partition? Because then hooks would not run and Gitea would have no way of knowing that the data had changed. (Well it could if it read the repo but, that's the architecture we have...) Again putting Gitea repos on non exec partitions is not supported. (Although I do have some ideas about how this could be done.)

@Flameborn
Copy link

@guillep2k I have updated to the Arm build of Gitea v1.10.0, unfortunately the issue still persists after running the suggested maintenance tasks.
I temporarily managed to modify the database to make the is_empty field zero, however, this results in other issues (see below). I am not storing Gitea data on a noexec partition. First, I used an SD card and stored the repos on root, then I moved the repos directory to a USB hard drive, changing the repo path respectively in the config file.

I am not sure if this is a configuration issue, but I am happy to raise a new one, if this helps, to not clutter up this one.

@zeripath No, I am pushing via HTTPS, using Gitea's suggested URL for the repo. I discovered since then that web hooks do not seem to work, either, they do not seem to fire on a push event. They work flawlessly when I hit the test button. This is via Caddy and the Git plugin, running on a different server.

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
This issue was closed.
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
type/question Issue needs no code to be fixed, only a description on how to fix it yourself.
Projects
None yet
Development

No branches or pull requests

9 participants