Closed fabianbru closed 3 years ago
@fabianbru sorry I missed this issue the other day. I don't understand the full picture so will try to confirm it with you:
package.json
package.json
and not yarn.lock
Please confirm if the above are correct. Please also try the dashboard again and search for any reference of "npmrc".
When you say it's a yarn monorepo, are you using Yarn Workspaces?
BTW you also mention:
private packages with NPM_TOKEN
Is there any reason you mention NPM_TOKEN? I don't think there's anything to do with the NPM_TOKEN environment variable here, and if so then the above 6 points are incomplete. I thought that the token was embedded in the npmrc
field.
You summed it up very well, sorry that I relayed on the other issue.
package.json
and the artifact (yarn.lock
) fails on generation. My assumption is, that for this step (yarn install
?) the saved npmrc
content is missing.And yes, I am using yarn workspaces.
Is there any reason you mention NPM_TOKEN? I don't think there's anything to do with the NPM_TOKEN environment variable here, and if so then the above 6 points are incomplete. I thought that the token was embedded in the npmrc field.
There is no NPM_TOKEN variable, just the encrpted npmrc
to clarify this. Tokens are embedded, yes.
Here are the logs from the dashboard (#59788077): Notes:
@fortawesome/pro-light-svg-icons
(see https://fontawesome.com/how-to-use/on-the-web/setup/using-package-managers -> "Installing the Pro version of Font Awesome" -> "Per-Project")DEBUG: processBranch with 2 upgrades(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: getBranchPr(renovate/font-awesome)(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: findPr(renovate/font-awesome, null, open)(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: Found PR renovatebot/renovate#717(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: Returning from graphql open PR list(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: branchExists=true(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: Branch has 2 upgrade(s)(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: Checking if PR has been edited(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: Found existing branch PR(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: Checking schedule(before 3am on Monday, CET)(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: Found timezone(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
{
"timezone": "CET"
}
DEBUG: Adjusting now for timezone(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: Checking 1 schedule(s)(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: Checking schedule "before 3am on Monday"(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
{
"parsedSchedule": {
"schedules": [
{
"t_b": [
10800
],
"d": [
2
]
}
],
"exceptions": [],
"error": -1
}
}
DEBUG: Does not match schedule because Saturday is not in Monday(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: Package not scheduled(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: Branch + PR exists but is not scheduled -- will update if necessary(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: Branch already exists(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: getBranchPr(renovate/font-awesome)(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: findPr(renovate/font-awesome, null, open)(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: Found PR renovatebot/renovate#717(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: Returning from graphql open PR list(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
INFO: Manual rebase requested via PR checkbox for renovatebot/renovate#717(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: Using parentBranch: undefined(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: manager.getUpdatedPackageFiles()(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: npm.updateDependency(): dependencies.@fortawesome/fontawesome-svg-core = 1.2.17(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: Replacing "1.2.14" with "1.2.17" at index 2134(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: bumpVersion()(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: Updating packageFile content(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: npm.updateDependency(): dependencies.@fortawesome/pro-light-svg-icons = 5.8.1(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: Replacing "5.7.1" with "5.8.1" at index 2184(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: bumpVersion()(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: Updating packageFile content(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: Updated 1 package files(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: Getting updated lock files(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: lock file dirs(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
{
"dirs": {
"yarnLockDirs": [
"yarn.lock"
],
"npmLockDirs": [],
"pnpmShrinkwrapDirs": [],
"lernaDirs": []
}
}
DEBUG: Writing repo lerna.json (/mnt/renovate/gh/ORGANISATION/REPO)(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: Writing repo .npmrc (/mnt/renovate/gh/ORGANISATION/REPO)(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: Writing package.json files(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
{
"packageFiles": [
"package.json",
"packages/package1/package.json",
"packages/package2/package.json"
]
}
DEBUG: Writing yarn.lock(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: Writing any updated package files(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: Writing packages/lead-overview/package.json(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: Generating yarn.lock for .(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: Spawning yarn install to create /mnt/renovate/gh/ORGANISATION/REPO/yarn.lock(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: Using yarn: node /home/ubuntu/renovateapp/node_modules/yarn/bin/yarn.js(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
INFO: lock file error(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
{
"cmd": "node /home/ubuntu/renovateapp/node_modules/yarn/bin/yarn.js",
"err": {
"name": "ChildProcessError",
"code": 1,
"childProcess": {},
"stdout": "yarn install v1.15.2\n[1/4] Resolving packages...\ninfo Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.\n",
"stderr": "error Couldn't find package \"@fortawesome/pro-light-svg-icons@5.8.1\" required by \"@myMonorepo/package1@5.3.1\" on the \"npm\" registry.\n",
"message": "Command failed: node /home/ubuntu/renovateapp/node_modules/yarn/bin/yarn.js install --ignore-scripts --ignore-engines --ignore-platform --mutex network:31879\nerror Couldn't find package \"@fortawesome/pro-light-svg-icons@5.8.1\" required by \"@myMonorepo/package1@5.3.1\" on the \"npm\" registry.\n `node /home/ubuntu/renovateapp/node_modules/yarn/bin/yarn.js install --ignore-scripts --ignore-engines --ignore-platform --mutex network:31879` (exited with error code 1)",
"stack": "ChildProcessError: Command failed: node /home/ubuntu/renovateapp/node_modules/yarn/bin/yarn.js install --ignore-scripts --ignore-engines --ignore-platform --mutex network:31879\nerror Couldn't find package \"@fortawesome/pro-light-svg-icons@5.8.1\" required by \"@myMonorepo/package1@5.3.1\" on the \"npm\" registry.\n `node /home/ubuntu/renovateapp/node_modules/yarn/bin/yarn.js install --ignore-scripts --ignore-engines --ignore-platform --mutex network:31879` (exited with error code 1)\n at callback (/home/ubuntu/renovateapp/node_modules/child-process-promise/lib/index.js:33:27)\n at ChildProcess.exithandler (child_process.js:301:5)\n at ChildProcess.emit (events.js:182:13)\n at ChildProcess.EventEmitter.emit (domain.js:441:20)\n at maybeClose (internal/child_process.js:962:16)\n at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)"
},
"type": "yarn"
}
DEBUG: No updated lock files in branch(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: Branch timestamp: 2019-03-21T21:27:45.206Z(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
INFO: PR is older than a day, raise PR with lock file errors(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: 1 file(s) to commit(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: Checking if we can automerge branch(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: mergeStatus=no automerge(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: Ensuring PR(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: There are 0 errors and 0 warnings(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: getBranchPr(renovate/font-awesome)(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: findPr(renovate/font-awesome, null, open)(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: Found PR renovatebot/renovate#717(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: Returning from graphql open PR list(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: Found existing PR(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: Forcing PR because of artifact errors(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: getChangeLogJSON(args)(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
{
"args": {
"manager": "npm",
"versionScheme": "npm",
"depType": "dependencies",
"depName": "@fortawesome/fontawesome-svg-core",
"fromVersion": "1.2.14",
"toVersion": "1.2.17",
"sourceUrl": "https://github.com/FortAwesome/Font-Awesome"
}
}
DEBUG: getChangeLogJSON(args)(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
{
"args": {
"manager": "npm",
"versionScheme": "npm",
"depType": "dependencies",
"depName": "@fortawesome/pro-light-svg-icons",
"fromVersion": "5.7.1",
"toVersion": "5.8.1",
"sourceUrl": "https://github.com/FortAwesome/Font-Awesome"
}
}
DEBUG: Processing existing PR(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: updatePr(717, chore(deps): update font awesome, body)(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: PR updated(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
{
"pr": 717
}
INFO: PR updated(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
{
"committedFiles": true,
"pr": 717
}
WARN: artifactErrors(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
{
"artifactErrors": [
{
"lockFile": "yarn.lock",
"stderr": "error Couldn't find package \"@fortawesome/pro-light-svg-icons@5.8.1\" required by \"@myMonorepo/package1@5.3.1\" on the \"npm\" registry.\n"
}
]
}
DEBUG: Getting comments for renovatebot/renovate#717(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: Found 2 comments(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: Ensuring comment ":warning: Artifact update problem" in renovatebot/renovate#717(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: Comment is already update-to-date(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: Ensuring comment ":warning: Lock file problem" in renovatebot/renovate#717 is removed(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: Getting comments for renovatebot/renovate#717(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: Found 2 comments(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
DEBUG: Updating status check state to failed(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
INFO: Setting branch status(dependencies=["@fortawesome/fontawesome-svg-core","@fortawesome/pro-light-svg-icons"], branch="renovate/font-awesome")
{
"context": "renovate/artifacts",
"state": "failure"
}
Is there authentication needed for both npmjs private modules as well as a private registry? Are both tokens in the encrypted npmrc?
And yes I agree that most likely cause is that yarn is not getting all the information it needs from .npmrc
Is there authentication needed for both npmjs private modules as well as a private registry? Are both tokens in the encrypted npmrc?
Yes, I need auth tokens for both. One for the official npm registry and another one for the custom registry. My npmrc content looks like (NPM_TOKENS are embedded):
//registry.npmjs.org/:_authToken=ABC-123-NPM_TOKEN1
@fortawesome:registry=https://npm.fontawesome.com/
//npm.fontawesome.com/:_authToken=ABC-123-NPM_TOKEN2
The content is correct, because I get the PRs with new versions. You fixed an issue related to this in renovatebot/renovate#3417 (the issue I mentioned above).
Is it pure yarn workspaces or lerna wrapping it?
Next step is to understand:
.npmrc
in order for this to work? Eg root or repo only or in same directory as every package.json?I suspect we need the npmrc everywhere and right now we’re only writing it to the root
We have lerna included, but using it only for starting scripts and managing versions.
Locally we have only one .npmrc
file in the project root with similar content as mentioned above, only the tokens are referenced from the environment and are not embedded.
The logs indicate that the npmrc is being written to the root of the repo and yarn being run from the root too. I am not sure if the logs tell us enough to know if the lookup attempt is from the fontawesome registry or the regular npmjs one. If indeed it’s looking up from the right one then it indicate the authentication (token) is wrong.
If indeed it’s looking up from the right one then it indicate the authentication (token) is wrong.
The token is correct, because renovate is creating the PR for this package. If the token is not correct renovate would not be able to get new versions for this package.
Do you have some new insights?
@fabianbru I want to take another stab at this with fresh eyes. Summarising below.
npm credentials are used in two places:
Your .npmrc
credentials would be considered "correct" if Renovate successfully uses them to look up a private module off npmjs.org as well as the font awesome. Ideally we should have observed an example of updates being found for both, however the absence of error logs should also essentially prove it.
Assuming that's the case, we need to answer why Yarn is failing. Are we writing the .npmrc
correctly? Do we need to write it in more than one place? Are we somehow corrupting it before writing?
One question I'm not sure if we asked/answered previously: are there any .npmrc
files or .yarnrc
files checked into the repository?
One question I'm not sure if we asked/answered previously: are there any
.npmrc
files or.yarnrc
files checked into the repository?
Yes, there is a .npmrc
file checked into the repo. The content is simlar to the encrypted npmrc
string, but the npm tokens are not embedded. So our .npmrc
file:
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
@fortawesome:registry=https://npm.fontawesome.com/
//npm.fontawesome.com/:_authToken=${NPM_FONTAWESOME_TOKEN}
In the renovate.json
there is also the line "ignoreNpmrcFile": true
.
So in theory we need to replace the .npmrc
in your repository with the decrypted one from your config, and everything should work?
It's possible that this is caused by the migration to gitFs, however I thought that particular problem was already handled.
Can you do this for me?
The PR got autoclosed 2 hours ago.
INFO: Failed to look up dependency @fortawesome/angular-fontawesome (@fortawesome/angular-fontawesome)(packageFile="packages/package1/package.json", dependency="@fortawesome/angular-fontawesome")
INFO: Failed to look up dependency @fortawesome/pro-light-svg-icons (@fortawesome/pro-light-svg-icons)(packageFile="packages/package1/package.json", dependency="@fortawesome/pro-light-svg-icons")
INFO: Failed to look up dependency @fortawesome/fontawesome-svg-core (@fortawesome/fontawesome-svg-core)(packageFile="packages/package1/package.json", dependency="@fortawesome/fontawesome-svg-core")
I restored it and checked the renovate rebase checkbox. It run through and found those packages again, but same "Artifact update problem" as we know it.
Edit: And I emailed you the infos earlier today.
This line confirms that Renovate itself is using the right/valid credentials with the fortawesome npm server:
"dependency":"@fortawesome/pro-light-svg-icons","msg":"1 result(s): 5.8.1"
These pro icons aren't present on registry.npmjs.org so would otherwise error.
Later, the call to yarn
reports: error Couldn't find package "@fortawesome/pro-light-svg-icons@5.8.1" required by "@velux/lead-overview@5.3.2" on the "npm" registry.
I'm trying to determine if that's looking up from npmjs or fortawesome. When I create a basic package.json
with that dependency included then I see this error instead: error An unexpected error occurred: "https://registry.yarnpkg.com/@fortawesome%2fpro-light-svg-icons: Not found".
.
Now, setting a .npmrc
like yours but with fake/wrong token for fortawesome, I reproduce almost the same error you got: error Couldn't find package "@fortawesome/pro-light-svg-icons" on the "npm" registry.
My best guess now is that somehow the existing .npmrc
is being used rather than the override that's configured. I'll try to reproduce that.
I am also seeing this error, running self hosted renovate. I've tried it with just an npmrc in the config, and also with a yarnrc, pointing at our private repo.
The funny thing is that it works on my local machine, but not when I run it on jenkins.
I should note, that on the Jenkins machine, when I run it, there is an .npmrc file that is configured to point at our private registry, and it doesn't work.
So, I was running renovate via a script in the package.json file of my project, and I was using yarn to run the script on the server. When I changed it to call renovate directly in the Jenkinsfile, it works.
So basically, running renovate via a package.json script started from yarn causes an artifact update error somehow.
@rarkins
I think these are obviously "related" issues but probably separate problems/solutions to each other. In @gordlea's case it sounds like running the script via yarn causes the "current" .npmrc values to be loaded and passed through and these must somehow be taking precedence.
We're giving Renovate a try on some of our Repos and we've noticed this issue, or a very similar one, appears to be present.
.npmrc
in the repo that utilizes environment substitution, so we want to override it with one that has values substituted in..npmrc
with tokens for a private registry defined within renovate.jsonyarn.lock
is regenerated, it fails with error Couldn't find package "@abc/def" on the "npm" registry.
Using the .npmrc
we've encrypted for Renovate in the repo locally works fine and is able to fetch packages.
I'll give the self-hosted runner a try with a similar setup, see if I can debug any further and report back.
EDIT:
The self-hosted edition works fine when running on my local machine and correctly regenerates the yarn.lock
file. The results of yarn config list
are also correct.
I'm not sure how I'd get to something closer to the Hosted App's environment in order to replicate. - Any ideas?
@Geit maybe I can do some troubleshooting or increased logging from the app side. Perhaps could you create a new/dedicated repo for reproducing this in the app, if you don't have one already? i.e. that way you're not holding up or polluting any real repo with troubleshooting.
Once you've done that, please tell me the repo name or job ID (preferred) of when the problem occurred so that I can take a look.
It sounds like Renovate is failing to write the correct .npmrc
file to disk before running yarn
.
I've seen such auth problems too on our self-hosted renovate cli (docker-slim).
We have a .npmrc
and .yarnrc
file in our repo root. I've tried to configure the npmrc
renovate config option to add auth, which doesn't work. My workaround is to add a .npmrc
with the auth to /home/ubuntu/
As i tried the last time we need to use username and password auth (against proget npm registry), maybe that was a problem too. now we use verdaccio.
Thanks for the prompt reply @rarkins - I've created a small reproduction repo and attached it to the Renovate hosted application. The job ID for its first run was #147251406 and I've also added you as a collaborator to the repo on the off chance that helps.
Hi guys, we encounter the exact same issue using a private registry hosted by us (verdaccio) with the public renovate app:
.npmrc
/.yarnrc
file and is not a monorepoArtifact update problem
related to yarn.lock
update
- then on each renovate PR we encounter the
Artifact update problem
related toyarn.lock
update
I'm experiencing the same issue with verdaccio and a self hosted GitLab instance.
Hi guys,
we encounter the exact same issue using a private registry hosted on Github packages
with the public renovate app:
.npmrc
is configured through an encrypted npmrc
string in the renovate.json
file,Artifact update problem
related to yarn.lock
updateAny update on this problem?
Thanks 🙏
We recommend to use hostrules only instead of npmrc. That way we got most auth issues resolved.
Please open a discussion with detailed reproduction steps. Or search discussions / docs. There are plenty of samples for different registries.
We are also planning to remove npmrc config option at all. So renovate would only read repo npmrc for registry urls.
I'm going to archive this repository so that we have conversations in one place. Therefore please create an "App Support" discussion here if this problem or suggestion is still relevant: https://github.com/renovatebot/renovate/discussions
What Renovate type are you using? Renovate GitHub App
Describe the bug Private packages or packages from custom registries are not found in the "artifacts" step. So the renovate PR will have the ":warning: Artifact update problem" warning and the failing check "renovate/artifacts".
I have submitted a bug some time ago for issues with those packages (private or custom registry) in the "find new version" step, see renovatebot/renovate#3417. Perhaps this is related?
For what it looks like is that in the "artifacts" step the (encrypted) ".npmrc" content is not used, so no NPM_TOKEN or custom registry?
Notes:
Did you see anything helpful in debug logs? The Dashboard doesn't work at the moment (will update if its working again), but last I looked into there was nothing helpful. Just the warning that is also in the PR comment:
To Reproduce See issue renovatebot/renovate#3417. Same setup and same encrypted ".npmrc". After that issue was resolved renovate found new versions, but on my scheduled time the issue above happened.
Expected behavior Artifacts should be build correctly ("yarn.lock") for private packages with NPM_TOKEN or packages from custom registries.