Cannot deploy to artifactory

I am trying to deploy a project to artifactory using the following build.gradle file:

apply plugin: 'groovy'
apply plugin: 'maven'
  group = 'com.mygroup'
version = '1.0.0-SNAPSHOT'
  repositories {
  maven {
    url "http://nexus.comp.com/artifactory/simple/repo"
  }
  mavenLocal()
}
  uploadArchives {
  repositories {
    mavenDeployer {
      repository(url: "http://nexus.comp.com/artifactory/libs-snapshot-local") {
        authentication(userName: 'admin', password: 'password')
      }
    }
  }
}

but when I build with:

gradle clean install uploadArchives

I get:

FAILURE: Build failed with an exception.
  * What went wrong:
Execution failed for task ':uploadArchives'.
> Could not publish configuration: [archives]
   > Error deploying artifact 'com.mygroup:test-deploy:jar': Error deploying artifact: Failed to transfer file: http://nexus.comp.com/artifactory/libs-snapshot-local/com/mygroup/test-deploy/1.0-SNAPSHOT/test
-deploy-1.0-20121219.230734-1.jar. Return code is: 500
  * Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
  * Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':uploadArchives'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:68)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:34)
        at org.gradle.api.internal.changedetection.CacheLockHandlingTaskExecuter$1.run(CacheLockHandlingTaskExecuter.java:34)
        at org.gradle.internal.Factories$1.create(Factories.java:22)
  Caused by: org.gradle.api.artifacts.PublishException: Could not publish configuration: [archives]
        at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingArtifactPublisher.publish(ErrorHandlingArtifactPublisher.java:48)
        at org.gradle.api.tasks.Upload.upload(Upload.java:64)
        at org.gradle.api.internal.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:216)
        at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:122)
         at org.gradle.api.internal.artifacts.ivyservice.IvyBackedArtifactPublisher.publish(IvyBackedArtifactPublisher.java:71)
       at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingArtifactPublisher.publish(ErrorHandlingArtifactPublisher.java:41)
       ... 68 more
aused by: org.apache.maven.artifact.deployer.ArtifactDeploymentException: Error deploying artifact: Failed to transfer file: http://nexus.comp.com/artifactory/libs-snapshot-local/com/mygroup/test-deploy/1.0
SNAPSHOT/test-deploy-1.0-20121219.231659-1.jar. Return code is: 500
       at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:121)
       at org.apache.maven.artifact.ant.DeployTask.doExecute(DeployTask.java:125)

It I enter the first url:

http://nexus.comp.com/artifactory/simple/repo

into my browser I get:

HTTP ERROR 404

If I enter the other url:

http://nexus.comp.com/artifactory/libs-snapshot-local

into my browser I get to an old school html index page. Any ideas why my deploy fails - previously it worked just fine?

500 is an internal server error. I recommend to check the Nexus logs.

Yes I did try to check the artifactory logs from its webinterface but the last entries are from 5 days ago, it stores no record of the deploys I try to make.

Then maybe it has run out of disk space or something. 500 is a problem on the server side, so I’d look there. Of course it can’t hurt to check the Gradle debug log as well.

I have the same problem when I try to deploy using maven so its not a gradle problem and hence a bit off-topic I guess :slight_smile: The machine running artifactory has around 3G left not much but should be enough.

I am a bit puzzled that no logfiles are “generated/written to” located in:

/var/log/artifactory

I have also tried to manually upload a jar file and that does not work either, and no changes in the log.

A service artifactory restart solved the problem.