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

New repository in Git Hosting. #774

Open
parrier82 opened this issue Sep 22, 2020 · 10 comments
Open

New repository in Git Hosting. #774

parrier82 opened this issue Sep 22, 2020 · 10 comments

Comments

@parrier82
Copy link

parrier82 commented Sep 22, 2020

In Storage Config, I can see like this.

image

Surely, It said to me repository exists in gitolite,

image

But.. I can see like this ( Repository is empty ) . What is the problem??

@parrier82
Copy link
Author

push funcsion is also working..

@pva
Copy link

pva commented Oct 24, 2020

I don't see any problem here. Could you elaborate your question/problem?

@picman
Copy link

picman commented Mar 12, 2021

I face very probably the same problem:

  1. Create an empty git repository.
  2. Clone the empty repository.
  3. Add a file, git add, commit, push.
  4. Click on the Repository tab and you see a warning message "Repository is empty"

Simply, the GUI doesn't reflect new commits in the repository, changesets aren't fetched.

@picman
Copy link

picman commented Mar 12, 2021

I've tried took a bit deeper into the problem and it seems to be related to the following code. If a new Gitolite repo is created, the variable extra_info is set to {}. After a push to the repository, this variable is not updated and therefore the show method skips calling super which fetches changesets.

Gitolitable::Validations

def empty?
    extra_info.nil? || (!extra_info.key?('heads') && !extra_info.key?('branches'))
end
      
RepositoriesControllerPatch 
   
 def show
    if @repository.is_a?(Repository::Xitolite) && @repository.empty?
          # Fake list of repos
          @repositories = @project.gitolite_repos
          render 'git_instructions'
    else
          super
     end
  end

@alexandermeindl
Copy link
Collaborator

alexandermeindl commented Mar 12, 2021

Hi @picman,

I do not have this problem with new repositories. How looks your config test on /settings/plugin/redmine_git_hosting?tab=gitolite_config_test? Are all hooks installed/green? Also check your Gitolite Hooks configuration, if this is configured right for your system configuration? If async jobs is active, Sidekiq could also be the problem.

Just for your information: the "Fetch changesets" is triggered by a gitolite hook, which is not fired in your case (as it looks). Maybe this info helps you to solve the problem.

Maybe just installing the hooks again solves your problem (press link "install hooks" at Hooks settings page)

@picman
Copy link

picman commented Mar 12, 2021

Install hooks pressed
Run hooks asynchronously is off
Sidekiq is off
I can see in gitolite log, that the update hook of the new repo is called but it's not propagated into Redmine.

@n-rodriguez
Copy link
Contributor

Check the hook URL in admin

@n-rodriguez
Copy link
Contributor

@picman
Copy link

picman commented Mar 18, 2021

The problem is that this hook is not called at all. Where is the place from where is the hook called? I've added a log message into /home/git/.gitolite/hooks/common/update and I can see that this hook is called. I've carefully gone through all logs and there is no single message related to the problem. I've switched hook debug mode too in order to see whether there is no problem in my configuration. Everything seems to be Okay:

2021-03-18 10:15:36 +0100 [INFO] User '***' has created a new repository 'redmine/general/tools/developmentplatform/c1/abc'
2021-03-18 10:15:37 +0100 [WARN] add_repository : repository 'redmine/general/tools/developmentplatform/c1/abc' does not exist in Gitolite, create it ...
2021-03-18 10:15:37 +0100 [INFO] add_repository : commiting to Gitolite...
2021-03-18 10:15:37 +0100 [WARN] No matching item found for 'redmine/general/tools/developmentplatform/c1/abc' in Recycle Bin, exiting !
2021-03-18 10:15:37 +0100 [INFO] add_repository : let Gitolite create empty repository 'repositories/redmine/general/tools/developmentplatform/c1/abc.git'
2021-03-18 10:15:40 +0100 [INFO] Execute Gitolite Plugins
2021-03-18 10:25:30 +0100 [INFO] Testing if Redmine user 'www-data' can sudo to Gitolite user 'git'...
2021-03-18 10:25:30 +0100 [INFO] OK!

@Nisargpatel16
Copy link

Nisargpatel16 commented May 14, 2022

I am facing the same problem. Any solution to this?? It will be much helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants