Getting error " not enough arguments in call to s.statsd.SendLoop" when running "go build" command - hyperledger-fabric

I'm trying to run go build command for my project but it exits with below error.
alpha#GHOST-RIDER:~/GoWorkspace/src/github.com/hyperledger/firstproject$ go build
# github.com/hyperledger/fabric-sdk-go/internal/github.com/hyperledger/fabric/core/operations
../fabric-sdk-go/internal/github.com/hyperledger/fabric/core/operations/system.go:227:23: not enough arguments in call to s.statsd.SendLoop
have (<-chan time.Time, string, string)
want (context.Context, <-chan time.Time, string, string)
Any help would be appreciated.

As per code fabric is using the different version of this library: github.com/go-kit/kit/metrics/statsd. If you follow the System struct's statsd attribute, you can reach the reference on imports.
In master branch of this lib, SendLoop function requires 4 attributes, so that's the root cause. So this causes error when you compile on your local environment.
I had the same issue and worked around it by checking out a tag of library as below:
cd $GOPATH/src/github.com/go-kit/kit
git fetch --tags
git checkout v0.8.0

found a solution on the hyperledger-fabric-go-sdk group chat.
Add context.Background() in s.statsd.SendLoop like below
s.statsd.SendLoop(context.Background(), s.sendTicker.C, network, address)
in fabric-sdk-go/internal/github.com/hyperledger/fabric/core/operations/system.go file at line 227.

I had a same issue, my solution worked and don't need edit fabric source code.
specify github.com/go-kit/kit to v0.8.0, modify go.mod:
replace github.com/go-kit/kit => github.com/go-kit/kit v0.8.0 // you specific version
require (
... ...
// Maybe other version, go mod tidy update automatically, don't care it.
github.com/go-kit/kit v0.9.0 // indirect
... ...
)
then it worked.

Related

What's the normal procedure for finding the name of the necessary ESLint package based on the config name given in the error message?

I was just struggling with the error below in my IDE for a frustratingly-long time:
ESLint: Error: Failed to load config "#vue/typescript" to extend from.
After a lot of Googling and running commands I found online, I eventually found that what (seemed to) fix the problem was running this:
yarn add -D #vue/eslint-config-typescript
My question is: How was I supposed to figure that out? Is there some website or service or something where I could have searched for #vue/typescript and found out that the package I needed to install was #vue/eslint-config-typescript?
Ok, I figured it out: in the ESLint docs, it says that basically that the part after the forward-slash should be understood to always start with eslint-plugin:
They show the following examples:
"plugins": [
"jquery", // means eslint-plugin-jquery
"#jquery/jquery", // means #jquery/eslint-plugin-jquery
"#foobar" // means #foobar/eslint-plugin
]

cookie cutter: what's the easiest way to specify variables for the prompts

Is there anything that offers replay-type functionality, by pointing at a predefined prompt-answer file?
What works and what I'd like to achieve.
Let's take an example, using a cookiecutter to prep a Python package for pypi
cookiecutter https://github.com/audreyr/cookiecutter-pypackage.git
You've downloaded /Users/jluc/.cookiecutters/cookiecutter-pypackage before. Is it okay to delete and re-download it? [yes]:
full_name [Audrey Roy Greenfeld]: Spartacus 👈 constant for me/my organization
email [audreyr#example.com]: spartacus#example.com 👈 constant for me/my organization
...
project_name [Python Boilerplate]: GladiatorRevolt 👈 this will vary.
project_slug [q]: gladiator-revolt 👈 this too
...
OK, done.
Now, I can easily redo this, for this project, via:
cookiecutter https://github.com/audreyr/cookiecutter-pypackage.git --replay
This is great!
What I want:
Say I create another project, UnleashHell.
I want to prep a file somehow that has my developer-info and project level info for Unleash. And I want to be able to run it multiple times against this template, without having to deal with prompts. This particular pypi template gets regular updates, for example python 2.7 support has been dropped.
The problem:
A --replay will just inject the last run for this cookiecutter template. If it was run against a different pypi project, too bad.
I'm good with my developer-level info, but I need to vary all the project level info.
I tried copying the replay file via:
cp ~/.cookiecutter_replay/cookiecutter-pypackage.json unleash.json
Edit unleash.json to reflect necessary changes.
Then specify it via --config-file flag
cookiecutter https://github.com/audreyr/cookiecutter-pypackage.git --config-file unleash.json
I get an ugly error, it wants YAML, apparently.
cookiecutter.exceptions.InvalidConfiguration: Unable to parse YAML file .../000.packaging/unleash.json. Error: None of the known patterns match for {
"cookiecutter": {
"full_name": "Spartacus",
No problem, json2yaml to the rescue.
That doesn't work either.
cookiecutter.exceptions.InvalidConfiguration: Unable to parse YAML file ./cookie.yaml. Error: Unable to determine type for "
full_name: "Spartacus"
I also tried a < stdin redirect:
cookiecutter.prompts.txt:
yes
Spartacus
...
It doesn't seem to use it and just aborts.
cookiecutter https://github.com/audreyr/cookiecutter-pypackage.git < ./cookiecutter.prompts.txt
You've downloaded ~/.cookiecutters/cookiecutter-pypackage before. Is it okay to delete and re-download it? [yes]
: full_name [Audrey Roy Greenfeld]
: email [audreyr#example.com]
: Aborted
I suspect I am missing something obvious, not sure what. To start with, what is the intent and format expected for the --config file?
Debrief - how I got it working from accepted answer.
Took accepted answer, but adjusted it for ~/.cookiecutterrc usage. It works but the format is not super clear. Especially not on the rc which has to be yaml, though that's not always/often the case with rc files.
This ended up working:
file ~/.cookiecutterrc:
without nesting under default_context... tons of unhelpful yaml parse errors (on a valid yaml doc).
default_context:
#... cut out for privacy
add_pyup_badge: y
command_line_interface: "Click"
create_author_file: "y"
open_source_license: "MIT license"
# the names to use here are:
# full_name:
# email:
# github_username:
# project_name:
# project_slug:
# project_short_description:
# pypi_username:
# version:
# use_pytest:
# use_pypi_deployment_with_travis:
# add_pyup_badge:
# command_line_interface:
# create_author_file:
# open_source_license:
I still could not get a combination of ~/.cookiecutterrc and a project-specific config.yaml to work. Too bad that expected configuration format is so lightly documented.
So I will use the .rc but enter the project name, slug and description each time. Oh well, good enough for now.
You are near.
Try this cookiecutter https://github.com/audreyr/cookiecutter-pypackage.git --no-input --config-file config.yaml
The --no-input parameter will suppress the terminal user input, it is optional of course.
The config.yaml file could look like this:
default_context:
full_name: "Audrey Roy"
email: "audreyr#example.com"
github_username: "audreyr"
cookiecutters_dir: "/home/audreyr/my-custom-cookiecutters-dir/"
replay_dir: "/home/audreyr/my-custom-replay-dir/"
abbreviations:
pp: https://github.com/audreyr/cookiecutter-pypackage.git
gh: https://github.com/{0}.git
bb: https://bitbucket.org/{0}
Reference to this example file: https://cookiecutter.readthedocs.io/en/1.7.0/advanced/user_config.html
You probably just need the default_context block since that is where the user input goes.

Flutter packages using same class (how to solve class conflict?)

I use this two packages:
barcode_scan: ^0.0.3
fluttie: ^0.3.0
When I try to run my application, I get the following error:
D8: Program type already present: android.support.v4.app.INotificationSideChannel
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/29.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/111.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/126.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/57.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/160.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/63.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/56.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/64.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/28.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/91.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/81.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/27.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/156.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/59.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/157.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/141.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/65.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/2.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/58.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/3.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/101.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/94.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/159.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/30.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/116.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/60.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/95.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/158.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/151.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/1.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/136.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/146.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/76.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/92.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/131.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/86.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/71.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/62.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/0.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/93.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/106.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/121.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/9.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/37.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/10.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/44.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/38.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/8.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/12.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/43.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/13.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/26.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/21.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/39.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/33.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/14.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/20.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/15.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/45.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/32.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/24.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/16.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/31.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/40.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/25.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/22.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/34.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/17.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/35.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/18.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/42.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/19.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/23.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/36.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/11.jar, /Users/rhuka/repository/github/learn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/41.jar
Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
Program type already present: android.support.v4.app.INotificationSideChannel
Seems to me that both of them use the same class android.support.v4.app.INotificationSideChannel because when I try to use only one of them everything works fine. But I need both on my application. How can I ignore the duplicated classes or just solve this?
I'm facing the same sort of conflict with qr_code_scanner the solution is to delete or change classes for one of them I don't know if flutter has built-in method to handle this sort of conflicts.
but what you can try is to get package from git repo do the changes push the code to your own repo and pub get from your own git repo:
dependencies:
fluttie:
git:
url: https://github.com/...
ref: main

Win10: ASDF can't load system (ASDF_OUTPUT_TRANSLATION error)

Update 2
I think #faré is right, it's an output translation problem.
So I declared the evironment variable ASDF_OUTPUT_TRANSLATIONS and set it to E:/. Now (asdf:require-system "my-system") yields a different error: Uneven number of components in source to destination mapping: "E:/" which led me to this SO-topic.
Unfortunately, his solution doesn't work for me. So I tried the other answer and set ASDF_OUTPUT_TRANSLATIONS to (:output-translations (t "E:/")). Now I get yet another error:
Invalid source registry (:OUTPUT-TRANSLATIONS (T "E:/")).
One and only one of
:INHERIT-CONFIGURATION or
:IGNORE-INHERITED-CONFIGURATION
is required.
(will be skipped)
Original Posting
I have a simple system definition but can't get ASDF to load it.
(asdf-version 3.1.5, sbcl 1.3.12 (upgraded to 1.3.18 AMD64), slime 2.19, Windows 10)
What I have tried so far
Following the ASDF manual: "4.1 Configuring ASDF to find your systems"
There it says:
For Windows users, and starting with ASDF 3.1.5, start from your
%LOCALAPPDATA%, which is usually ~/AppData/Local/ (but you can ask in
a CMD.EXE terminal echo %LOCALAPPDATA% to make sure) and underneath
create a subpath config/common-lisp/source-registry.conf.d/
That's exactly what I did:
Echoing %LOCALAPPDATA% which evaluates to C:\Users\my-username\AppData\Local
Underneath I created the subfolders config\common-lisp\source-registry.conf.d\ (In total: C:\Users\my-username\AppData\Local\config\common-lisp\source-registry.conf.d\
The manual continues:
there create a file with any name of your choice but with the type conf, for instance 50-luser-lisp.conf; in this file, add the following line to tell ASDF to recursively scan all the subdirectories under /home/luser/lisp/ for .asd files: (:tree "/home/luser/lisp/")
That’s enough. You may replace /home/luser/lisp/ by wherever you want to install your source code.
In the source-registry.conf.d folder I created the file my.conf and put in it (:tree "C:/Users/my-username/my-systems/"). This folder contains a my-system.asd.
And here comes the weird part:
If I now type (asdf:require-system "my-system") in the REPL I get the following error:
Can't create directory C:\Users\my-username\AppData\Local\common-lisp\sbcl-1.3.12-win-x86\C\Users\my-username\my-systems\C:\
So the problem is not that ASDF doesn't find the file, it does -- but (whatever the reason) it tries to create a really weird subfolder hierarchy which ultimately fails because at the end it tries to create the folder C: but Windows doesn't allow foldernames containing a colon.
Another approach: (push path asdf:*central-registry*)
If I try
> (push #P"C:/Users/my-username/my-systems/" asdf:*central-registry*)
(#P"C:/Users/my-username/my-systems/"
#P"C:/Users/my-username/AppData/Roaming/quicklisp/quicklisp/")
> (asdf:require-system "my-system")
I get the exact same error.
I don't know what to do.
Update
Because of the nature of the weird path ASDF was trying to create I thought maybe I could bypass the problem by specifying a relative path instead of an absolute one.
So I tried
  (:tree "\\Users\\my-username\\my-systems")
in my conf file. Still the same error.
Ahem. It looks like an output-translations problem.
I don't have a Windows machine right now, but this all used to work last time I tried.
Can you setup some ad hoc output-translations for now that will make it work?

Error grabbing Grapes ... unresolved dependency ... not found

UPDATE 8/6:
The beefed up logging has shown me that there is an issue deleting the old jar from the cache, which leads to the fatal "not found" error. There are other threads similar to this, but only when someone is locking the file with their IDE. We are running a single groovy script from Jenkins, and no one is logged into this box.
We ran process explorer right after the failure and there were no locks. Then I login with the user that Jenkins is using to run the script, and I get no error deleting the files.
Also it seems there was a fix in IVY 2.1 to not fail when the jar cannot be deleted, and I'm on Ivy 2.2 (Groovy 1.8.4). What gives?
Couldn't delete outdated artifact from cache: C:\Users\myUser\.groovy\grapes\com.a.b.c\x-y-z\jars\x-y-z-1.496.jar
then the false(?) error:
Caught: java.lang.ExceptionInInitializerError
java.lang.ExceptionInInitializerError
Caused by: java.lang.RuntimeException: Error grabbing Grapes -- [unresolved dependency: com.a.b.c#x-y-z;1.+: not found]
at smokeTestSuccess.<clinit>(smokeTestSuccess.groovy)
Interestingly enough, this happens everyday the first time the script is run after 5am. I guess the cache gets invalidated through some default config at 5am? Is this some kind of clue??
Original post:
I am intermittently getting an error when running a number of different Groovy scripts which all share an identical #Grab declaration. (file names changed to protect the innocent). First the full Grab declaration:
#GrabResolver(name = 'libs.release', root = 'http://myserver:8081/artifactory/libs-release', m2compatible = 'true') #Grapes([
#Grab(group = 'com.a.b.c, module = 'x-y-z', version = '1.+', changing = true),
#Grab('commons-lang:commons-lang:2.3'),
#Grab('log4j:log4j:1.2.16'),
#Grab('gpars:gpars:0.12'),
#Grab('jsr166y:jsr166y:1.7.0'),
#Grab('org.codehaus.groovy.modules.http-builder:http-builder:0.6'),
#Grab('org.apache.commons:commons-collections:3.2.1'),
#Grab('org.apache.httpcomponents:httpclient:4.2.2'),
#Grab('org.apache.httpcomponents:httpcore:4.2.3'),
#Grab('org.cyberneko.html:nekohtml:1.9.17'),
#Grab('xerces:xercesImpl:2.11.0'),
]) #GrabConfig(systemClassLoader = true)
Then the error:
Caught: java.lang.ExceptionInInitializerError
java.lang.ExceptionInInitializerError
Caused by: java.lang.RuntimeException: Error grabbing Grapes -- [unresolved dependency: com.a.b.c#x-y-z;1.+: not found]
Upon doing numerous internet searches, the cause always seems to be very simple, either one of these two basic problems:
1. Repository unreachable
2. Jar file doesn’t exist
However, in the artifactory logs, I've proven that the file is actually being downloaded:
*Artifactory did accept the request for download:
2014-07-17 07:58:19,938 [ACCEPTED DOWNLOAD] libs-release-local:com/a/b/c/x-y-z/1.477/x-y-z-1.477.jar for anonymous/165.226.40.155.
*Artifactory did deliver jar:
20140717075820|156|REQUEST|165.226.40.155|non_authenticated_user|GET|/libs-release/com/a/b/c/x-y-z/1.477/x-y-z-1.477.jar|HTTP/1.1|200|1276695
The scripts all work about 100% of the time if they are simply restarted. This all leads me to believe that the issue is the Grab timing out. Theoretically the second time I run the script, the file is in the cache, and things happen faster, thus it doesnt fail.
For the above real request, I can see about 20 seconds of elapsed time in the http log from request to download.
Questions:
Does my theory seem correct?
Is there a way to increase the amount of time that the script will wait for the #Grab to resolve?
Does putting a try / catch block around the #Grab statements seem like a good idea? Or will that just hide the real problem?
thanks in advance!!!!
I think I finally figured out the answer to my own question.
I believe there is some sort of bug within Groovy 1.8.4 (or Ivy 2.2), especially since this behavior does mirror an ancient documented Ivy bug with this exact error message scheme and behavior.
Upgrading to Groovy 2.3.6 (which includes Ivy 2.3) appears to solve the issue.
I also still have no idea why the jars cannot be deleted, nothing is locking them. I experimented with moving the grape cache to a less secure folder to rule out a permission issue, but this didn't help:
-Dgrape.root=D:\Temp\grapeCache
UPDATE 8/19:
Once we upgraded to Groovy 2.3.6, the error went away, but I then figured out that the jar was no longer being downloaded at all, when using the "1.+" resolver. Something in the defaultgrapeConfig.xml was causing an issue. Everything is finally working properly after (in addition to the Groovy upgrade) we overrode defaultgrapeConfig.xml with our own stripped down file using this command line JAVA_OPT:
-Dgrape.config=D:\Temp\myGrapeConfig.xml
which had these contents:
<ivysettings>
<settings defaultResolver="downloadGrapes"/>
<resolvers>
<chain name="downloadGrapes">
</chain>
</resolvers>
</ivysettings>
ALSO:
For completeness (further steps):
In Jenkins GUI, update the job(s):
a. Update the drop down for each script: Execute Groovy Script > Groovy Version > Groovy-2.3.6
b. Update the JAVA_OPTS for each script (have to click the ‘advanced’ button under the script to see JAVA_OPTS):
-Dgrape.config=D:\Software\SfGrapeConfig.xml
Optional logging switches: -Dgroovy.grape.report.downloads=true -Divy.message.logger.level=4
In the actual Groovy script itself, delete this option within the #GrabResolver annotation: , m2compatible = 'true'
If you get this or a similar error:
"could not find client or server jvm under [Whatever JAVE_HOME is], please check that it is a valid jdk / jre containing the desired type of jvm"
Delete groovy.exe & groovyw.exe from D:\Software\Groovy-2.3.6\bin (if the exe’s do not exist, the Jenkins groovy plugin will use the bat file versions of these, and they handle the 32-bit / 64-bit problem better than the exe’s)

Resources