Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not ind ivy.xml #292

Open
jchapelle opened this issue Mar 22, 2018 · 21 comments
Open

Could not ind ivy.xml #292

jchapelle opened this issue Mar 22, 2018 · 21 comments

Comments

@jchapelle
Copy link

When trying to install node, yarn and npm with this configuration

node {
    download = true
    version = '8.9.1'
    distBaseUrl = 'https://nodejs.org/dist'
    npmVersion = '5.5.1'
    yarnVersion = '1.5.1'
    nodeModulesDir = file("${project.projectDir}")
}

The following error is received
Could not get resource 'https://nodejs.org/dist/v8.9.1/ivy.xml'.

Indeed, no ivy.xml file exist on nodejs.org website. What's wrong here ? How to fix ?

@f3rdy
Copy link

f3rdy commented May 15, 2018

Could you please give more info on

  • which gradle version you use
  • how your build.gradle looks like
  • complete output

@VBourdine
Copy link

I have the same issue. There you go my build.gradle:

plugins {
    id "com.moowork.node" version "1.2.0"
}

node {
    distBaseUrl = 'https://nodejs.org/dist'
    version = '8.11.2'
    download = true
}

I am trying to run just nodeSetup behind the proxy. The Output looks like:

14:47:41: Executing task 'nodeSetup'...

> Task :nodeSetup
> Task :nodeSetup FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':nodeSetup'.
> Could not resolve all files for configuration ':detachedConfiguration1'.
   > Could not resolve org.nodejs:node:8.11.2.
     Required by:
         project :
      > Could not resolve org.nodejs:node:8.11.2.
         > Could not get resource 'https://nodejs.org/dist/v8.11.2/ivy.xml'.
            > Could not GET 'https://nodejs.org/dist/v8.11.2/ivy.xml'.
               > Connect to nodejs.org:443 [nodejs.org/104.20.23.46, nodejs.org/104.20.22.46] failed: Connection timed out: connect

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 50s
1 actionable task: 1 executed
Connection timed out: connect
14:48:32: Task execution finished 'nodeSetup'.

@inero
Copy link

inero commented Aug 24, 2018

I'm also facing the same kind of issue, any solution/update on this would be great?

@liamsteele
Copy link

This is definitely a proxy issue. It's silently failing to get the dist zip and falling back to trying to get ivy.xml which doesn't exist.

For me, all my proxy settings were correct, but px was timing out for some mysterious reason. Swapping back to using cntlm worked. Using the proxy directly would also likely work.

@aollag09
Copy link

Hi there,

Same problem on my side :(
Any idea how to solve this issue ? This ivy.xml seems to no longer exist in nodejs.org/dist ...

Thanks for your help :) !

14:37:07.077 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong: 14:37:07.077 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':nodeSetup'. 14:37:07.077 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Could not resolve all files for configuration ':detachedConfiguration1'. 14:37:07.077 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Could not resolve org.nodejs:node:8.11.2. 14:37:07.077 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Required by: 14:37:07.077 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] project : 14:37:07.077 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Could not resolve org.nodejs:node:8.11.2. 14:37:07.077 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Could not get resource 'https://nodejs.org/dist/v8.11.2/ivy.xml'. 14:37:07.077 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Could not GET 'https://nodejs.org/dist/v8.11.2/ivy.xml'. 14:37:07.077 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderExcepti on: unable to find valid certification path to requested target

@dhakehurst
Copy link

any progress on this ?

@liamsteele
Copy link

There's not much to do here, it's a proxy issue on your end.

The only progress that could be made on this issue is adding better logging/error messages when it occurs.

@judos
Copy link

judos commented Nov 22, 2019

Had the same issue on one project, other project worked. Only difference was gradle wrapper version.
I now reverted the newer project from gradle 6.0 to gradle 4.10.3 and that works fine ;)
To change gradle wrapper version in your project you can use this cmd:
gradle wrapper --gradle-version=4.10.3

So I think this is related to the ticket: #351

Also note: ivy.xml was a fallback and does not actually exist (saw that when checking the older project where it works for me.)
And secondly "proxy issue" doesn't make sense. Otherwise it would work for all or no projects on the same machine, which is not the case for me.

Hope that gives some insight to many devs suffering from this issue.

@daggerok
Copy link

daggerok commented Dec 5, 2019

are there some plans to fix it?

@tdennler
Copy link

tdennler commented Dec 6, 2019

I have seen this issue as well. The problem is related to some optimization in the gradle repository resolution logic. In gradle 6 the default behavior is to look only for metadata files and not the actual artifact (which is a second HTTP Get). The old behavior can be restored with some additional configuration to the repository definition.

The issue with the node plugin is that for fetching the node artifacts the repository definition is somewhat hard coded in com.moowork.gradle.node.task.SetupTask.addRepository method, which will remove all configured repos for the project, set in a specific repo to use for node resolution, and will restore the project repos later when node is resolved. To restore the old gradle resolution behavior requires a change like the following to this code to have gradle search for both the ivy metadata or the artifact (note the metadataSources enclosure).

    this.repo = this.project.repositories.ivy {
        url distUrl
        layout 'pattern', {
            artifact 'v[revision]/[artifact](-v[revision]-[classifier]).[ext]'
            ivy 'v[revision]/ivy.xml'
        }
        metadataSources {
            ivyDescriptor()
            artifact()
        }
    }

When I added this hack to a copy of the node plugin code and rebuilt it, I was able to get past this issue.

Another solution would be to get the ivy metadata file added for the node artifact in the repo hard coded in the gradle plugin: https://nodejs.org/dist (or point to a repo that has the missing ivy descriptor for this artifact).

@deepy
Copy link

deepy commented Dec 7, 2019

The reason we forked this is because of Gradle 5+ compat, if you can live without grunt/gulp (or can use NpxTask to run them) there's https://github.com/node-gradle/gradle-node-plugin

@daggerok
Copy link

daggerok commented Dec 7, 2019

Hello,

Thank you @deepy for solution! I can confirm that this:

plugins {
    // id("com.moowork.node") version "1.3.1"
    id("com.github.node-gradle.node") version "2.2.0"
}

node {
    download = true
    version = "12.13.1"
    npmVersion = "6.9.0"
    yarnVersion = "1.17.3"
    nodeModulesDir = project.file("ui")
    workDir = project.file("${project.buildDir}/nodejs")
    npmWorkDir = project.file("${project.buildDir}/npm")
    yarnWorkDir = project.file("${project.buildDir}/yarn")
}

and these tasks are working as expected on Gradle 6.0.1:

./gradlew nodeSteup
./gradlew npmSteup
./gradlew npm_i
./gradlew npm_run_build

Regards,
Maksim

gesundkrank added a commit to gesundkrank/mrfoosball that referenced this issue Feb 11, 2020
gesundkrank added a commit to gesundkrank/mrfoosball that referenced this issue Feb 20, 2020
@MrException
Copy link

Thank you @deepy for solution!

@petrabrunner
Copy link

can confirm that @deepy's solution also worked for me. thx!
Thx @daggerok for testing and posting!

@Yachin
Copy link

Yachin commented Apr 24, 2020

The reason we forked this is because of Gradle 5+ compat, if you can live without grunt/gulp (or can use NpxTask to run them) there's https://github.com/node-gradle/gradle-node-plugin

Hi, what should I do if our project use gulp?
apply plugin:'com.moowork.gup' node{ download = true version='11.15.0' }

It cannot find ivy.xml and node-v11.15.0-linux-x86.tar.gz
I am running on Windows 10 with JDK 8 (64 bit) and JAVA runtime (64 bit)

Thank you.

@deepy
Copy link

deepy commented Apr 24, 2020

How reliant on gulp are you? Could you use gulp through npx as a workaround?

@Yachin
Copy link

Yachin commented Apr 24, 2020

How reliant on gulp are you? Could you use gulp through npx as a workaround?

@deepy
The project used to run fine for my Windows machine. Till we added

  • npm_run_build.mustRunAfter gulp_html
  • processResources.dependsOn gulp_html

do you know where I can find implementation documents about npx? Thank you!

jk497 added a commit to jk497/cicd-pipeline-train-schedule-cd that referenced this issue Mar 18, 2023
Attempt to fix build issue by using gradle node plugin as recommended here srs/gradle-node-plugin#292
@ovflowd
Copy link

ovflowd commented Mar 22, 2023

Hey there 👋 Node.js team here.

This behaviour was introduced with nodejs/build#3223 so that y'all can track why this is happening now. Note that is expected behaviour. And that this #292 (comment) comment above is a proper fix for the issue.

Extra details are also available here nodejs/nodejs.org#5149 (comment)

@shilan
Copy link

shilan commented Apr 20, 2023

Adding the ,plugin I still get the same error. Could it be because I am using node version 10 and that is not supported anymore?

@deepy
Copy link

deepy commented Apr 20, 2023

You need Gradle 4.5 or newer, if you cannot upgrade from Gradle 4 I recommend you upgrade to the latest Gradle 4.10.3

@Houinside
Copy link

Hi guys, change distBaseUrl like this:

node {
  ...
  distBaseUrl = 'https://direct.nodejs.org/dist/'
  ...
}

ref from nodejs/nodejs.org#5149 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests