Failing to replace ${NPM_AUTH} variable #725
Comments
Renovate uses NPM_TOKEN. Can you switch to that? |
Oh!! Okay thanks. I'm trying it out.
Ignore the Jenkins logs -- But if this works, then in the PR, what am I supposed to expect? I mean how can I verify if this is resolved? |
You should see the artifacts error log comment removed from the PR |
Okay. I still see the same error in the logs and the error log is not removed from the comment.
|
And I still see NPM_AUTH in your logs, so I'm not surprised |
Nope, it is removed from the renovate bot's repo. Nowhere it is referenced as NPM_AUTH. But in the abc repository, it is referenced in .npmrc. Is the bot reading that .npmrc file and throwing this error? If yes, how can we avoid this? Because the NPM_AUTH is called in abc repo and if that needs to be changed, then I guess there are lot of files to touch upon. |
Yes, it's being read from every repository you run Renovate in. You can try setting |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed soon if no further activity occurs. |
Hi @rarkins sorry for the delay in testing it out. I have added ignoreNpmrcFile=true in renovate.json (in the abc repository). Also, in the renovate bot repository, I have a renovate.json file and there is an entry for ignoreNpmrcFile=true . I see the same issue.
renovate.json in renovate-bot repository renovate.json in abc repository |
@nimmoadam If you configure the same env var Did you have a @rarkins I think we have a bug somehow, so |
Hi @viceice -- To make myself clear:
Please correct me if am wrong. What is the next thing that I can try to resolve this? Thanks!! |
Renovate will only replace the token in npmrc while decrypt so you should configure you {
npmrc: `_auth=${process.env.NPM_AUTH}\nregistry=<URL>\nalways-auth=true`
} or call renovate like (not sure it will work): renovate --npmrc "_auth=${NPM_AUTH}\nregistry=<URL>\nalways-auth=true" you you don't need to hardcode the token to your repo. can you please share your current |
My config.js will only have the list of repo for scanning. (in renovate bot repo)
renovate.json (in renovate bot repo) - all the renovate configurations are done in the respective repositories
.npmrc (in renovate bot repo)
renovate.sh script (in renovate bot repo) - This script will be triggered to run the bot.
JenkinsFile (in renovate bot repo)
What does this mean?
|
Where do you plan to supply the token? e.g. env or CLI? |
Updated the previous comment - #725 (comment) |
Cwd is the current working directory. I guess it's the path to the renovate git repo checkout on Jenkins build. As you already configure a hostRule for npm, you simply need to add |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed soon if no further activity occurs. |
Hi, thanks. I did the changes and I don't see this exception in the Jenkins logs any more.
But I have the concern. I am not sure if this worked. because the PRs are auto-closed without merging. Why does it auto-close the PRs? There are many such PRs that are auto-closed without merging. How to resolve this?
Console logs
|
Autoclosing indicates that Renovate itself fails to do a lookup for these packages (prior to any attempt to update the lock file). |
Yea so, this means it won't look up for those packages again? How to resolve this? How do we know, if the NPM has authenticated successfully? |
You need to look at the debug logs at extraction phase |
Yeah. I see the errors now. But I get both 401 and 403.
What is missing in the configuration? renovate.json
config.js
|
@nimmoadam remove |
I did, but it doesn't make any difference. Does the auth code need to be encrypted or something? In the target repo (abc repo), I have this renovate.json This error in the console log.
|
@nimmoadam Are you sure You also need to add a trailing newline
|
@viceice Sorry to bother. But I have tried whatever I can and this error never got resolved. In the renovate-bot repository, I have this under .npmrc
In the renovate-bot repository, the jenkinsfile contains
In the renovate-bot repository, config.js has this
In the renovate-bot repository, renovate.json has
in renovate-bot repository, renovate.sh is the one which does the work.
In target repo (abc repository), I have renovate.json which contains
and one .npmrc like this
It gets stuck here.
In the Jenkins console logs, I had echo-ed the token and I can see NPM_TOKEN as *****. This is from Jenkins console.
Am unable to proceed after this. Can you make this work somehow? Thanks! |
What do you mean by external / internal here? |
Internal dependency = the one hosted inside the premises. External - for ex: Central Maven or the public repo. |
Renovate doesn't have the ability to know what's internal or external. In most cases your configuration of |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed soon if no further activity occurs. |
Which Renovate are you using?
Renovate Open Source CLI
Other (please write below)
Which platform are you using?
GitHub Enterprise
Have you checked the logs? Don't forget to include them if relevant
What would you like to do?
Renovate Bot is set up and it works fine until I have added repositories with npm dependencies. So, I have a few repositories with package.json file.
Configuration
I have a separate repository for renovate bot, where I have config.js and jenkinfile and a renovate.sh script to trigger the bot.
Note -
In jenkinsfile, NPM_AUTH value is called and when the job runs I see this in the console logs.
In config.js - It will only the list of repo to be scanned.
which has host-rules for authenticating with maven and docker artifactories.
So in this file, I have added an entry for authenticating NPM. - IT DIDN"T WORK (I saw the exception that I passed above)
Problem is, there are other env variables that are called from jenkinsfile. They are all getting replaced properly, except NPM_AUTH.
So in both the approaches, I am getting the same issue.
Should the value NPM_AUTH needs to be called from somewhere else? or Am I missing something else?
Can you please help in resolving this issue. Thanks!
The text was updated successfully, but these errors were encountered: