Operation returned an invalid status code "Conflict"

Error fix for "Make sure that ProjectName is not already deployed on one of the robots from this environment", respectively for "Operation returned an invalid status code "Conflict"" while using Jenkins CI/CD pipeline .

Issue Description: The error occurs mainly if the package version already exists in the Orchestrator. This can happen during the deployment phase when Jenkins tries to upload a package with a version number that is already present in the UiPath Orchestrator.

image.png


Resolution:

  1. Check Package Versioning: Ensure that the Jenkins pipeline is configured to handle package versioning automatically. If the package version already exists in the Orchestrator, update the version number.

  2. Update Jenkins Pipeline Configuration: Modify the Jenkins file or pipeline configuration to increment the package version automatically. This can be done using the UiPath Jenkins plugin's built-in versioning feature.

    uipathDeploy (
    orchestratorAddress: 'https://your-orchestrator-url',
    orchestratorTenant: 'your-tenant',
    packagePath: 'path-to-your-package',
    version: '${BUILD_NUMBER}', // Automatically increments version with each build
    credentialsId: 'your-credentials-id'
    )

  3. Verify Jenkins Plugin Settings: Verify that the UiPath Jenkins plugin is correctly configured. The plugin should handle the deployment process, including version management.
  4. Manual Version Check (if required): If automatic versioning is not enabled, manually check the version number of the package in the Orchestrator and update the Jenkins pipeline to deploy a new version.

    To check the current package version:

    Update the Jenkins pipeline to a new version:

    uipathDeploy (
    orchestratorAddress: 'https://your-orchestrator-url',
    orchestratorTenant: 'your-tenant',
    packagePath: 'path-to-your-package',
    version: 'new-version-number',
    credentialsId: 'your-credentials-id'
    )
    1. Log in to UiPath Orchestrator
    2. Navigate to the "Packages" page
    3. Identify the version number of the package tried to deploy.


Additional Recommendations:

  • Error Handling: Add error handling in the Jenkins pipeline to catch and log deployment errors. This can help diagnose and fix issues more quickly.


    try {
    // Deployment steps
    } catch (Exception e) {
    echo "Deployment failed: ${e.message}"
    currentBuild.result = 'FAILURE'
    }
  • Consult Documentation: Refer to the UiPath Jenkins plugin documentation for detailed information on setting up and configuring the plugin for automated deployments.

  • Automation Best Practices: Follow best practices for CI/CD automation, including maintaining version control, using automated tests, and continuously monitoring the deployment process.

Example Screenshot of Automatic Package Versioning: Ensure that your Jenkins pipeline configuration aligns with the recommendations mentioned above. An example of automatic package versioning setup in Jenkins might look like this:

jenkinsPlugin.png