Skip to content
New issue

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

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

Already on GitHub? # to your account

ens-normalize dependency requires git #4071

Closed
envin3 opened this issue May 22, 2023 · 9 comments
Closed

ens-normalize dependency requires git #4071

envin3 opened this issue May 22, 2023 · 9 comments
Assignees
Labels
bug Verified to be an issue. fixed/complete This Bug is fixed or Enhancement is complete and published. v6 Issues regarding v6

Comments

@envin3
Copy link

envin3 commented May 22, 2023

Ethers Version

6.4.0

Search Terms

git, ens, package.json, dep

Describe the Problem

In 6.4.0 @adraffy/ens-normalize points to https://github.com/ricmoo/ens-normalize.js requiring to have git and a PK to github available:

"@adraffy/ens-normalize": "https://github.com/ricmoo/ens-normalize.js",

In our application we are deploying in docker and we can't have a github PK inside for security reasons.
Is there a specific reason why this is done?

Code Snippet

WORKDIR $FOLDER_APP

COPY package.json .

RUN npm install ../constants ../utils && \
    echo '{}' > $FOLDER_APP/config.json && \
    chown -R node:node $FOLDER_APP

COPY --chown=node:node lib $FOLDER_APP/lib
COPY --chown=node:node index.js $FOLDER_APP/

Contract ABI

No response

Errors

       #10 9.971 npm ERR! code 128
       #10 9.973 npm ERR! An unknown git error occurred
       #10 9.973 npm ERR! command git --no-replace-objects ls-remote ssh://git@github.com/ricmoo/ens-normalize.js.git
       #10 9.973 npm ERR! Warning: Permanently added 'github.com,140.82.121.3' (ECDSA) to the list of known hosts.
       #10 9.973 npm ERR! git@github.com: Permission denied (publickey).
       #10 9.973 npm ERR! fatal: Could not read from remote repository.
       #10 9.973 npm ERR!
       #10 9.974 npm ERR! Please make sure you have the correct access rights
       #10 9.974 npm ERR! and the repository exists.
       #10 9.976
       #10 9.976 npm ERR! A complete log of this run can be found in:
       #10 9.976 npm ERR!     /root/.npm/_logs/2023-05-22T14_21_45_777Z-debug-0.log
       #10 ERROR: process "/bin/sh -c npm install ../constants ../utils &&     echo '{}' > $FOLDER_APP/config.json &&     chown -R node:node $FOLDER_APP" did not complete successfully: exit code: 128
       ------
        > [6/8] RUN npm install ../constants ../utils &&     echo '{}' > /usr/src/app/config.json &&     chown -R node:node /usr/src/app:
       #10 9.973 npm ERR! command git --no-replace-objects ls-remote ssh://git@github.com/ricmoo/ens-normalize.js.git
       #10 9.973 npm ERR! Warning: Permanently added 'github.com,140.82.121.3' (ECDSA) to the list of known hosts.
       #10 9.973 npm ERR! git@github.com: Permission denied (publickey).
       #10 9.973 npm ERR! fatal: Could not read from remote repository.
       #10 9.973 npm ERR!
       #10 9.974 npm ERR! Please make sure you have the correct access rights
       #10 9.974 npm ERR! and the repository exists.

Environment

No response

Environment (Other)

docker

@envin3 envin3 added investigate Under investigation and may be a bug. v6 Issues regarding v6 labels May 22, 2023
@envin3 envin3 changed the title Dependecies requires git ens-normalize dependency requires github PK May 22, 2023
@envin3 envin3 changed the title ens-normalize dependency requires github PK ens-normalize dependency requires github May 22, 2023
@envin3 envin3 changed the title ens-normalize dependency requires github ens-normalize dependency requires git May 22, 2023
@envin3
Copy link
Author

envin3 commented May 22, 2023

The issue can be solved by not using --no-install-recommends when installing git in the image. This however adds more than 100mb of dependencies which is not ideal.

@ricmoo
Copy link
Member

ricmoo commented May 22, 2023

Oh wow. I didn’t realize it would pull that in.

This is temporary until I verify that it doesn’t cause any issues with bundlers, and I’ll get the fix ported upstream with Raffy’s library.

Thanks for the info!

@pablomendezroyo
Copy link

This makes any app crashing when running with npx

npx library 

....
npm verb exit 1
npm verb unfinished npm timer reify 1684840339473
npm verb unfinished npm timer reify:unpack 1684840341873
npm verb unfinished npm timer reifyNode:node_modules/@adraffy/ens-normalize 1684840341880
npm verb code 1

@pablomendezroyo
Copy link

The issue seems to be havin a dependency a github link "@adraffy/ens-normalize": "https://github.com/ricmoo/ens-normalize.js",

@ricmoo
Copy link
Member

ricmoo commented May 25, 2023

I've opened a PR to address this upstream and will follow up with Raffy.

@ricmoo ricmoo added bug Verified to be an issue. on-deck This Enhancement or Bug is currently being worked on. and removed investigate Under investigation and may be a bug. labels May 25, 2023
@ShookLyngs
Copy link

ShookLyngs commented Jun 1, 2023

I have encountered the same error in Vercel Preview Deployments after relying ethers@6.4.0 in the project, is this the reason?

pnpm: Command failed with exit code 128: git fetch --depth 1 origin 2d040533e57e4f25f9a7cc4715e219658ad454b5
--
16:35:42.383 | Host key verification failed.
16:35:42.384 | fatal: Could not read from remote repository.
16:35:42.384 |  
16:35:42.384 | Please make sure you have the correct access rights
16:35:42.384 | and the repository exists.
16:35:42.384 | at makeError (/pnpm8/node_modules/pnpm/dist/pnpm.cjs:24242:17)
16:35:42.384 | at handlePromise (/pnpm8/node_modules/pnpm/dist/pnpm.cjs:24813:33)
16:35:42.384 | at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
16:35:42.384 | at async gitFetcher (/pnpm8/node_modules/pnpm/dist/pnpm.cjs:113561:11)
16:35:42.384 | at async fetcher (/pnpm8/node_modules/pnpm/dist/pnpm.cjs:126170:16)
16:35:42.385 | at async run (/pnpm8/node_modules/pnpm/dist/pnpm.cjs:125557:23)
16:35:42.465 | Error: Command "pnpm install" exited with 1

The resolution commit hash in pnpm-lock file is matched:

  github.com/ricmoo/ens-normalize.js/2d040533e57e4f25f9a7cc4715e219658ad454b5:
    resolution: {commit: 2d040533e57e4f25f9a7cc4715e219658ad454b5, repo: git+ssh://git@github.com/ricmoo/ens-normalize.js.git, type: git}
    name: '@adraffy/ens-normalize'
    version: 1.9.0
    dev: false

@kirbyfly
Copy link

kirbyfly commented Jun 4, 2023

Can we just reference the latest version of ens-normalize?

@ricmoo
Copy link
Member

ricmoo commented Jun 6, 2023

This should be fixed in v6.4.2. Can you try it out and let me know if you still have any problems?

@ricmoo ricmoo added fixed/complete This Bug is fixed or Enhancement is complete and published. and removed on-deck This Enhancement or Bug is currently being worked on. labels Jun 6, 2023
@ricmoo
Copy link
Member

ricmoo commented Jun 8, 2023

Closing this now as it should be fixed, but please re-open if you still experience any problems.

Thanks! :)

@ricmoo ricmoo closed this as completed Jun 8, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Verified to be an issue. fixed/complete This Bug is fixed or Enhancement is complete and published. v6 Issues regarding v6
Projects
None yet
Development

No branches or pull requests

5 participants