[1.4-rc-1] gradle dependencies results in endless loop stating authentication error


(Marcel Overdijk) #1

I’m trying 1.4-rc-1 as replacement for 1.3.0 but when running gradle dependencies I get in an endless loop and it keeps printing:

NEGOTIATE authentication error: No valid credentials provided (Mechanism level: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt))

I think I’ve seen such a message with 1.3.0 also but I didn’t looked further as everything worked as expected further down the line. (I just tried same build file with 1.3.0 and I don’t see the message at all).

I’m wondering where the message is coming from. I’have configured proxy settings in gradle.properties for my companies firewall and I’ve specified credentials for an Ivy repo. But as mentioned in 1.3.0 this works without problems, only 1.4-rc-1 gives this endlessly repeating message.

Cheers, Marcel


#2
  1. Are you sure that the message is “endlessly” repeating. Or is it possible that it is emitted once per dependency that gets resolved? 2. Do you see the message when you use Gradle 1.3 with ‘–refresh-dependencies’ 3. Can you please provide the full output of running with 1.4-rc-1 and ‘–debug’?

(Marcel Overdijk) #3

Hi Daz,

  1. Yes it really seems “endlessly” repeating. 2) When using the --refresh-dependencies option in 1.3 I can see the “NEGOTIATE authentication error: No valid credentials provided” message as well. But only 1 time but it does not affect the further build. 3) For both 1.3 and 1.4-beta-1 I run it with the --debug option. Can I send the outcome to you/someone by email?

Thanks, Marcel


(Partha Bhattacharjee) #4

I am facing the same issue. I have detailed it out at stackoverflow (link: http://stackoverflow.com/questions/14434101/gradle-not-working-behind-proxy-with-ntlm-on-windows)

The funny thing is I am facing this issue on 1.3. Please help.


(Marcel Overdijk) #5

@Partha: Note that I do see the message one in 1.3 but in my case it seems to have no impact. E.g. Central Maven dependencies are downloaded and all dependencies are resolved.


(Partha Bhattacharjee) #6

@Marcel: Nope. I am trying to download

compile ‘ch.qos.logback:logback-classic:1.0.9’,‘springframework:spring-webmvc:1.2.6’

and I have gradle1.3

and I am setting gradle.properties (in the project folder).

systemProp.proxySet=true systemProp.http.proxyHost=

systemProp.http.proxyPort=8080 systemProp.http.proxyUser=/

The same values work perfectly alright in Maven. But in Gradle it says

NEGOTIATE authentication error: No valid credentials provided (Mechanism level: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt))


(Marcel Overdijk) #7

@Partha: I don’t know. At least for me it downloads in 1.3, and not in 1.4-beta-1


(Partha Bhattacharjee) #8

@Marcel: I suspect I might be doing something wrong about proxy setting. Could you please share some more details about the proxy setting in 1.3 that is working for you.

Where is the gradle.properties file located in your directory structure? In my case it is the root folder of the java project that I am building with gradle.

I am using a Windows box for development. What is your box?

Could you possibly share the exact gradle.properties file perhaps…Just in case I am mistyping something.

As you can tell :slight_smile: it is getting fairly frustrating for me and any help will be appreciated :slight_smile:


(Marcel Overdijk) #9

@Partha

I’ve just there config settings in gradle.properties:

systemProp.http.proxyHost = myproxy.com systemProp.http.proxyPort = 8080 systemProp.http.proxyUser = myusername systemProp.http.proxyPassword = mypassword

I’m also using Windows.


#10

Thanks for the report Marcel. The error message you see printed is actually harmless: it’s a warning emitted by HttpClient. It is not the cause of the resolution problems you are seeing.

I’m assuming that you’re running into GRADLE-2641, which causes the infinite loop you describe. We’ll have a fix out very soon as 1.4-rc-2.

If you run the build with ‘–debug’ you should be able to see the dependency that is repeatedly downloaded. Can you please send the details of the pom file being resolved repeatedly?


#11

Hi Partha. Your issue with 1.3 is not related to the issue Marcel is having with 1.4-rc-1. Can you please create a separate forum posting for your issue?


(Marcel Overdijk) #12

Hi Daz,

The dependency that is downloaded repeatedly is http://repo1.maven.org/maven2/com/google/android/android/4.1.1.4/android-4.1.1.4.pom


(Marcel Overdijk) #13

I tried with 1.4-rc-2 but I see the same behavior (endlessly downloading).

The dependency I have is: compile “com.google.android:android:4.1+”

which results in endlessly downloading http://repo1.maven.org/maven2/com/google/android/android/4.1.1.4/android-4.1.1.4.pom


(Luke Daley) #14

I can’t reproduce this with 1.4-rc-2.

Script:

configurations {
    deps
    }
  repositories {
    mavenCentral()
}
  dependencies {
    deps "com.google.android:android:4.1+"
}
  task thing << {
    println configurations.deps.files
}

(Marcel Overdijk) #15

@Luke are you behind a proxy? I have the feeling it has to do with the proxy. I will also try later today from home without proxy. But weird thing is that in 1.3 it works. Is the http client or something maybe upgraded in 1.4?


(Luke Daley) #16

Nope, no proxy. I don’t believe anything has changed that would affect proxying.


#17

@ Marcel. Unfortunately, it looks like you are hitting a different problem to the one that we fixed for 1.4-rc-2. I can successfully resolve ‘android:4.1.+’ with both 1.4-rc-1 and 1.4-rc-2.

We’re definitely going to need to see your debug log files to work out what’s going on. You can email them to me (darrell.deboer@gradleware.com). Using Luke’s script above, the output of the following commands would be useful:

  • ‘gradle-1.3 --debug --refresh-dependencies thing’ * ‘gradle-1.4-rc-2 --debug --refresh-dependencies thing’

(Marcel Overdijk) #18

I can confirm at home (without proxy) 1.4-rc-2 works as expected. I will try it tomorrow at work again and mail you the output as you mentioned.


(Marcel Overdijk) #19

As @Daz suggested in mail conversation I added

systemProp.http.keepAlive = true

to the gradle.properties and this solved the problem.


(sonosen) #20

I’m having the same problem (NEGOTIATE authentication error: No valid credentials provided (Mechanism level: No valid credentials provided)) with Gradle 1.4 and 1.5.

I’m behind a proxy and using these settings:

systemProp.http.proxyHost=proxy.company.com
systemProp.http.proxyPort=8080
systemProp.http.proxyUser=user
systemProp.http.proxyPassword=password
systemProp.http.nonProxyHosts=localhost
http.auth.ntlm.domain=DOMAIN
systemProp.http.keepAlive=true

The same exact configuration works with Gradle 1.3.

With 1.3 I also get the error message, but only once!

When I switch to 1.4 or 1.5 it gets stuck repeating the authentication error again and again.

Output: Gist