Failed to push some refs to Subversion repository. svn: E204900: File .gitignore exists but shouldn't File .gitignore exists but shouldn't

Trying to push a commit to git, I have the following error :

pre-receive hook declined
Fetching revisions from SVN repository:

SubGit ERROR REPORT (SubGit version 3.3.2 (‘Bobique’) build #3875):

You’ve received this message because SubGit (http://subgit.com/) is installed in your repository
and an error that needs to be dealt with has occurred in SubGit translation engine.

TEMPORARY ERROR:
Failed to push some refs to Subversion repository.
svn: E204900: File .gitignore exists but shouldn’t
File .gitignore exists but shouldn’t

CURRENT STATE:
Both Git and Subversion repository are open for pushes or commits.
Your commit was not committed, but you may retry it.

TO RECOVER:
A) Address the problem if possible and then retry commit
OR
B) Run on the server
$ subgit uninstall /var/opt/gitlab/git-data/repositories/XXX.git/.

IMPORTANT: As soon as SubGit is uninstalled, both Git and Subversion repositories
           will become open, but no synchronization will take place.

TO REPORT:
Report an issue at http://issues.tmatesoft.com/
You may find logs on the server at ‘/var/opt/gitlab/git-data/repositories/XXX.git/./subgit/logs’

THANK YOU!

And the following in the logs:
2018-07-10 13:38:16.220][daemon][17] Sent ‘(error (139:Failed to push some refs to Subversion repository.
svn: E204900: File .gitignore exists but shouldn’t
File .gitignore exists but shouldn’t
3458:org.tmatesoft.translator.util.e: Failed to push some refs to Subversion repository.
at org.tmatesoft.translator.util.e.c(SourceFile:104)
at org.tmatesoft.translator.c.G.a(SourceFile:80)
at org.tmatesoft.translator.c.E.a(SourceFile:76)
at org.tmatesoft.translator.c.d.a(SourceFile:314)
at org.tmatesoft.translator.c.d.a(SourceFile:41)
at org.tmatesoft.translator.c.e.run(SourceFile:285)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.tmatesoft.translator.util.e: svn: E204900: File .gitignore exists but shouldn’t
at org.tmatesoft.translator.util.e.c(SourceFile:104)
at org.tmatesoft.translator.util.e.b(SourceFile:74)
at org.tmatesoft.translator.k.aq.c(SourceFile:918)
at org.tmatesoft.translator.k.aq.a(SourceFile:938)
at org.tmatesoft.translator.k.aq.b(SourceFile:996)
at org.tmatesoft.translator.k.d.j.a(SourceFile:242)
at org.tmatesoft.translator.k.d.j.a(SourceFile:147)
at org.tmatesoft.translator.c.J.a(SourceFile:479)
at org.tmatesoft.translator.c.J.call(SourceFile:461)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.tmatesoft.translator.c.Q.a(SourceFile:422)
at org.tmatesoft.translator.c.G.run(SourceFile:247)
Caused by: com.syntevo.svngitkit.core.a.i: svn: E204900: File .gitignore exists but shouldn’t
at com.syntevo.svngitkit.core.a.i.a(SourceFile:29)
at com.syntevo.svngitkit.core.b.N.b(SourceFile:713)
at com.syntevo.svngitkit.core.b.N.a(SourceFile:415)
at com.syntevo.svngitkit.core.b.N.a(SourceFile:375)
at com.syntevo.svngitkit.core.b.N.a(SourceFile:321)
at com.syntevo.svngitkit.core.b.N.a(SourceFile:160)
at com.syntevo.svngitkit.core.b.ac.c(SourceFile:43)
at com.syntevo.svngitkit.core.b.ac.b(SourceFile:36)
at org.tmatesoft.translator.k.aq.a(SourceFile:1331)
at org.tmatesoft.translator.k.aq.c(SourceFile:915)
… 9 more
Caused by: org.tmatesoft.svn.core.SVNException: svn: E204900: File .gitignore exists but shouldn’t
at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:70)
at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:57)
at org.tmatesoft.svn.core.internal.io.svn.SVNEditModeReader.driveEditor(SVNEditModeReader.java:248)
at org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.update(SVNRepositoryImpl.java:1525)
at com.syntevo.svngitkit.core.b.N.a(SourceFile:1232)
at com.syntevo.svngitkit.core.b.N.a(SourceFile:1012)
at com.syntevo.svngitkit.core.b.N.a(SourceFile:757)
at com.syntevo.svngitkit.core.b.N.b(SourceFile:674)
… 17 more
Caused by: com.syntevo.svngitkit.core.a.g: File .gitignore exists but shouldn’t
at com.syntevo.svngitkit.core.internal.d.y.a(SourceFile:200)
at com.syntevo.svngitkit.core.internal.d.y.b(SourceFile:66)
at com.syntevo.svngitkit.core.internal.d.V.addFile(SourceFile:111)
at com.syntevo.svngitkit.core.internal.d.o.addFile(SourceFile:307)
at com.syntevo.svngitkit.core.internal.d.q.addFile(SourceFile:132)
at com.syntevo.svngitkit.core.internal.d.S.addFile(SourceFile:144)
at org.tmatesoft.svn.core.internal.wc.SVNCancellableEditor.addFile(SVNCancellableEditor.java:108)
at org.tmatesoft.svn.core.internal.io.svn.SVNEditModeReader.processCommand(SVNEditModeReader.java:146)
at org.tmatesoft.svn.core.internal.io.svn.SVNEditModeReader.driveEditor(SVNEditModeReader.java:231)
… 22 more
))’.

Thanks for reporting this bug.

  1. May I ask you to attach full logs as the message suggests?
  2. Another question: do you have .gitignore file directly in the SVN repository (not in Git but in SVN)? Normally SubGit doesn’t translate it because it performs svn:ignore<->.gitignore translation. But something went wrong, so I’d like to know what confused SubGit.
  3. May I ask you to run
    {code}
    svn propget svn:ignore BRANCH_URL --depth infinity
    {code}
    command and send the output to us? Here BRANCH_URL is the branch where the problem happens. You can deduce it yourself or I can do that when you attach the logs.
  4. May I ask you to run
    {code}
    svn log -v SVN_URL
    {code}
    at least for several latest revisions? I think I can tell you the revision number once I have a look at the logs.

When you push to Git, SubGit tries to translate not yet translated SVN revisions to Git and I think this is the moment when the problem happens. So information about what kind of changes happened in those revisions would help a lot. With this information I’ll try to reproduce and fix the problem.

Also I’d like to note (this is irrelevant to the issue) that in SubGit 3.3.3 we’ve fixed a critical bug SGT-1250. So I highly recommend you to upgrade to that version. It won’t solve this issue but may prevent SGT-1250 in the future.

{code}
at org.tmatesoft.translator.util.e.c(SourceFile:104)
at org.tmatesoft.translator.daemon.TsProxySyncQueue.preReceive(SourceFile:80)
at org.tmatesoft.translator.daemon.TsPreReceive.execute(SourceFile:76)
at org.tmatesoft.translator.daemon.TsDaemon.runCommand(SourceFile:314)
at org.tmatesoft.translator.daemon.TsDaemon.access$000(SourceFile:41)
at org.tmatesoft.translator.daemon.TsDaemon$1.run(SourceFile:285)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.tmatesoft.translator.util.e: svn: E204900: File .gitignore exists but shouldn’t
at org.tmatesoft.translator.util.TsException.wrap(SourceFile:104)
at org.tmatesoft.translator.util.TsException.wrap(SourceFile:74)
at org.tmatesoft.translator.repository.TsLocation.fetchNoLocalReferencesUpdate(SourceFile:918)
at org.tmatesoft.translator.repository.TsLocation.fetch(SourceFile:938)
at org.tmatesoft.translator.repository.TsLocation.fetchOnlyGaps(SourceFile:996)
at org.tmatesoft.translator.repository.proxy.TsProxyRepositorySync.fetch(SourceFile:242)
at org.tmatesoft.translator.repository.proxy.TsProxyRepositorySync.proxySync(SourceFile:147)
at org.tmatesoft.translator.daemon.TsProxySyncQueue$PreReceiveTask.call(SourceFile:479)
at org.tmatesoft.translator.daemon.TsProxySyncQueue$PreReceiveTask.call(SourceFile:461)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.tmatesoft.translator.daemon.TsProxySyncQueue$TaskQueue.executeNextTask(SourceFile:422)
at org.tmatesoft.translator.daemon.TsProxySyncQueue.run(SourceFile:247)
Caused by: com.syntevo.svngitkit.core.a.i: svn: E204900: File .gitignore exists but shouldn’t
at com.syntevo.svngitkit.core.exceptions.GsException.wrap(SourceFile:29)
at com.syntevo.svngitkit.core.operations.GsFetch.fetch(SourceFile:713)
at com.syntevo.svngitkit.core.operations.GsFetch.fetchWithRetry(SourceFile:415)
at com.syntevo.svngitkit.core.operations.GsFetch.fetch(SourceFile:375)
at com.syntevo.svngitkit.core.operations.GsFetch.fetch(SourceFile:321)
at com.syntevo.svngitkit.core.operations.GsFetch.doRun(SourceFile:160)
at com.syntevo.svngitkit.core.operations.GsOperation.run(SourceFile:43)
at com.syntevo.svngitkit.core.operations.GsOperation.checkAndRun(SourceFile:36)
at org.tmatesoft.translator.repository.TsLocation.doFetch(SourceFile:1331)
at org.tmatesoft.translator.repository.TsLocation.fetchNoLocalReferencesUpdate(SourceFile:915)
Caused by: org.tmatesoft.svn.core.SVNException: svn: E204900: File .gitignore exists but shouldn’t
at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:70)
at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:57)
at org.tmatesoft.svn.core.internal.io.svn.SVNEditModeReader.driveEditor(SVNEditModeReader.java:248)
at org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.update(SVNRepositoryImpl.java:1525)
at com.syntevo.svngitkit.core.operations.GsFetch.basicFetch(SourceFile:1232)
at com.syntevo.svngitkit.core.operations.GsFetch.fetchChanges(SourceFile:1012)
at com.syntevo.svngitkit.core.operations.GsFetch.fetchChanges(SourceFile:757)
at com.syntevo.svngitkit.core.operations.GsFetch.fetch(SourceFile:674)
Caused by: com.syntevo.svngitkit.core.a.g: File .gitignore exists but shouldn’t
at com.syntevo.svngitkit.core.internal.editors.GsIteratorsBasedTreeState.checkExistence(SourceFile:200)
at com.syntevo.svngitkit.core.internal.editors.GsIteratorsBasedTreeState.enterFile(SourceFile:66)
at com.syntevo.svngitkit.core.internal.editors.GsTreeContentsEditor.addFile(SourceFile:111)
at com.syntevo.svngitkit.core.internal.editors.GsFetchingCoordinator.addFile(SourceFile:307)
at com.syntevo.svngitkit.core.internal.editors.GsForceVisitEditor.addFile(SourceFile:132)
at com.syntevo.svngitkit.core.internal.editors.GsSvnEditor.addFile(SourceFile:144)
at org.tmatesoft.svn.core.internal.wc.SVNCancellableEditor.addFile(SVNCancellableEditor.java:108)
at org.tmatesoft.svn.core.internal.io.svn.SVNEditModeReader.processCommand(SVNEditModeReader.java:146)
at org.tmatesoft.svn.core.internal.io.svn.SVNEditModeReader.driveEditor(SVNEditModeReader.java:231)

{code}

1/ see attached daemon.0.log
2/ there are some .gitignore files in the SVN repository
3/ see attached svn_propget_ignore.out
4/ see attached svn.log
Regards.

Hello

thank you for the logs.
We have checked through them, but there still some questions, could you please give us a little more clues, namely

  • according to the logs, ‘ignores’ option is set to false in the configuration. Could you advise has it been set in that way from the very beginning or it’s been changed when the mirror has already been running?
  • do I understand correctly that initial translation (by ‘subgit install’ command) passed smoothly and the mirror has been working normally some time?
  • may we ask you to provide additional file from the SubGit repository:
    /subgit/svn/.svngit/svngitkit.config

‘ignores’ option was not set false for initial translation. It has been changed later.
The initial translation went well and the mirror was working. Then I changed ‘ignores’ option to false.
I attached the asked file (was in /svn/.svngit/svngitkit.config)

Hello,
while we’re trying to reproduce the issue, I would recommend you the following work-around: add a recursive pattern:
{code}
excludePath=.gitignore
{code}
to your subgit/config and run “subgit install path/to/git/repository” to apply the change. This will exclude .gitignore from translation throughout the whole repository.

When you set translate.ignores=false not from the start but when the mirror is active, “.gitignore” files should be excluded from translation implicitly anyway. This unexpectedly doesn’t happen in your case (and we will investigate — why). But for now you can exclude it explicitly and thus solve the problem.

Thanks for the tip, it effectively solves the issue.

I’m glad to help. My colleague has managed to reproduce problem. I think, the fix will be included into the version after the next one as the issue is minor and we plan to release 3.3.4 soon. But I recommend you to upgrade to at least 3.3.3 anyway as 3.3.3 solves one serious issue.

Fixed at r4157 of trunk.