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

Cannot convert name to ASCII #1199

Closed
marvinhagemeister opened this issue May 15, 2017 · 5 comments
Closed

Cannot convert name to ASCII #1199

marvinhagemeister opened this issue May 15, 2017 · 5 comments

Comments

@marvinhagemeister
Copy link

I'm hit by an issue where node-gyp fails when rebuilding java bindings. Tried various different versions of node-gyp, but the issue remains. Strangely it only fails inside the official node-docker images. Locally on my Macbook

Node: 7.10.0 (official docker image)

error /opt/app/node_modules/java: Command failed.
Exit code: 7
Command: sh
Arguments: -c node-gyp rebuild
Directory: /opt/app/node_modules/java
Output:
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp ERR! UNCAUGHT EXCEPTION 
gyp ERR! stack Error: Cannot convert name to ASCII
gyp ERR! stack     at Url.parse (url.js:317:23)
gyp ERR! stack     at urlParse (url.js:75:5)
gyp ERR! stack     at Object.urlResolve [as resolve] (url.js:642:10)
gyp ERR! stack     at processRelease (/usr/local/lib/node_modules/node-gyp/lib/process-release.js:86:19)
gyp ERR! stack     at configure (/usr/local/lib/node_modules/node-gyp/lib/configure.js:37:17)
gyp ERR! stack     at Object.self.commands.(anonymous function) [as configure] (/usr/local/lib/node_modules/node-gyp/lib/node-gyp.js:55:37)
gyp ERR! stack     at run (/usr/local/lib/node_modules/node-gyp/bin/node-gyp.js:87:30)
gyp ERR! stack     at _combinedTickCallback (internal/process/next_tick.js:73:7)
gyp ERR! stack     at process._tickCallback (internal/process/next_tick.js:104:9)
gyp ERR! System Linux 4.9.21-moby
gyp ERR! command "/usr/local/bin/node" "/usr/local/bin/node-gyp" "rebuild"
gyp ERR! cwd /opt/app/node_modules/java
gyp ERR! node -v v7.10.0
gyp ERR! node-gyp -v v3.6.1
gyp ERR! This is a bug in `node-gyp`.
gyp ERR! Try to update node-gyp and file an Issue if it does not help:
gyp ERR!     <https://github.com/nodejs/node-gyp/issues>

Minimal package.json:

{
  "name": "npm-gyp-bug",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "dependencies": {
    "java": "0.8.0"
  }
}

Dockerfile:

FROM node:7.10.0
RUN apt-get update

# Java Version
ENV JAVA_VERSION_MAJOR 8
ENV JAVA_VERSION_MINOR 45
ENV JAVA_VERSION_BUILD 14
ENV JAVA_PACKAGE       jdk

# Download and unarchive Java
RUN curl -jksSLH "Cookie: oraclelicense=accept-securebackup-cookie"\
  http://download.oracle.com/otn-pub/java/jdk/${JAVA_VERSION_MAJOR}u${JAVA_VERSION_MINOR}-b${JAVA_VERSION_BUILD}/${JAVA_PACKAGE}-${JAVA_VERSION_MAJOR}u${JAVA_VERSION_MINOR}-linux-x64.tar.gz \
    | tar -xzf - -C /opt &&\
    ln -s /opt/jdk1.${JAVA_VERSION_MAJOR}.0_${JAVA_VERSION_MINOR} /opt/jdk &&\
    rm -rf /opt/jdk/*src.zip \
           /opt/jdk/lib/missioncontrol \
           /opt/jdk/lib/visualvm \
           /opt/jdk/lib/*javafx* \
           /opt/jdk/jre/lib/plugin.jar \
           /opt/jdk/jre/lib/ext/jfxrt.jar \
           /opt/jdk/jre/bin/javaws \
           /opt/jdk/jre/lib/javaws.jar \
           /opt/jdk/jre/lib/desktop \
           /opt/jdk/jre/plugin \
           /opt/jdk/jre/lib/deploy* \
           /opt/jdk/jre/lib/*javafx* \
           /opt/jdk/jre/lib/*jfx* \
           /opt/jdk/jre/lib/amd64/libdecora_sse.so \
           /opt/jdk/jre/lib/amd64/libprism_*.so \
           /opt/jdk/jre/lib/amd64/libfxplugins.so \
           /opt/jdk/jre/lib/amd64/libglass.so \
           /opt/jdk/jre/lib/amd64/libgstreamer-lite.so \
           /opt/jdk/jre/lib/amd64/libjavafx*.so \
           /opt/jdk/jre/lib/amd64/libjfx*.so

# Prepare java
RUN npm i -g node-gyp

# Set environment
ENV JAVA_HOME /opt/jdk
ENV PATH ${PATH}:${JAVA_HOME}/bin

RUN mkdir -p /opt/app
WORKDIR /opt/app
COPY . /opt/app

# Yarn fails with the full-icu package
RUN npm i full-icu
ENV NODE_ICU_DATA node_modules/full-icu

RUN yarn && yarn build

EXPOSE 8080

CMD ["node", "/opt/app/index.js"]
@bnoordhuis
Copy link
Member

What does /usr/local/bin/node -p process.release print for you inside that docker image?

@refack
Copy link
Contributor

refack commented May 15, 2017

This could also be a ICU error (I've seen the same error Cannot convert name to ASCII \n gyp ERR! stack at Url.parse (url.js:317:23) when ICU is not configured correctly)
I'm not a Docker/Ubuntu expert but maybe this need to be an absolute path. ENV NODE_ICU_DATA node_modules/full-icu

@refack
Copy link
Contributor

refack commented May 15, 2017

Or just before the

# Prepare java
RUN npm i -g node-gyp

Statements.
Retracted... 😕

@marvinhagemeister
Copy link
Author

After some more digging, this seems to be indeed related to icu. Without icu the build runs perfectly fine.

@refack
Copy link
Contributor

refack commented May 15, 2017

I've opened a bug for the obscure error message nodejs/node#13043

bnoordhuis added a commit to bnoordhuis/io.js that referenced this issue May 19, 2017
Call uc_init() after u_setDataDirectory() to find out if the data
directory is actually valid.

This commit removes parallel/test-intl-no-icu-data, added in commit
46345b9 ("src: make --icu-data-dir= switch testable").  It no longer
works now that an invalid --icu-data-dir= argument is rejected.
Coverage is now provided by parallel/test-icu-data-dir.

Fixes: nodejs#13043
Refs: nodejs/node-gyp#1199
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Steven R Loomis <[email protected]>
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

3 participants