#12960 closed defect (fixed)
Age column displaying "48 years" after upgrading to 1.2.2 + Empty Author, Last change & Log Message
| Reported by: | Owned by: | Jun Omae | |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.0.17 |
| Component: | version control/browser | Version: | 1.2.2 |
| Severity: | normal | Keywords: | svn needinfo |
| Cc: | Branch: | ||
| Release Notes: |
Add debug-logging when |
||
| API Changes: | |||
| Internal Changes: | |||
Description (last modified by )
Hello,
We recently changed our development server, and upgraded from 0.12.2 to 1.2.2.
But now, for all our files and directories, the "Age" column shows "48 years" (it thinks that the file/directly was last modified on 1970-01-01), the "Author" and the "Last change" column are empty (see attached screenshot). Same for the "Log Message".
The subversion directory didn't change at all.
Attachments (5)
Change History (28)
by , 8 years ago
| Attachment: | Trac after update.jpg added |
|---|
comment:1 by , 8 years ago
| Description: | modified (diff) |
|---|---|
| Summary: | Age column displaying "48 years" after upgrading to 1.2.2 + Empty Author & Last change → Age column displaying "48 years" after upgrading to 1.2.2 + Empty Author, Last change & Log Message |
comment:2 by , 8 years ago
| Component: | general → version control/browser |
|---|---|
| Keywords: | svn added |
comment:3 by , 8 years ago
Also, please post current and before-upgrading System Information in About page of your Trac.
by , 8 years ago
by , 8 years ago
| Attachment: | About Trac – Before update.htm added |
|---|
by , 8 years ago
| Attachment: | About Trac – After update.htm added |
|---|
comment:4 by , 8 years ago
Hello Jun,
Thank you very much for your message and for your help. Please find attached all the things you asked for. Let me know if you need anything else.
Thank you and have a nice day,
comment:5 by , 8 years ago
Thanks for the feedback.
According to the upload files, Subversion 1.9.5 on Ubuntu zesty is used and the following is logged.
2017-12-01 11:43:35,256 Trac[util] WARNING: Unable to get changeset [39468]
It seems that Trac is unable to read revision properties from the repository.
Could you please verify using svnadmin verify command with the repository?
$ sudo -u www-data svnadmin verify /path/to/repos/dreamzer
comment:6 by , 8 years ago
Hi Jun,
I had already made a svnadmin verify and it went all fine. I've just done it again and it was exactly the same.
comment:7 by , 8 years ago
I would try running resync on the repository (TracAdmin):
$ trac-admin $env repository resync "dreamzer"
where $env is the path to the Trac environment.
$ trac-admin $env help repository resync repository resync <repos> [rev] Re-synchronize trac with repositories When [rev] is specified, only that revision is synchronized. Otherwise, the complete revision history is synchronized. Note that this operation can take a long time to complete. If synchronization gets interrupted, it can be resumed later using the `sync` command. To synchronize all repositories, specify "*" as the repository.
comment:8 by , 8 years ago
Thinking another possibilities, metadata in repository table might be broken.
Please post result of the following query in your trac.db:
SELECT * FROM repository ORDER BY id, name;
Currently, nothing about the reason is logged when invalid revision is given to get_changeset(). I think it is good to add logging when NoSuchChangeset is raised to investigate such a situation:
Proposed changes for 1.0-stable:
-
trac/versioncontrol/web_ui/util.py
diff --git a/trac/versioncontrol/web_ui/util.py b/trac/versioncontrol/web_ui/util.py index 5eac6c3e1..44573f6e1 100644
a b def get_changes(repos, revs, log=None): 44 44 changeset = Changeset(repos, rev, '', '', 45 45 datetime(1970, 1, 1, tzinfo=utc)) 46 46 if log is not None: 47 log.warning("Unable to get changeset [%s]", rev) 47 log.warning("Unable to get changeset [%s] in %s", rev, 48 repos.reponame or '(default)') 48 49 changes[rev] = changeset 49 50 return changes 50 51 -
tracopt/versioncontrol/svn/svn_fs.py
diff --git a/tracopt/versioncontrol/svn/svn_fs.py b/tracopt/versioncontrol/svn/svn_fs.py index 385d39299..6b0ae405a 100644
a b class SubversionRepository(Repository): 431 431 return self.youngest_rev 432 432 else: 433 433 try: 434 rev = int(rev) 435 if 0 <= rev <= self.youngest_rev: 436 return rev 437 except (ValueError, TypeError): 438 pass 434 normrev = int(rev) 435 if 0 <= normrev <= self.youngest_rev: 436 return normrev 437 else: 438 self.log.debug("%r cannot be normalized in %s: out of [0, " 439 "%r]", rev, self.reponame or '(default)', 440 self.youngest_rev) 441 except (ValueError, TypeError), e: 442 self.log.debug("%r cannot be normalized in %s: %s", rev, 443 self.reponame or '(default)', 444 exception_to_unicode(e)) 439 445 raise NoSuchChangeset(rev) 440 446 441 447 def close(self): … … class SubversionNode(Node): 967 973 class SubversionChangeset(Changeset): 968 974 969 975 def __init__(self, repos, rev, scope, pool=None): 976 self.log = repos.log 970 977 self.rev = rev 971 978 self.scope = scope 972 979 self.fs_ptr = repos.fs_ptr … … class SubversionChangeset(Changeset): 1093 1100 yield tuple(change) 1094 1101 1095 1102 def _get_prop(self, name): 1096 return fs.revision_prop(self.fs_ptr, self.rev, name, self.pool()) 1103 try: 1104 return fs.revision_prop(self.fs_ptr, self.rev, name, self.pool()) 1105 except core.SubversionException, e: 1106 self.log.debug("%r of the %r cannot be retrieved", name, self.rev) 1107 raise 1097 1108 1098 1109 1099 1110 #
After the patch:
>>> env = Environment('/var/trac/1.0-sqlite')
>>> repos = rm.get_repository('trac.svn')
>>> repos.get_changeset(-1)
2017-12-05 12:25:00,654 Trac[svn_fs] DEBUG: -1 cannot be normalized in trac.svn: out of [0, 16103L]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/src/tracdev/git/trac/versioncontrol/cache.py", line 70, in get_changeset
return CachedChangeset(self, self.normalize_rev(rev), self.env)
File "/src/tracdev/git/tracopt/versioncontrol/svn/svn_fs.py", line 262, in normalize_rev
return self.repos.normalize_rev(rev)
File "/src/tracdev/git/tracopt/versioncontrol/svn/svn_fs.py", line 445, in normalize_rev
raise NoSuchChangeset(rev)
trac.versioncontrol.api.NoSuchChangeset: No changeset -1 in the repository
>>> repos.get_changeset('aaa')
2017-12-05 12:25:20,160 Trac[svn_fs] DEBUG: 'aaa' cannot be normalized in trac.svn: ValueError: invalid literal for int() with base 10: 'aaa'
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/src/tracdev/git/trac/versioncontrol/cache.py", line 70, in get_changeset
return CachedChangeset(self, self.normalize_rev(rev), self.env)
File "/src/tracdev/git/tracopt/versioncontrol/svn/svn_fs.py", line 262, in normalize_rev
return self.repos.normalize_rev(rev)
File "/src/tracdev/git/tracopt/versioncontrol/svn/svn_fs.py", line 445, in normalize_rev
raise NoSuchChangeset(rev)
trac.versioncontrol.api.NoSuchChangeset: No changeset aaa in the repository
>>> direct_repos = repos.repos
>>> SubversionChangeset(direct_repos, 999999, direct_repos.pool)
2017-12-05 12:28:10,102 Trac[svn_fs] DEBUG: 'svn:log' of the 999999 cannot be retrieved
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/src/tracdev/git/tracopt/versioncontrol/svn/svn_fs.py", line 984, in __init__
raise NoSuchChangeset(rev)
trac.versioncontrol.api.NoSuchChangeset: No changeset 999999 in the repository
comment:9 by , 8 years ago
Hi Jun,
The repository resync worked perfectly well. I couldn't be happier, thank you very much for your help!
Maybe this could be added to the Troubleshooting part of the documentation, in case other people ever have the same problem.
Once again, I'm sending you 1,000 thank you. Have a nice day!
comment:11 by , 8 years ago
| Milestone: | → 1.0.17 |
|---|---|
| Owner: | set to |
| Status: | new → assigned |
Thanks. I'm going to commit the additional logging.
comment:12 by , 8 years ago
| Release Notes: | modified (diff) |
|---|---|
| Resolution: | → worksforme |
| Status: | assigned → closed |
Commtted in [16397] and merged in [16398,16399].
Closing this ticket but feel free to reopen it or create new ticket if anyone can reproduce the issue.
follow-up: 14 comment:13 by , 8 years ago
OSX test failures on Travis CI. Surely unrelated to r16397, but first seen with the associated test run:
...
1.63s$ rvm get head
Downloading https://get.rvm.io
Downloading https://raw.githubusercontent.com/rvm/rvm/master/binscripts/rvm-installer.asc
Verifying /Users/travis/.rvm/archives/rvm-installer.asc
gpg: Signature made Sat Sep 9 19:49:18 2017 GMT
gpg: using RSA key E206C29FBF04FF17
gpg: Can't check signature: No public key
Warning, RVM 1.26.0 introduces signed releases and automated check of signatures when GPG software found.
Assuming you trust Michal Papis import the mpapis public key (downloading the signatures).
GPG signature verification failed for '/Users/travis/.rvm/archives/rvm-installer' - 'https://raw.githubusercontent.com/rvm/rvm/master/binscripts/rvm-installer.asc'!
try downloading the signatures:
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
or if it fails:
command curl -sSL https://rvm.io/mpapis.asc | gpg --import -
the key can be compared with:
https://rvm.io/mpapis.asc
https://keybase.io/mpapis
/Users/travis/.rvm/scripts/functions/cli: line 243: return: _ret: numeric argument required
The command "rvm get head" failed and exited with 255 during .
Your build has been stopped.
/Users/travis/.travis/job_stages: line 166: shell_session_update: command not found
follow-up: 19 comment:14 by , 8 years ago
Replying to Ryan J Ollos:
OSX test failures on Travis CI. Surely unrelated to r16397, but first seen with the associated test run:
In [16400], removed rvm get head for workaround to prevent shell_session_update error. Currently, it seems the command is not needed.
follow-up: 17 comment:15 by , 8 years ago
Hello Jun,
I'm sorry to reopen this quite late, I was working on something else these last months.
The repository resync worked perfectly well. Yet, whenever I successfully make a commit (there is no error message & I can see a new file was created in the /revs subdirectory), it won't show up in the "Browse sources" and "Timeline". They remain stuck to the last revision dating back to the repository resync.
In other words, whenever I make a commit, I need to launch a repository resync to make it appear in "Browse sources" and "Timeline". Which is obviously very time consuming.
Do you know how to avoid this?
Thank you for your valuable help, and have a nice day!
comment:16 by , 8 years ago
| Resolution: | worksforme |
|---|---|
| Status: | closed → reopened |
comment:17 by , 8 years ago
Replying to anonymous:
The repository resync worked perfectly well. Yet, whenever I successfully make a commit (there is no error message & I can see a new file was created in the /revs subdirectory), it won't show up in the "Browse sources" and "Timeline". They remain stuck to the last revision dating back to the repository resync.
In other words, whenever I make a commit, I need to launch a repository resync to make it appear in "Browse sources" and "Timeline". Which is obviously very time consuming.
Do you know how to avoid this?
If you're using explicit synchronization, it doesn't seem that trac-admin $ENV changeset added REPONAME REV works. Please check your post-commit hook in the repository.
If you're using per-request synchronization, it seems upgrade steps from 0.12 to 1.2 break the settings. Please post [repositories] section in your trac.ini and repository table in your trac.db.
comment:18 by , 8 years ago
| Keywords: | needinfo added |
|---|
comment:19 by , 8 years ago
Replying to Jun Omae:
In [16400], removed
rvm get headfor workaround to preventshell_session_updateerror. Currently, it seems the command is not needed.
The final line of output from OSX builds is:
/Users/travis/.travis/job_stages: line 166: shell_session_update: command not found
But it seems to be harmless.
comment:20 by , 8 years ago
| Resolution: | → fixed |
|---|---|
| Status: | reopened → closed |
Closing since there has been no reply for 2 months.
comment:21 by , 7 years ago
Replaced except E, e with except E as e in [16608-16609] on 1.2-stable and trunk.
by , 7 years ago
| Attachment: | trac-svn-hook added |
|---|
follow-up: 24 comment:23 by , 7 years ago
Replying to Jun Omae:
Hello Jun,
Thank you for your message, and sorry for the late reply.
I use explicit synchronization indeed, but I don't think I made many specific changes in the hook script. You can find it attached.
Also, this is the way it's called:
rev=`svn info ./ -r 'HEAD' | grep "Last Changed Rev" | cut -d : -f2 | cut -c2-` /home/scripts/trac-svn-hook /home/www/trac/dreamzer $rev
Please tell me if you notice something wrong!
Thank you for your help and have a nice day.
comment:24 by , 7 years ago
Replying to anonymous:
I use explicit synchronization indeed, but I don't think I made many specific changes in the hook script. You can find it attached.
You must invoke trac-admin $ENV sync '*' after putting the post-commit and post-revprop-change hooks.
Also, this is the way it's called:
rev=`svn info ./ -r 'HEAD' | grep "Last Changed Rev" | cut -d : -f2 | cut -c2-` /home/scripts/trac-svn-hook /home/www/trac/dreamzer $rev
No need to invoke manually trac-svn-hook script. Also, /home/www/trac/dreamzer as first argument should be path of Subversion repository, not path of Trac environment.



Could you please post trac.log in your Trac Environment after enabling TracLogging with DEBUG level and visiting the browser page?