dajester2013 / ivysvn

Automatically exported from code.google.com/p/ivysvn
Apache License 2.0
0 stars 0 forks source link

Refuses to publish when previous entry exists. #28

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

This problem started spontaneously, so could be hard to reproduce. However it's 
happened in two separate organizations I've worked with. 

Publish in ant as follows: 

     <!-- This section uses black magic to get the SVN branch or tag id -->
        <svn javahl="false" svnkit="false">
            <info target="${basedir}" verbose="true"/>
        </svn>
        <propertyregex property="ivy.deliver.revision" input="${svn.info.url}"
                       regexp="[^/]+$"
                       select="\0"
                       override="true"/>

        <!-- Now we're ready to publish -->
        <ivy:publish artifactspattern="${distribution.dir}/[artifact].[ext]"
                     resolver="svn"
                     settingsref="ivy.publish.settings"
                     pubrevision="${ivy.deliver.revision}"
                     overwrite="true"
                />
What is the expected output? What do you see instead?

Expected to commit publish transaction. Instead get java.io.Exception stating 
that the artifact already exists in the repository. 

What version of the product are you using? On what operating system?

2.1.0 - all operating systems. 

Please provide any additional information below.

Work around: 

We are working around this problem, by inserting the following in the publish 
task: 

        <!-- For some reason ivysvn refuses to overwrite the previous copy (if it exists), even with overwrite=true -->
        <echo message="Delete previous revision, if any"/>        
        <svn username="${svn.user.name}" password="${svn.user.password}" failonerror="false">
            <delete url="${ivy.repository.root}/valuecommerce/${ivy.module.name}"
                    message="Ant build --publish. Deleting previous revision. "/>
        </svn>

Original issue reported on code.google.com by jasper.r...@gmail.com on 5 Aug 2010 at 10:59

GoogleCodeExporter commented 9 years ago
Can you attach the stack trace from the IOException? Also run ant with the -d 
flag and see if that provides any further info. Your ivysvn conf would also be 
useful so I can see whether you're using webdav, svn or svn+ssh etc. 

Original comment by massdosage on 6 Aug 2010 at 9:20

GoogleCodeExporter commented 9 years ago
Build properties follow: 

#--------------------------------------------------------- IVY 
--------------------------------------------------------#
ivy.module.name=zzzzzz
ivy.repository.root=https://vcs.xxxxx.com/svn/repos/xxx/ivyrepo
ivy.config.dir=${basedir}/dependencies
ivy.dep.file=${ivy.config.dir}/ivy.xml
ivy.lib.dir=${basedir}/lib/
#Uncomment the line below to override automatic repository configuration
#ivy.settings.file=${ivy.config.dir}/ivysettings-local.xml

#--------------------------------------------------------- SVN 
--------------------------------------------------------#
svn.binarydiff=false
svn.cleanup.publish.folder=true

Original comment by jasper.r...@gmail.com on 6 Aug 2010 at 9:35

GoogleCodeExporter commented 9 years ago
IvySettings-svn.xml follows: 

<ivysettings>

    <typedef name="svn" classname="fm.last.ivy.plugins.svnresolver.SvnResolver"/>

    <settings defaultResolver="svn"/>
    <resolvers>
        <svn name="ivysvn"
             checkmodified="true"
             repositoryRoot="${ivy.repository.root}"
             userName="${svn.user.name}"
             userPassword="${svn.user.password}"
             keyFile="${ssh.keyfile}"
             sshPort="${ssh.port}"
             sshPassphrase="${ssh.keyfile.passphrase}"
             certFile="${ssl.certfile}"
             storageAllowed="${svn.storage.allowed}"
             binaryDiff="${svn.binarydiff}" binaryDiffFolderName="${svn.binarydiff.folder}"
             retrieveRevision="${svn.retrieve.revision}"
             cleanupPublishFolder="${svn.cleanup.publish.folder}">
            <ivy pattern="/[organisation]/[module]/[revision]/ivy.xml"/>
            <artifact pattern="/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]"/>
        </svn>
        <chain name="svn" returnFirst="true">
            <resolver ref="ivysvn"/>
        </chain>
    </resolvers>
    <modules>
    </modules>
</ivysettings>

Original comment by jasper.r...@gmail.com on 6 Aug 2010 at 9:36

GoogleCodeExporter commented 9 years ago
Stacktrace follows: 

BUILD FAILED
/home/jasper/Projects/clickstream-analyzer/build.xml:421: impossible to publish 
artifacts for xxxxx: java.io.IOException
    at fm.last.ivy.plugins.svnresolver.SvnRepository.commitPublishTransaction(SvnRepository.java:215)
    at fm.last.ivy.plugins.svnresolver.SvnResolver.commitPublishTransaction(SvnResolver.java:58)
    at org.apache.ivy.plugins.resolver.ChainResolver.commitPublishTransaction(ChainResolver.java:283)
    at org.apache.ivy.core.publish.PublishEngine.publish(PublishEngine.java:263)
    at org.apache.ivy.core.publish.PublishEngine.publish(PublishEngine.java:170)
    at org.apache.ivy.Ivy.publish(Ivy.java:600)
    at org.apache.ivy.ant.IvyPublish.doExecute(IvyPublish.java:299)
    at org.apache.ivy.ant.IvyTask.execute(IvyTask.java:277)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.Target.execute(Target.java:390)
    at org.apache.tools.ant.Target.performTasks(Target.java:411)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1360)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1329)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1212)
    at org.apache.tools.ant.Main.runBuild(Main.java:801)
    at org.apache.tools.ant.Main.startAnt(Main.java:218)
    at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
    at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: org.tmatesoft.svn.core.SVNException: svn: File '/xxxx.jar' already 
exists
    at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:64)
    at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:51)
    at org.tmatesoft.svn.core.internal.io.dav.DAVCommitEditor.addFile(DAVCommitEditor.java:244)
    at fm.last.ivy.plugins.svnresolver.SvnDao.putFile(SvnDao.java:95)
    at fm.last.ivy.plugins.svnresolver.SvnPublishTransaction.performPutOperations(SvnPublishTransaction.java:234)
    at fm.last.ivy.plugins.svnresolver.SvnPublishTransaction.commitTree(SvnPublishTransaction.java:204)
    at fm.last.ivy.plugins.svnresolver.SvnPublishTransaction.commitTree(SvnPublishTransaction.java:202)
    at fm.last.ivy.plugins.svnresolver.SvnPublishTransaction.commitTree(SvnPublishTransaction.java:202)
    at fm.last.ivy.plugins.svnresolver.SvnPublishTransaction.commitTree(SvnPublishTransaction.java:202)
    at fm.last.ivy.plugins.svnresolver.SvnPublishTransaction.commit(SvnPublishTransaction.java:169)
    at fm.last.ivy.plugins.svnresolver.SvnRepository.commitPublishTransaction(SvnRepository.java:213)
    ... 23 more

Total time: 1 minute 19 seconds

Original comment by jasper.r...@gmail.com on 6 Aug 2010 at 9:40

GoogleCodeExporter commented 9 years ago
Both times I've noted this problem, the repository was https (as noted in the 
stacktrace). It didn't seem to be an issue with svn+ssh 

Original comment by jasper.r...@gmail.com on 6 Aug 2010 at 9:47

GoogleCodeExporter commented 9 years ago
Any update on this issue?

The work-around above (deleting and then publishing as separate txns) sometimes 
causes us problems - there'll be a period between the two transactions when the 
artifact doesn't exist. 

Original comment by jasper.r...@gmail.com on 15 Sep 2010 at 10:14

GoogleCodeExporter commented 9 years ago
I'm afraid I'm having a hard time reproducing this. The best bet to getting 
this fixed would be to checkout the existing IvySvn source and write a unit 
test that reproduces it. If we can get that far then I can take a look at what 
could be causing it. I wrote a wiki page describing how to set IvySvn up for 
unit tests:

http://code.google.com/p/ivysvn/wiki/UnitTestSetup

The svnkit library that IvySvn uses is notorious for having different behaviour 
over svn and http and we only use it over svn+ssh so a lot of the issues that 
you are experiencing don't occur for us. I have a http/webdav setup for running 
the tests so if you can get a test to reproduce this that would be massively 
helpful.

Original comment by massdosage on 18 Nov 2010 at 3:31

GoogleCodeExporter commented 9 years ago
Thanks - will try to provide test cases as soon as possible. 

Original comment by jasper.r...@gmail.com on 19 Nov 2010 at 1:28