Git Unsupported version control system - Setting up post-receive hooks

153 views
Skip to first unread message

Ivanelson Nunes

unread,
Jun 4, 2013, 3:52:07 PM6/4/13
to trac-...@googlegroups.com
Hello,

When you
do a push to a repository "bare" installed on the same server where the Trac. Returns the message:


remote: TracError: Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled?

1. I rename this script [1] to "/my_repo/hooks/post-receive."

2. My version is Trac1.0. I need to install any package? Still need to install the trac-git?

3. In Trac browser code I can see perfectly my repository.

The problem is only integrate commits(comments) with Trac. I am also using the correct syntax for commit:

$ git commit-m "Refs #TicketNumber - foobar"


[1] http://trac-hacks.org/attachment/wiki/GitPlugin/trac-post-receive-hook-0.12-new-commits-from-all-branches-with-logfile.py



My Enviroment:

git version 1.7.10.4
Trac1.0
Ubuntu 12.10 (I am ashamed!)

trac.ini:

[components]
repository_type = git
repository_dir =
repository_sync_per_request =
ticket_changesets.* = enabled
ticketchangesets.* = enabled
tracext.git.* = enabled
tracopt.versioncontrol.git.* = enabled
ticketchangesets.commit_updater.committicketupdater = enabled
ticketchangesets.web_ui.commitmessagemacro = enabled
tracopt.ticket.commit_updater.committicketreferencemacro = enabled
tracopt.ticket.commit_updater.committicketupdater = enabled

[git]
cached_repository = false
git_bin = /usr/bin/git
git_fs_encoding = utf-8
persistent_cache = false
shortrev_len = 6
trac_user_rlookup = true
use_committer_id = true
use_committer_time = false
wiki_shortrev_len = 7

[repositories]
.alias = dbatez
dbatez.description = This is the ''main'' project dbatez.
dbatez.dir =  /var/trac/projects/repo/zap.git
dbatez.hidden = true
dbatez.type = git
dbatez.url =
zimora.description = This is the secondary library code ''Zim Oracle''.
zimora.dir = /opt/git/zimora.git
zimora.type = git
zimora.url =
 


[ticket]
commit_ticket_update_check_perms = false
commit_ticket_update_commands.close = close closed closes fix fixed fixes
commit_ticket_update_commands.refs = <ALL>
commit_ticket_update_envelope = []
commit_ticket_update_notify = true







@ivanelson
[]s

Ivanelson Nunes

unread,
Jun 4, 2013, 11:15:14 PM6/4/13
to trac-...@googlegroups.com
Another detail! Always after the command:

$ git push origin develop

An exception is raised by WikiExtrasPlugin[1].


see:

2013-06-05 00:08:21,025 Trac[loader] DEBUG: Loading tracwikiextras from /usr/local/lib/python2.7/dist-packages/TracWikiExtras-0.13.2dev_r0-py2.7.egg
2013-06-05 00:08:21,028 Trac[loader] ERROR: Skipping "tracwikiextras = tracwikiextras":
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/trac/loader.py", line 68, in _load_eggs
    entry.load(require=True)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1989, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/local/lib/python2.7/dist-packages/TracWikiExtras-0.13.2dev_r0-py2.7.egg/tracwikiextras/__init__.py", line 1, in <module>
    from boxes import AboutWikiBoxes, Boxes
  File "/usr/local/lib/python2.7/dist-packages/TracWikiExtras-0.13.2dev_r0-py2.7.egg/tracwikiextras/boxes.py", line 28, in <module>
    from tracwikiextras.icons import Icons
  File "/usr/local/lib/python2.7/dist-packages/TracWikiExtras-0.13.2dev_r0-py2.7.egg/tracwikiextras/icons.py", line 55, in <module>
    from trac.config import BoolOption, ConfigSection, IntOption, ListOption
ImportError: cannot import name ConfigSection
2013-06-05 00:08:21,028 Trac[loader] DEBUG: Loading tracwysiwyg from /usr/lib/python2.7/dist-packages
2013-06-05 00:08:21,028 Trac[loader] DEBUG: Loading userpictures from /usr/local/lib/python2.7/dist-packages/trac_UserPicturesPlugin-0.1.1-py2.7.egg
2013-06-05 00:08:21,030 Trac[loader] DEBUG: Loading wikitable.scalar from /usr/local/lib/python2.7/dist-packages/WikiTableMacro-0.2dev-py2.7.egg
2013-06-05 00:08:21,030 Trac[loader] DEBUG: Loading wikitable.table from /usr/local/lib/python2.7/dist-packages/WikiTableMacro-0.2dev-py2.7.egg
2013-06-05 00:08:21,031 Trac[loader] DEBUG: Loading file plugin __init__ from /var/trac/projects/claudino/plugins/__init__.py
2013-06-05 00:08:21,031 Trac[api] DEBUG: Event changeset_added on  for changesets (u'0e7b53935e49d50eef3e9d6945543a19dd510d8c',)
2013-06-05 00:08:21,069 Trac[svn_fs] DEBUG: Subversion bindings imported


@ivanelson
[]s


2013/6/4 Ivanelson Nunes <ivanels...@gmail.com>

Jun Omae

unread,
Jun 4, 2013, 11:35:21 PM6/4/13
to trac-...@googlegroups.com
> 2013/6/4 Ivanelson Nunes <ivanels...@gmail.com>
>> My Enviroment:
>>
>> git version 1.7.10.4
>> Trac1.0
>> Ubuntu 12.10 (I am ashamed!)

On Wed, Jun 5, 2013 at 12:15 PM, Ivanelson Nunes
<ivanels...@gmail.com> wrote:
>> Traceback (most recent call last):
>> File "/usr/lib/python2.7/dist-packages/trac/loader.py", line 68, in
>> _load_eggs
>> entry.load(require=True)

It seems that your hook script is using trac 0.12.3-1 deb package.
I think the deb should be removed.

--
Jun Omae <jun...@gmail.com> (大前 潤)

Ivanelson Nunes

unread,
Jun 5, 2013, 12:04:56 AM6/5/13
to trac-...@googlegroups.com
Jun Omae,

Fact!! It seems the problem with git will be solved. However after removal:

$ sudo apt-get purge trac

I'm getting: No handler matched request to /login

I use PermRedirectPlugin. I'll try reinstalling.

Ideas?!

Thanks
@ivanelson
[]s


2013/6/5 Jun Omae <jun...@gmail.com>
--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+...@googlegroups.com.
To post to this group, send email to trac-...@googlegroups.com.
Visit this group at http://groups.google.com/group/trac-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.



Jun Omae

unread,
Jun 5, 2013, 1:30:00 AM6/5/13
to trac-...@googlegroups.com
On Wed, Jun 5, 2013 at 1:04 PM, Ivanelson Nunes
<ivanels...@gmail.com> wrote:
> I'm getting: No handler matched request to /login
>
> I use PermRedirectPlugin. I'll try reinstalling.

On Wed, Jun 5, 2013 at 4:52 AM, Ivanelson Nunes
<ivanels...@gmail.com> wrote:
> trac.ini:
>
>> [components]
>> repository_type = git
>> repository_dir =
>> repository_sync_per_request =
>> ticket_changesets.* = enabled
>> ticketchangesets.* = enabled
>> tracext.git.* = enabled
>> tracopt.versioncontrol.git.* = enabled
>> ticketchangesets.commit_updater.committicketupdater = enabled
>> ticketchangesets.web_ui.commitmessagemacro = enabled
>> tracopt.ticket.commit_updater.committicketreferencemacro = enabled
>> tracopt.ticket.commit_updater.committicketupdater = enabled

It doesn't seem to enable PermRedirectPlugin.
See http://trac-hacks.org/wiki/PermRedirectPlugin#Usage.

Also, if any problems, please first check trac.log that gives hints
how to solve the problems.

Ivanelson Nunes

unread,
Jun 5, 2013, 8:37:03 AM6/5/13
to trac-...@googlegroups.com
Then, do not know the relationship between this and the removal of the deb package. The log now
has
:

2013-06-05 09:21:43,594 Trac [perm] DEBUG: No policy allowed anonymous performing on TICKET_CREATE None
2013-06-05 09:21:43,594 Trac [perm] DEBUG: No policy allowed anonymous performing on TIMELINE_VIEW None
2013-06-05 09:21:43,594 Trac [perm] DEBUG: No policy allowed anonymous performing WIKI_VIEW on <resource'wiki'>
2013-06-05 09:21:43,594 Trac [main] WARNING: [172.16.20.203] HTTPNotFound: 404 Not Found (No handler matched request to / login)
2013-06-05 09:21:43,595 Trac [perm] DEBUG: No policy allowed anonymous performing on EMAIL_VIEW None

@ivanelson
[]s


2013/6/5 Jun Omae <jun...@gmail.com>
On Wed, Jun 5, 2013 at 1:04 PM, Ivanelson Nunes

Ivanelson Nunes

unread,
Jun 5, 2013, 11:56:42 AM6/5/13
to trac-...@googlegroups.com
Jun Omae,

I really have 02 apps installed Trac:

ivan@dctvpsubu120012-bkp:~$ find /usr -name trac-admin
/usr/local/bin/trac-admin
/usr/bin/trac-admin
ivan@dctvpsubu120012-bkp:~$ /usr/local/bin/trac-admin --version
trac-admin 1.0
ivan@dctvpsubu120012-bkp:~$ /usr/bin/trac-admin --version
trac-admin 0.12.3


I just restore a Back-Up the VM where the Trac. I'm afraid to remove the deb package (apt-get purge) and return the error HTTPNotFound 404.

Removal or do is just create a link directing to /usr/local/bin?


@ivanelson
[]s


2013/6/5 Jun Omae <jun...@gmail.com>
On Wed, Jun 5, 2013 at 1:04 PM, Ivanelson Nunes

Ivanelson Nunes

unread,
Jun 5, 2013, 3:46:16 PM6/5/13
to trac-...@googlegroups.com
My option was to create the link and I think it solved. The script hooks is also functioning. Now I can insert comments from the commit/push.

Also noticed this exception in the log. But I do not know the impact.

2013-06-05 16:16:53,740 Trac[console] ERROR: Exception in trac-admin command:

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/Trac-1.0-py2.7.egg/trac/admin/console.py", line 108, in onecmd
    rv = cmd.Cmd.onecmd(self, line) or 0
  File "/usr/lib/python2.7/cmd.py", line 220, in onecmd
    return self.default(line)
  File "/usr/local/lib/python2.7/dist-packages/Trac-1.0-py2.7.egg/trac/admin/console.py", line 284, in default
    return cmd_mgr.execute_command(*args)
  File "/usr/local/lib/python2.7/dist-packages/Trac-1.0-py2.7.egg/trac/admin/api.py", line 124, in execute_command
    return f(*fargs)
  File "/usr/local/lib/python2.7/dist-packages/Trac-1.0-py2.7.egg/trac/versioncontrol/admin.py", line 96, in _do_changeset_added
    rm.notify('changeset_added', reponame, revs)
  File "/usr/local/lib/python2.7/dist-packages/Trac-1.0-py2.7.egg/trac/versioncontrol/api.py", line 674, in notify
    getattr(listener, event)(repos, changeset, *args)
  File "/usr/local/lib/python2.7/dist-packages/TracTicketChangesets-1.0dev_r0-py2.7.egg/ticketchangesets/commit_updater.py", line 186, in changeset_added
    tkt_changesets.add(tkt_id, repos.id, changeset.rev)
  File "/usr/local/lib/python2.7/dist-packages/TracTicketChangesets-1.0dev_r0-py2.7.egg/ticketchangesets/api.py", line 75, in add
    (rev, tkt_id))
TypeError: %d format: a number is required, not unicode


Thanks.

@ivanelson
[]s


2013/6/5 Ivanelson Nunes <ivanels...@gmail.com>
Reply all
Reply to author
Forward
0 new messages