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

Nix lockFileMaintenance is broken #713

Closed
budimanjojo opened this issue Mar 19, 2023 · 12 comments · Fixed by #737
Closed

Nix lockFileMaintenance is broken #713

budimanjojo opened this issue Mar 19, 2023 · 12 comments · Fixed by #737
Labels
bug Something isn't working

Comments

@budimanjojo
Copy link

How are you running Renovate?

Self-hosted

If you're self-hosting Renovate, tell us what version of Renovate you run.

No response

If you're self-hosting Renovate, select which platform you are using.

github.com

If you're self-hosting Renovate, tell us what version of the platform you run.

No response

Was this something which used to work for you, and then stopped?

It used to work, and then stopped

Describe the bug

I'm using GitHub Action to run Renovate, it's been 2 weeks that I haven't got a flake.lock PR from renovate so I decided to take a look. Seems like there's a problem with the buildpack docker container. Below is the relevant log that I suspect is causing the problem.

Relevant debug logs

2023-03-19T01:41:16.3827385Z  WARN: Error updating flake.lock (repository=budimanjojo/dotfiles, branch=renovate/lock-file-maintenance)
2023-03-19T01:41:16.3827791Z        "err": {
2023-03-19T01:41:16.3828233Z          "cmd": "/bin/sh -c install-tool nix 2.14.1",
2023-03-19T01:41:16.3842632Z          "stderr": "terminate called after throwing an instance of 'nix::Error'\n  what():  \u001b[31;1merror:\u001b[0m cannot determine user's home directory\n/usr/local/bin/nix: line 6:   141 Aborted                 (core dumped) /opt/buildpack/tools/nix/2.14/bin/nix \"$@\"\n",
2023-03-19T01:41:16.3843237Z          "stdout": "installing v2 tool nix v2.14\nlinking tool nix v2.14\n",
2023-03-19T01:41:16.3843542Z          "options": {
2023-03-19T01:41:16.3843841Z            "cwd": "/tmp/renovate/repos/github/budimanjojo/dotfiles",
2023-03-19T01:41:16.3844186Z            "encoding": "utf-8",
2023-03-19T01:41:16.3844413Z            "env": {
2023-03-19T01:41:16.3844627Z              "HOME": "/home/ubuntu",
2023-03-19T01:41:16.3845463Z              "PATH": "/home/ubuntu/.cargo/bin:/home/ubuntu/.local/bin:/go/bin:/home/ubuntu/bin:/home/ubuntu/.npm-global/bin:/home/ubuntu/.cargo/bin:/home/ubuntu/.local/bin:/go/bin:/home/ubuntu/bin:/home/ubuntu/.npm-global/bin:/home/ubuntu/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
2023-03-19T01:41:16.3846025Z              "LC_ALL": "C.UTF-8",
2023-03-19T01:41:16.3846306Z              "LANG": "C.UTF-8",
2023-03-19T01:41:16.3846610Z              "BUILDPACK_CACHE_DIR": "/tmp/renovate/cache/containerbase",
2023-03-19T01:41:16.3846977Z              "CONTAINERBASE_CACHE_DIR": "/tmp/renovate/cache/containerbase"
2023-03-19T01:41:16.3847257Z            },
2023-03-19T01:41:16.3847482Z            "maxBuffer": 10485760,
2023-03-19T01:41:16.3847715Z            "timeout": 900000
2023-03-19T01:41:16.3847930Z          },
2023-03-19T01:41:16.3848140Z          "exitCode": 134,
2023-03-19T01:41:16.3848358Z          "name": "ExecError",
2023-03-19T01:41:16.3849295Z          "message": "Command failed: install-tool nix 2.14.1\nterminate called after throwing an instance of 'nix::Error'\n  what():  \u001b[31;1merror:\u001b[0m cannot determine user's home directory\n/usr/local/bin/nix: line 6:   141 Aborted                 (core dumped) /opt/buildpack/tools/nix/2.14/bin/nix \"$@\"\n",
2023-03-19T01:41:16.3851178Z          "stack": "ExecError: Command failed: install-tool nix 2.14.1\nterminate called after throwing an instance of 'nix::Error'\n  what():  \u001b[31;1merror:\u001b[0m cannot determine user's home directory\n/usr/local/bin/nix: line 6:   141 Aborted                 (core dumped) /opt/buildpack/tools/nix/2.14/bin/nix \"$@\"\n\n    at ChildProcess.<anonymous> (/opt/buildpack/tools/renovate/35.12.0/node_modules/renovate/lib/util/exec/common.ts:99:11)\n    at ChildProcess.emit (node:events:525:35)\n    at ChildProcess.emit (node:domain:489:12)\n    at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)"
2023-03-19T01:41:16.3852033Z        }
2023-03-19T01:41:16.3852782Z DEBUG: No package files need updating (repository=budimanjojo/dotfiles, branch=renovate/lock-file-maintenance)
2023-03-19T01:41:16.3853397Z DEBUG: No updated lock files in branch (repository=budimanjojo/dotfiles, branch=renovate/lock-file-maintenance)
2023-03-19T01:41:16.3853994Z DEBUG: PR has no releaseTimestamp (repository=budimanjojo/dotfiles, branch=renovate/lock-file-maintenance)
2023-03-19T01:41:16.3854560Z DEBUG: No files to commit (repository=budimanjojo/dotfiles, branch=renovate/lock-file-maintenance)
2023-03-19T01:41:16.3855142Z DEBUG: Setting current branch to master (repository=budimanjojo/dotfiles, branch=renovate/lock-file-maintenance)
2023-03-19T01:41:16.4345244Z DEBUG: latest commit (repository=budimanjojo/dotfiles, branch=renovate/lock-file-maintenance)

Have you created a minimal reproduction repository?

I have read the minimal reproductions documentation and linked to such a repository in the bug description

@viceice
Copy link
Member

viceice commented Mar 19, 2023

looks like something on nix side has changed. 🤔 how does nix detect it's home dir?

@JamieMagee can you help?

@viceice
Copy link
Member

viceice commented Mar 19, 2023

@rarkins renovate should not pass HOME and PATH ENV on docker mode

@viceice
Copy link
Member

viceice commented Mar 19, 2023

@budimanjojo how are you running renovate? (GitHub action, helm chart, docker cli ...) please be as detailed as possible

@budimanjojo
Copy link
Author

Sorry, I'm using GHA (mentioned above actually :)). Here's the workflow file: https://github.com/budimanjojo/dotfiles/blob/master/.github/workflows/renovate.yaml
And it only affects lockfile (flake.lock), and the action always returns no error despite this too.

@viceice viceice transferred this issue from renovatebot/renovate Mar 19, 2023
@viceice
Copy link
Member

viceice commented Mar 19, 2023

moved the issue, as it's probably the docker user change here

@viceice
Copy link
Member

viceice commented Mar 19, 2023

budimanjojo added a commit to budimanjojo/nix-config that referenced this issue Mar 20, 2023
@viceice
Copy link
Member

viceice commented Mar 20, 2023

@JamieMagee
Copy link
Contributor

@viceice thanks for investigating. This appears to be a breaking change in nix 2.14.

@viceice
Copy link
Member

viceice commented Mar 20, 2023

should we lock nix to a lower version inside renovate for now?

@viceice
Copy link
Member

viceice commented Mar 21, 2023

@budimanjojo You can workaround with renovate constraints1 option.

{
  "constraints": {
    "nix": "< 2.14.0"
  }
}

Footnotes

  1. https://docs.renovatebot.com/configuration-options/#constraints

@viceice viceice added the bug Something isn't working label Mar 21, 2023
@budimanjojo
Copy link
Author

Thanks!

@JamieMagee
Copy link
Contributor

should we lock nix to a lower version inside renovate for now?

Yeah, the version of flake.lock hasn't changed in the latest release. So we should be okay to use 2.13.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants