Mailing List Archive

'GitRepository' object has no attribute 'db_rev
Hi,
recently I get this error when selecting a source changeset:


Trac detected an internal error:
AttributeError: 'GitRepository' object has no attribute 'db_rev'

Most recent call last:

File "/usr/lib64/python2.7/site-packages/trac/web/main.py", line 554, in
_dispatch_request
dispatcher.dispatch(req)
File "/usr/lib64/python2.7/site-packages/trac/web/main.py", line 257, in
dispatch
self._post_process_request(req, *resp)
File "/usr/lib64/python2.7/site-packages/trac/web/main.py", line 388, in
_post_process_request
resp = f.post_process_request(req, *resp)
File "build/bdist.linux-x86_64/egg/coderev/web_ui.py", line 81, in
post_process_request
reponame, rev = repos.reponame, repos.db_rev(changeset.rev)



The source browser is ok and the git log on the repositories is working.
I have no idea what is causing this issue, and hints?

Best regards,
Mo

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.
Re: 'GitRepository' object has no attribute 'db_rev [ In reply to ]
Hi,

On 04.01.2017 17:04, Mo wrote:
> Hi,
> recently I get this error when selecting a source changeset:
>
>
> |
> Tracdetected an internalerror:
> AttributeError:'GitRepository'objecthas noattribute 'db_rev'
>
> Mostrecent call last:
>
> File"/usr/lib64/python2.7/site-packages/trac/web/main.py",line
> 554,in_dispatch_request
> dispatcher.dispatch(req)
> File"/usr/lib64/python2.7/site-packages/trac/web/main.py",line
> 257,indispatch
> self._post_process_request(req,*resp)
> File"/usr/lib64/python2.7/site-packages/trac/web/main.py",line
> 388,in_post_process_request
> resp =f.post_process_request(req,*resp)
> File"build/bdist.linux-x86_64/egg/coderev/web_ui.py",line
> 81,inpost_process_request
> reponame,rev =repos.reponame,repos.db_rev(changeset.rev)
> |
|Looks like the error occurred here:
https://trac-hacks.org/browser/codereviewerplugin/1.0/coderev/web_ui.py#L81
in the CodeReviewerPlugin. https://trac-hacks.org/wiki/CodeReviewerPlugin
|||You might want to open a ticket there.

|That plugin might be incompatible with uncached Git repositories. It
assumes |
||GitRepository.db_rev() exists, but it doesn't. db_rev() exists on
||||CachedRepositorysubclasses, where changesets are cached in the
database.
https://trac.edgewall.org/browser/trunk/trac/versioncontrol/cache.py#L461

You could try using caching for Git:
[||||git] cached_repository = true
You might have to setup hooks. https://trac.edgewall.org/wiki/TracGit#hooks
||||
Best regards,
Peter

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.
Re: 'GitRepository' object has no attribute 'db_rev [ In reply to ]
Hi,

https://trac.edgewall.org/wiki/TracGit#Troubleshooting
even says to disable caching. I have a bare repo as it takes less space.
Didn't care about the caching so far, I just updated all my plugins like
CodeReviewerPlugin, must be some bug introduced since my last version. I
filed the bug here: https://trac-hacks.org/ticket/13029#ticket

Best regards,
Mo

Am Mittwoch, 4. Januar 2017 19:09:17 UTC+1 schrieb Peter Suter:
>
> Hi,Looks like the error occurred here:
> https://trac-hacks.org/browser/codereviewerplugin/1.0/coderev/web_ui.py#L81
> in the CodeReviewerPlugin. https://trac-hacks.org/wiki/CodeReviewerPlugin
> You might want to open a ticket there.
>
> That plugin might be incompatible with uncached Git repositories. It
> assumes
> GitRepository.db_rev() exists, but it doesn't. db_rev() exists on
> CachedRepository subclasses, where changesets are cached in the database.
> https://trac.edgewall.org/browser/trunk/trac/versioncontrol/cache.py#L461
>
> You could try using caching for Git:
> [git] cached_repository = true
> You might have to setup hooks.
> https://trac.edgewall.org/wiki/TracGit#hooks
>
> Best regards,
> Peter
>

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.
Re: 'GitRepository' object has no attribute 'db_rev [ In reply to ]
On Thursday, January 5, 2017 at 8:24:39 AM UTC-5, Mo wrote:
>
> Hi,
>
> https://trac.edgewall.org/wiki/TracGit#Troubleshooting
> even says to disable caching. I have a bare repo as it takes less space.
> Didn't care about the caching so far, I just updated all my plugins like
> CodeReviewerPlugin, must be some bug introduced since my last version. I
> filed the bug here: https://trac-hacks.org/ticket/13029#ticket
>
> Best regards,
> Mo
>

You'll need to enable repository caching to use the plugin.

Prior to r16165 you wouldn't see the error, however the plugin wasn't
working correctly. The plugin needs the tables created by a cached
repository to exist.

Peter, do you know if this recommendation is still valid?:

- If you don't see the shortrev and commit branch, you probably have
caching enabled (cached_repository = true, persistent_cache = true). Set
those to false.

- Ryan



--
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+unsubscribe@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.
Re: 'GitRepository' object has no attribute 'db_rev [ In reply to ]
On 05.01.2017 14:39, RjOllos wrote:
>
> Peter, do you know if this recommendation is still valid?:
>
> * If you don't see the |shortrev| and |commit| branch, you probably
> have caching enabled (|cached_repository = true|,
> |persistent_cache = true|). Set those to false.
>

Honestly I have no idea. I added this recommendation in version 1 of the
TracGit wiki page [1] when the Git plugin was being integrated into
Trac, by copying seemingly relevant text from the th:GitPlugin wiki page
[2]. There it was added by someone else [3] and I'm not sure what
problem it's referring to, maybe just a common installation problem
where the hooks are missing or misconfigured? Feel free to remove that
line if the caching support is robust and "the way to go" now. I can't
really say either way as I don't use Git that much myself.

[1] https://trac.edgewall.org/wiki/TracGit#Troubleshooting
[2] https://trac-hacks.org/wiki/GitPlugin#Troubleshooting
[3]
https://trac-hacks.org/wiki/GitPlugin?sfp_email=&sfph_mail=&action=diff&version=69&old_version=68&sfp_email=&sfph_mail=


Peter

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.
Re: 'GitRepository' object has no attribute 'db_rev [ In reply to ]
On Thursday, January 5, 2017 at 10:07:27 AM UTC-8, Peter Suter wrote:
>
> On 05.01.2017 14:39, RjOllos wrote:
>
>
> Peter, do you know if this recommendation is still valid?:
>
> - If you don't see the shortrev and commit branch, you probably have
> caching enabled (cached_repository = true, persistent_cache = true).
> Set those to false.
>
>
> Honestly I have no idea. I added this recommendation in version 1 of the
> TracGit wiki page [1] when the Git plugin was being integrated into Trac,
> by copying seemingly relevant text from the th:GitPlugin wiki page [2].
> There it was added by someone else [3] and I'm not sure what problem it's
> referring to, maybe just a common installation problem where the hooks are
> missing or misconfigured? Feel free to remove that line if the caching
> support is robust and "the way to go" now. I can't really say either way as
> I don't use Git that much myself.
>
> [1] https://trac.edgewall.org/wiki/TracGit#Troubleshooting
> [2] https://trac-hacks.org/wiki/GitPlugin#Troubleshooting
> [3]
> https://trac-hacks.org/wiki/GitPlugin?sfp_email=&sfph_mail=&action=diff&version=69&old_version=68&sfp_email=&sfph_mail=
>
>
> Peter
>

I went ahead and removed that. We can add it back if it becomes a known
issue.
https://trac.edgewall.org/wiki/TracGit?action=diff&version=25

- Ryan

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.
Re: 'GitRepository' object has no attribute 'db_rev [ In reply to ]
On Friday, February 10, 2017 at 9:55:25 PM UTC-8 RjOllos wrote:

>
>
> On Thursday, January 5, 2017 at 10:07:27 AM UTC-8, Peter Suter wrote:
>>
>> On 05.01.2017 14:39, RjOllos wrote:
>>
>>
>> Peter, do you know if this recommendation is still valid?:
>>
>> - If you don't see the shortrev and commit branch, you probably have
>> caching enabled (cached_repository = true, persistent_cache = true).
>> Set those to false.
>>
>>
>> Honestly I have no idea. I added this recommendation in version 1 of the
>> TracGit wiki page [1] when the Git plugin was being integrated into Trac,
>> by copying seemingly relevant text from the th:GitPlugin wiki page [2].
>> There it was added by someone else [3] and I'm not sure what problem it's
>> referring to, maybe just a common installation problem where the hooks are
>> missing or misconfigured? Feel free to remove that line if the caching
>> support is robust and "the way to go" now. I can't really say either way as
>> I don't use Git that much myself.
>>
>> [1] https://trac.edgewall.org/wiki/TracGit#Troubleshooting
>> [2] https://trac-hacks.org/wiki/GitPlugin#Troubleshooting
>> [3]
>> https://trac-hacks.org/wiki/GitPlugin?sfp_email=&sfph_mail=&action=diff&version=69&old_version=68&sfp_email=&sfph_mail=
>>
>>
>> Peter
>>
>
> I went ahead and removed that. We can add it back if it becomes a known
> issue.
> https://trac.edgewall.org/wiki/TracGit?action=diff&version=25
>
> - Ryan
>

Is explicit synchronization needed to use the persistent cache? I was
looking at a Trac config that I didn't setup and it had:

[git]
cached_repository = false
persistent_cache = true

and no explicit synchronization. Recent commits were not being shown until
I disabled persistent_cache.

Ryan

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/a102e847-a656-44aa-8273-1efd34b0bef1n%40googlegroups.com.
Re: 'GitRepository' object has no attribute 'db_rev [ In reply to ]
On Wednesday, May 19, 2021 at 12:47:21 PM UTC-7 RjOllos wrote:

> Is explicit synchronization needed to use the persistent cache?
>

Looks like explicit synchronization or sync_per_request is needed otherwise
the cache won't be refreshed after a commit:
https://trac.edgewall.org/browser/tags/trac-1.4.3/tracopt/versioncontrol/git/git_fs.py?marks=676,677#L672

Ryan

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/37ef8633-50e9-4d49-b285-b9056394629fn%40googlegroups.com.