jenkins gradle can't find groovy-all-2.5.5.jar - groovy

Have a Jenkins Pipeline that downloads a testing repo from bitbucket then does the following:
gradle build --refresh-dependencies
One of the dependencies is as follows:
compile 'org.codehaus.groovy:groovy-all:2.5.5'
We have the Pipeline running every 30min, and at least 3-4 times a day a build will fail with the following error:
Could not determine artifacts for org.codehaus.groovy:groovy-all:2.5.5
> Could not get resource '<pathToResource>/org/codehaus/groovy/groovy-all/2.5.5/grovy-all-2.5.5.jar'.
> Could not HEAD '<pathToResource>/org/codehaus/groovy/groovy-all/2.5.5/grovy-all-2.5.5.jar'.
> Read timed out
I've tried upgrading the version of groovy-all, as well as specifying the ext/type as pom. When specifying the type I get a new error as follows:
> Cannot infer Groovy class path because no Groovy Jar was found on class path:
As I said this only happens about 3-4 times a day, out of 48 builds a day, so it's very inconsistent and happens at random intervals.
We can't revert groovy-all to a previous version where the .jar exists, so is there any solution to resolve this?

You say the problem is intermittent so it sounds like you are timing out when downloading the artefact. Are you caching it locally (Artifactory, Nexus or similar)? If not, look into doing so. If you are caching locally, I'd check if something is flushing the cache

Related

Unable to pass user.dir parameter to code using pom.xml and mvn cmdline

Im a newbie to azure and maven. I have created a build pipeline and it is dropping artifacts to Build.ArtifactDirectory. In CD pipeline, there is a java class which uses System.getProperty("user.dir"). But this path is taking wrongly and it throws ClassNotFoundException.
Reason for this:
Actual artifacts in cd after drop is present in path: C:/agent1/1/a/buildpipeline/drop/s/TestCode/src/main/read.java
user.dir : is searching in path: C:/agent1/1/a/ in which the code is not available.
Fix the issue:
To fix this, i need to manually pass the user.dir value through maven commandline that is -Duser.dir="pathname". But this is not working
I can change the artifact drop path from build pipeline and include a task of download artifact in release pipeline - Is not working because, I need to add a maven task to integrate pom.xml and it is automatically showing the path C:/agent1/1/a/buildpipeline/drop/s/TestCode/pom.xml.
Please help me with a solution

Build Stage in Yaml fails

I installed a GitLab runner in a Build server and registered a runner for a Project I have in GitLab.
The Build Stage has the following in the first line:
'D:\scripts\NuGet\NuGet.exe restore %CI_PROJECT_DIR%%SOLUTION_FILE%'
I already verified %SOLUTION_FILE%' has the right value however I get the following error:
Cannot locate a solution file.
I already checked everything I could think of but I can't figure out why it can't find the solution file.

Building maciejhirsz/logos on Rust nightly-2020-06-13

I have a project using Rust nightly with logos 0.11.4 as a dependency. When I run cargo build, I get
error: failed to download `logos v0.11.4`
Caused by:
unable to get packages from source
Caused by:
failed to parse manifest at `C:\Users\jonat\.cargo\registry\src\github.com-1ecc6299db9ec823\logos-0.11.4\Cargo.toml`
Caused by:
readme file with name '../README.md' was not found
It turns out that logos has a nested package called logos-derive, and the Cargo.toml for this project has the line readme = "../README.md". In other words, it's pointing to the README from the parent directory. However, the Cargo source registry places the logos-0-11.4 and logos-derive-0.11.5 directories at the same level, rather than nesting them, which explains why the file is not found. I can actually get it to build by creating an empty .cargo/registry/src/github.com-1ecc6299db9ec823/README.md. But that's obviously not a satisfactory long-term fix.
Note that I was able to build just fine two days ago (2020-06-11), but despite there not being any changes to logos or logos-derive in that time, I'm now unable to build - even after checking out my project from that time and downgrading my toolchain to nightly-2020-06-11. I'm not sure how that's possible or what in my build process has changed.
Am I doing something wrong, is logos-derive doing something wrong, or has Cargo changed something recently? Anyone have a proper solution?
The issue seems to have mysteriously disappeared again in nightly-2020-06-13. I don't know what the cause was, but I guess this is resolved.

TeamCity WindowsAzure.targets causing errors in deployment

We are currently trying to setup an Angular 2 project that also contains a Cloud Service project in its solution. We have set up numerous Angular 1 projects containing Cloud Service projects and have had no errors. When trying to run the MSBuild step for the Angular 2 project, we get the following error on the TeamCity build server:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Windows Azure Tools\2.7\Microsoft.WindowsAzure.targets(2787, 5): error MSB3021: Unable to copy file "C:\TeamCityBuildAgent\temp\buildTmp\.NETFramework,Version=v4.6.1.AssemblyAttributes.cs" to "C:\SourceControlFolder\Apps\MyApp\MyApp.CloudDeployment\obj\Debug\Website\C:\TeamCityBuildAgent\temp\buildTmp\.NETFramework,Version=v4.6.1.AssemblyAttributes.cs". The given path's format is not supported.
The main problem seems to be the build attempting to throw the full C:\TeamCityBuildAgent.. path into the obj\Debug\Website folder.
My current MSBuild parameters are:
/p:Configuration="Dev"
/p:platform="Any CPU"
/p:OctoPackEnforceAddingFiles=true
/p:OctoPackProjectName=MyApp_Dev
I've tried the following solutions:
Making sure the latest Visual Studio Update is installed (for MSBuild)
Running the install tool to repair Azure Tools 2.7 on the build server.
Changing the debug configuration in the build.
Ensuring TypeScript 1.7.6 is installed on the build server (even though it's an Azure.targets issue) [https://github.com/Microsoft/TypeScript/issues/6215]
Updated the project to Azure Tools 2.9. The same error remains except it's failing on the 2.9 folder instead now.
Curious if anyone else has experienced this error and knows a fix. I'll keep this post updated as I try other solutions.
Update
It appears that what is causing this issue is this line within the .csproj file:
<FilesToIncludeForPublish>AllFilesInProjectFolder</FilesToIncludeForPublish>
This is specified for our build configurations to copy all files generated by the ng build to the output directory of the publish. What I don't understand at the moment is how this works on all of the devs' local machines but does not work on our build server. Will keep this posted as I find more info or any kind of workaround.
This ended up being the fix:
Instead of targeting the .sln in MSBuild, we specifically targeted the .csproj file. This fixed the build errors and allowed us to keep the FilesToIncludeForPublish tag inside.

Aerospark build (and running with PySpark)

I am having trouble building the Aerospark connector # https://github.com/aerospike/aerospark
I have created fresh Ubuntu box, installed JDK, SBT, Maven, Scala 2.10, and then followed the steps at the github page above. During the build i get this error and I am not sure which is the most direct way to build this properly....
[error] 1 error was encountered during merge
java.lang.RuntimeException: deduplicate: different file contents found in
the following: /opt/astools/aerospark/lib/aerospike-helper-java-
1.0.6.jar:META-INF/maven/com.aerospike/aerospike-client/pom.xml
/root/.m2/repository/com/aerospike/aerospike-helper-java/1.0.6/aerospike-
helper-java-1.0.6.jar:META-INF/maven/com.aerospike/aerospike-client/pom.xml
/root/.ivy2/cache/com.aerospike/aerospike-client/jars/aerospike-client
3.3.1.jar:META-INF/maven/com.aerospike/aerospike-client/pom.xml
Are there any updated instructions for building this - the git link in the instructions seems outdated incidentally.
As an aside, has anyone tried this with PySpark?
There was an issue with the build file which affected ubuntu. Can you pull the latest changes and go through the build process again?

Resources