Opened 11 years ago
Closed 11 years ago
#11220 closed defect (worksforme)
Error: No such changeset No changeset None in the repository on Debian
Reported by: | anonymous | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | plugin/git | Version: | 1.0.1 |
Severity: | normal | Keywords: | |
Cc: | martin@… | Branch: | |
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description (last modified by )
I am trying to set up trac-git in my wheezy debian. I have set up the trac.ini with this
[trac] repository_type = git repository_dir = /var/www/repository/dzuko.git [components] tracopt.versioncontrol.git.* = enabled webadmin.* = enabled [git] cached_repository = false
and I have also changed the repository.git to 777 , and also added trac-post-receive-hook-0.12-new-commits-from-all-branches-with-logfile.py
as directed in http://trac-hacks.org/wiki/GitPlugin#post-receive hook scripts, i m on
trac-admin 1.0.1 and git version 1.7.10.4 … but i m experiencing
Error: No such changeset No changeset None in the repository
when i try to browse the repository.
Please help - proper detailed way to solve it.
Attachments (1)
Change History (16)
comment:2 by , 11 years ago
Description: | modified (diff) |
---|
comment:3 by , 11 years ago
Version: | → 1.0.1 |
---|
If your git repository has no commits, that is a correct behavior in Trac. Otherwise, git
command might exit with some errors.
Could you please apply ticket11220-debug-git-logging.diff and confirm your trac.log when visiting "Browse source"?
After the patch, the following is logging.
2013-06-30 12:42:03,969 Trac[PyGIT] DEBUG: PyGIT.Storage instance 165374508 constructed 2013-06-30 12:42:03,969 Trac[PyGIT] DEBUG: requested weak PyGIT.Storage instance 165374508 for '/home/jun66j5/tmp/empty-git' 2013-06-30 12:42:03,970 Trac[git_fs] DEBUG: disabled CachedRepository for '/home/jun66j5/tmp/empty-git' 2013-06-30 12:42:03,970 Trac[PyGIT] DEBUG: triggered rebuild of commit tree db for 165374508 2013-06-30 12:42:04,027 Trac[PyGIT] DEBUG: git exits 129, dir: u'/home/jun66j5/tmp/empty-git', args: rev-list ('--parents', '--topo-order', '--all'), stderr: 'usage: git rev-list [OPTION] <commit-id>... [ -- paths... ]\n limiting output:\n --max-count=<n>\n --max-age=<epoch>\n --min-age=<epoch>\n --sparse\n --no-merges\n --min-parents=<n>\n --no-min-parents\n --max-parents=<n>\n --no-max-parents\n --remove-empty\n --all\n --branches\n --tags\n --remotes\n --stdin\n --quiet\n ordering output:\n --topo-order\n --date-order\n --reverse\n formatting output:\n --parents\n --children\n --objects | --objects-edge\n --unpacked\n --header | --pretty\n --abbrev=<n> | --no-abbrev\n --abbrev-commit\n --left-right\n special purpose:\n --bisect\n --bisect-vars\n --bisect-all\n' 2013-06-30 12:42:04,028 Trac[PyGIT] DEBUG: rebuilt commit tree db for 165374508 with 0 entries (took 57.0 ms) 2013-06-30 12:42:04,049 Trac[PyGIT] DEBUG: git exits 128, dir: u'/home/jun66j5/tmp/empty-git', args: ls-tree ('-z', '-l', 'HEAD', '--', ''), stderr: 'fatal: Not a valid object name HEAD\n'
by , 11 years ago
Attachment: | ticket11220-debug-git-logging.diff added |
---|
Logging debug if git command exits non-zero or there is stderr output.
comment:4 by , 11 years ago
I tried to add a simple file and then tried commit, but the same stuff is shown up..
Later applied the patch in the file and ran the Browse Source
but same error message comes up. And the log shows this..
2013-07-01 08:34:05,469 Trac[main] DEBUG: Dispatching <RequestWithSession "GET '/browser'"> 2013-07-01 08:34:05,472 Trac[session] DEBUG: Retrieving session for ID 'c6251984048a058f366173dd' 2013-07-01 08:34:05,475 Trac[main] DEBUG: Negotiated locale: None -> en_US 2013-07-01 08:34:05,491 Trac[PyGIT] DEBUG: PyGIT.Storage instance 140273675404176 constructed 2013-07-01 08:34:05,491 Trac[PyGIT] DEBUG: requested weak PyGIT.Storage instance 140273675404176 for '/var/www/repository/dzuko.git' 2013-07-01 08:34:05,491 Trac[git_fs] DEBUG: disabled CachedRepository for '/var/www/repository/dzuko.git' 2013-07-01 08:34:05,498 Trac[api] INFO: Synchronized '(default)' repository in 0.03 seconds 2013-07-01 08:34:05,502 Trac[PyGIT] DEBUG: triggered rebuild of commit tree db for 140273675404176 2013-07-01 08:34:05,528 Trac[PyGIT] DEBUG: rebuilt commit tree db for 140273675404176 with 0 entries (took 26.0 ms) 2013-07-01 08:34:05,557 Trac[chrome] DEBUG: Prepare chrome data for request 2013-07-01 08:34:05,562 Trac[perm] DEBUG: No policy allowed anonymous performing TRAC_ADMIN on None 2013-07-01 08:34:05,563 Trac[perm] DEBUG: No policy allowed anonymous performing PERMISSION_GRANT on None 2013-07-01 08:34:05,563 Trac[perm] DEBUG: No policy allowed anonymous performing PERMISSION_REVOKE on None 2013-07-01 08:34:05,564 Trac[perm] DEBUG: No policy allowed anonymous performing TICKET_ADMIN on None 2013-07-01 08:34:05,564 Trac[perm] DEBUG: No policy allowed anonymous performing VERSIONCONTROL_ADMIN on None 2013-07-01 08:34:05,567 Trac[perm] DEBUG: No policy allowed anonymous performing TICKET_CREATE on None 2013-07-01 08:34:05,606 Trac[perm] DEBUG: No policy allowed anonymous performing EMAIL_VIEW on None 2013-07-01 08:34:05,794 Trac[main] WARNING: [::1] HTTPNotFound: 404 No such changeset (No changeset None in the repository) 2013-07-01 08:34:05,884 Trac[main] DEBUG: Dispatching <RequestWithSession "GET '/chrome/common/js/keyboard_nav.js'"> 2013-07-01 08:34:05,885 Trac[session] DEBUG: Retrieving session for ID 'c6251984048a058f366173dd' 2013-07-01 08:34:05,890 Trac[main] DEBUG: Dispatching <RequestWithSession "GET '/chrome/common/css/browser.css'"> 2013-07-01 08:34:05,891 Trac[session] DEBUG: Retrieving session for ID 'c6251984048a058f366173dd' 2013-07-01 08:34:05,916 Trac[main] DEBUG: Dispatching <RequestWithSession "GET '/chrome/common/js/expand_dir.js'"> 2013-07-01 08:34:05,918 Trac[session] DEBUG: Retrieving session for ID 'c6251984048a058f366173dd' 2013-07-01 08:34:05,955 Trac[main] DEBUG: Dispatching <RequestWithSession "GET '/chrome/site/your_project_logo.png'"> 2013-07-01 08:34:05,956 Trac[chrome] WARNING: File your_project_logo.png not found in any of ['/var/www/trac/htdocs'] 2013-07-01 08:34:05,956 Trac[main] WARNING: [::1] HTTPNotFound: 404 Not Found (File your_project_logo.png not found) 2013-07-01 08:34:05,956 Trac[session] DEBUG: Retrieving session for ID 'c6251984048a058f366173dd' 2013-07-01 08:34:05,958 Trac[main] DEBUG: Negotiated locale: None -> en_US 2013-07-01 08:34:05,966 Trac[chrome] DEBUG: Prepare chrome data for request 2013-07-01 08:34:05,968 Trac[PyGIT] DEBUG: PyGIT.Storage instance 140273674492816 constructed 2013-07-01 08:34:05,968 Trac[PyGIT] DEBUG: requested weak PyGIT.Storage instance 140273674492816 for '/var/www/repository/dzuko.git' 2013-07-01 08:34:05,968 Trac[git_fs] DEBUG: disabled CachedRepository for '/var/www/repository/dzuko.git' 2013-07-01 08:34:05,969 Trac[perm] DEBUG: No policy allowed anonymous performing TRAC_ADMIN on None 2013-07-01 08:34:05,969 Trac[perm] DEBUG: No policy allowed anonymous performing PERMISSION_GRANT on None 2013-07-01 08:34:05,969 Trac[perm] DEBUG: No policy allowed anonymous performing PERMISSION_REVOKE on None 2013-07-01 08:34:05,970 Trac[perm] DEBUG: No policy allowed anonymous performing TICKET_ADMIN on None 2013-07-01 08:34:05,970 Trac[perm] DEBUG: No policy allowed anonymous performing VERSIONCONTROL_ADMIN on None 2013-07-01 08:34:05,971 Trac[perm] DEBUG: No policy allowed anonymous performing TICKET_CREATE on None 2013-07-01 08:34:05,972 Trac[perm] DEBUG: No policy allowed anonymous performing EMAIL_VIEW on None
My doubt is, am i missing or need different
- Different chmod and chown setting for the trac/git folder
- Am i placing the post-commit file properly.
- I have not set any admin/user for my trac environment, could it be the problem.
sorry for the noisy log file i added.
Thanks …
follow-up: 7 comment:5 by , 11 years ago
Hi, I'm experiencing the exact same problem. Trac 1.0.1, Debian 7.1 (wheezy), git 1.7.10.4 and using Gitolite to manage repositories.
After applying the diff for extra logging I get the following in Trac log when trying to access a test repository:
2013-07-01 11:03:18,691 Trac[main] DEBUG: Dispatching <RequestWithSession "GET '/browser/testing'"> 2013-07-01 11:03:18,692 Trac[session] DEBUG: Retrieving session for ID u'mlucina' 2013-07-01 11:03:18,693 Trac[api] DEBUG: action controllers for ticket workflow: ['ConfigurableTicketWorkflow'] 2013-07-01 11:03:18,697 Trac[main] DEBUG: Negotiated locale: None -> en_US 2013-07-01 11:03:18,703 Trac[api] WARNING: Unable to find repository '(default)' for synchronization 2013-07-01 11:03:18,710 Trac[git_fs] INFO: detected GIT version 1.7.10.4 2013-07-01 11:03:18,744 Trac[svn_fs] DEBUG: Subversion bindings imported 2013-07-01 11:03:18,744 Trac[PyGIT] DEBUG: PyGIT.Storage instance 140666212624976 constructed 2013-07-01 11:03:18,744 Trac[PyGIT] DEBUG: requested weak PyGIT.Storage instance 140666212624976 for '/home/git/repositories/testing.git' 2013-07-01 11:03:18,744 Trac[git_fs] DEBUG: disabled CachedRepository for '/home/git/repositories/testing.git' 2013-07-01 11:03:18,745 Trac[PyGIT] DEBUG: triggered rebuild of commit tree db for 140666212624976 2013-07-01 11:03:18,760 Trac[PyGIT] DEBUG: git exits 128, dir: u'/home/git/repositories/testing.git', args: branch ('-v', '--no-abbrev'), stderr: 'fatal: Failed to resolve HEAD as a valid ref.\n' 2013-07-01 11:03:18,768 Trac[PyGIT] DEBUG: git exits 129, dir: u'/home/git/repositories/testing.git', args: rev-list ('--parents', '--topo-order', '--all'), stderr: 'usage: git rev-list [OPTION] <commit-id>... [ -- paths... ]\n limiting output:\n --max-count=<n>\n --max-age=<epoch>\n --min-age=<epoch>\n --sparse\n --no-merges\n --min-parents=<n>\n --no-min-parents\n --max-parents=<n>\n --no-max-parents\n --remove-empty\n --all\n --branches\n --tags\n --remotes\n --stdin\n --quiet\n ordering output:\n --topo-order\n --date-order\n --reverse\n formatting output:\n --parents\n --children\n --objects | --objects-edge\n --unpacked\n --header | --pretty\n --abbrev=<n> | --no-abbrev\n --abbrev-commit\n --left-right\n special purpose:\n --bisect\n --bisect-vars\n --bisect-all\n' 2013-07-01 11:03:18,769 Trac[PyGIT] DEBUG: rebuilt commit tree db for 140666212624976 with 0 entries (took 23.8 ms) 2013-07-01 11:03:18,778 Trac[PyGIT] DEBUG: git exits 128, dir: u'/home/git/repositories/testing.git', args: ls-tree ('-z', '-l', 'HEAD', '--', ''), stderr: 'fatal: Not a valid object name HEAD\n' 2013-07-01 11:03:18,790 Trac[chrome] DEBUG: Prepare chrome data for request 2013-07-01 11:03:18,958 Trac[main] WARNING: [10.0.1.2] HTTPNotFound: 404 No such changeset (No changeset None in the repository)
Compare the following two invocations on the machine in question:
www-data@boltian:~$ git --git-dir=/home/git/repositories/testing.git branch fatal: Failed to resolve HEAD as a valid ref.
The above corresponds to the error we are seeing in the Trac log. If I do the same thing as the git user:
git@boltian:~$ git --git-dir=/home/git/repositories/testing.git branch * master
Checking permissions (try eg. find .
) reveals that some files cannot be read by the trac user. In other words, "Failed to resolve HEAD as a valid ref." is git-speak for "Permission denied".
Following the instructions at https://github.com/boldprogressives/trac-GitolitePlugin for setting up a shared group used by both gitolite and trac fixes this problem for me.
Perhaps the Git support in trac could be improved to detect these kinds of errors and fail with a suitable hint to the user? Or at least this could be prominently documented somewhere.
comment:6 by , 11 years ago
Cc: | added |
---|
comment:7 by , 11 years ago
Replying to martin@…:
Checking permissions (try eg.
find .
) reveals that some files cannot be read by the trac user. In other words, "Failed to resolve HEAD as a valid ref." is git-speak for "Permission denied".
Great! Thanks for the investigating.
Following the instructions at https://github.com/boldprogressives/trac-GitolitePlugin for setting up a shared group used by both gitolite and trac fixes this problem for me.
Yeah, Trac must be able to directly access the git repository.
Perhaps the Git support in trac could be improved to detect these kinds of errors and fail with a suitable hint to the user? Or at least this could be prominently documented somewhere.
Good idea, I worked in [1529a510/jomae.git]. If it isn't readable a repository, log the following.
2013-07-01 19:55:41,312 Trac[git_fs] ERROR: Caught exception from PyGIT.StorageFactory Traceback (most recent call last): File "/home/jun66j5/src/trac/edgewall/github/tracopt/versioncontrol/git/git_fs.py", line 389, in __init__ git_debug=git_debug) File "/home/jun66j5/src/trac/edgewall/github/tracopt/versioncontrol/git/PyGIT.py", line 188, in __init__ git_debug=git_debug) File "/home/jun66j5/src/trac/edgewall/github/tracopt/versioncontrol/git/PyGIT.py", line 387, in __init__ % (git_dir, unicode(e))) GitError: Make sure the Git repository '/home/jun66j5/var/git/git-fast-export.dump' is readable: [Errno 13] Permission denied: u'/home/jun66j5/var/git/git-fast-export.dump/HEAD'
comment:8 by , 11 years ago
Can u guys please share me a proper steps to make my trac-git work. Using the gitolite would also do the trick, thou as of now i am not using the gitolite. Am just a trac and git newbie. Thanks for the infos.
comment:9 by , 11 years ago
Let me also try to follow the gitolite way https://github.com/boldprogressives/trac-GitolitePlugin for the time being , let me check this route too… thanks
follow-up: 11 comment:10 by , 11 years ago
Hi guys , finally my stuffs are working with gitolite and its a great experience to set it right. Thanks to u guys… just added www-data and git on a group and changed the repository to 777 and also added a user 'git' with sudo rights. Also i changed to trac :trac-admin 1.0.1.
did trac-admin /var/www/trac repository resync "*" and it worked.. :)
cheers to all..
follow-up: 12 comment:11 by , 11 years ago
Replying to anonymous:
Hi guys , finally my stuffs are working with gitolite and its a great experience to set it right. Thanks to u guys… just added www-data and git on a group and changed the repository to 777 and also added a user 'git' with sudo rights. Also i changed to trac :trac-admin 1.0.1.
did trac-admin /var/www/trac repository resync "*" and it worked.. :)
cheers to all..
sorry - :(
After reboot and I push some file to my repository and i can see this again…
Can't synchronize with repository "(default)" (No changeset f5c1909d7023448f3aee68c25cd7a193f63ea196 in the repository). Look in the Trac log for more information.
its a … … I dnt know what is happening.
follow-up: 13 comment:12 by , 11 years ago
After reboot and I push some file to my repository and i can see this again…
That is an InstallationIssue. Please ask for support on Trac usage on the MailingList or IrcChannel.
follow-up: 14 comment:13 by , 11 years ago
Replying to jomae:
After reboot and I push some file to my repository and i can see this again…
That is an InstallationIssue. Please ask for support on Trac usage on the MailingList or IrcChannel.
I realise - this steps that let to my latest prob is
- I have my repository changed to 777
- then i edited a file, committed the file and then
git push
- Then I did
sudo trac-admin /var/www/trac repository resync "*"
~ when i try to browse the source, the error comes up
- then i changed my repo to 777, and miraculously works out.
Any view on what i m missing… ?
comment:14 by , 11 years ago
Replying to anonymous:
Replying to jomae:
After reboot and I push some file to my repository and i can see this again…
That is an InstallationIssue. Please ask for support on Trac usage on the MailingList or IrcChannel.
I realise - this steps that let to my latest prob is
- I have my repository changed to 777
- then i edited a file, committed the file and then
git push
- Then I did
sudo trac-admin /var/www/trac repository resync "*"
~ when i try to browse the source, the error comes up
- then i changed my repo to 777, and miraculously works out.
Any view on what i m missing… ?
The problem is resolved, in case this could be use to ppl in trouble like me,
after using gitolite, i switched to my git user, and then vim .gitolite.rc
and changed the UMASK to 0027 ..
and it works out - thanks
comment:15 by , 11 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
missed the log when on click of the "Browse source".. updating the log also
Am i missing something…?