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

Release fails with Error: fatal: ' 9007199254740991': not an integer #2425

Closed
aldrichdev opened this issue Feb 20, 2024 · 21 comments · Fixed by StenaIT/stenajs-webui#722, restfulhead/npm-auto-plugins#25 or Codecademy/client-modules#182
Labels
bug Something isn't working

Comments

@aldrichdev
Copy link
Contributor

aldrichdev commented Feb 20, 2024

Describe the bug

As of today, but not last Friday (2/16), our canary (PR) releases are failing on the shipit command, with the following error:

Error: fatal: ' 9007199254740991': not an integer

More detailed output using -vv option:

ℹ  info      Using command: 'shipit'
d8bc8a1c58153a82f743f9374e6233f8d24eed64
ℹ  info      Getting commits from HEAD^ to HEAD
7ec96633f5ae531094d20d2d2452924354eabc40
d8bc8a1c58153a82f743f9374e6233f8d24eed64
d8bc8a1c58153a82f743f9374e6233f8d24eed64
Error: fatal: ' 9007199254740991': not an integer
    at /home/runner/work/Storybook-Components/Storybook-Components/node_modules/gitlog/src/index.ts:384:13
    at ChildProcess.exithandler (node:child_process:430:5)
    at ChildProcess.emit (node:events:517:28)
    at ChildProcess.emit (node:domain:489:12)
    at maybeClose (node:internal/child_process:1098:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:303:5)
TypeError: error.match is not a function
    at Git.getGitLog (/home/runner/work/Storybook-Components/Storybook-Components/node_modules/@auto-it/core/src/git.ts:406:25)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Release.getCommits (/home/runner/work/Storybook-Components/Storybook-Components/node_modules/@auto-it/core/src/release.ts:284:20)
    at async Release.getCommitsInRelease (/home/runner/work/Storybook-Components/Storybook-Components/node_modules/@auto-it/core/src/release.ts:119:24)
    at async Auto.shipit (/home/runner/work/Storybook-Components/Storybook-Components/node_modules/@auto-it/core/src/auto.ts:1604:18)
    at async execute (/home/runner/work/Storybook-Components/Storybook-Components/node_modules/auto/src/run.ts:88:9)
    at async Object.runCli (/home/runner/work/Storybook-Components/Storybook-Components/node_modules/auto/src/run.ts:146:3)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Process completed with exit code 1.

To Reproduce

Run auto shipit

Expected behavior

Expected that the release finishes successfully, which was working as of last Friday (2/16).

Screenshots

Environment information:

Running npx auto info gives me an error saying environment variables are missing. I think they are only set in the build process, not locally.

PS C:\Dev\Alterra\Storybook-Components> npx auto info
‼  warning   protected-branch: No "PROTECTED_BRANCH_REVIEWER_TOKEN" found in environment
×  error     No GitHub was found. Make sure it is available on process.env.GH_TOKEN.
Error: GitHub token not found!
    at Auto.loadConfig (C:\Dev\Alterra\Storybook-Components\node_modules\@auto-it\core\src\auto.ts:657:13)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async execute (C:\Dev\Alterra\Storybook-Components\node_modules\auto\src\run.ts:36:5)
    at async Object.runCli (C:\Dev\Alterra\Storybook-Components\node_modules\auto\src\run.ts:146:3)

However, the build does show the following information:

Environment Information:
"auto" version: v10.46.0
"git"  version: v2.43.2
"node" version: v18.19.1
Project Information:
✔ Repository:      Alterra-Mountain-Company/Storybook-Components (​[https://github.com/Alterra-Mountain-Company/Storybook-Components​)](https://github.com/Alterra-Mountain-Company/Storybook-Components%E2%80%8B))
✔ Author Name:     Alterra Mountain Company
✔ Author Email:    shubert@alterramtnco.com
✔ Current Version: v18.4.7
✔ Latest Release:  v18.4.7 (​[https://github.com/Alterra-Mountain-Company/Storybook-Components/releases/tag/v18.4.7​)](https://github.com/Alterra-Mountain-Company/Storybook-Components/releases/tag/v18.4.7%E2%80%8B))
✖ Labels configured on GitHub project (Try running "auto create-labels")
GitHub Token Information:
✔ Token:            [Token starting with ghp_]
✔ Repo Permission:  write
✔ User:             resortinfra-alterra
✔ API:              undefined (​undefined​)
✔ Enabled Scopes:   repo, workflow
✔ Rate Limit:       4996/5000

Additional context

9007199254740991 is the value of Number.MAX_SAFE_INTEGER, which I noticed is referenced in the getGitLog method of @auto-it/core/dist/git.js. I am just not sure why, or where, Auto is converting it to a string.

@aldrichdev aldrichdev added the bug Something isn't working label Feb 20, 2024
@aldrichdev
Copy link
Contributor Author

Oddly, this issue resolved itself after removing my package-lock.json file (there was a warning about it in the build, since we also have yarn.lock and use yarn mostly), and adding "license": "UNLICENSED", to my package.json, which fixed another warning. Did not think these two changes would fix the issue altogether, but that seems to be what has occurred. Closing.

@aldrichdev
Copy link
Contributor Author

aldrichdev commented Feb 21, 2024

Actually, it seems the issue resolved itself only temporarily. Even with the changes I mentioned above still applied, I am getting the same error again with a new PR. So I still need help.

@aldrichdev aldrichdev reopened this Feb 21, 2024
@patjacobs-magic
Copy link

I also started getting this exact error today.

"auto" version: v10.42.2
"git"  version: v2.43.2
"node" version: v20.11.1

@mackermans
Copy link

Git v2.43.2 seems to be the issue, v2.42.0 still works:

> git log -n 9007199254740991
fatal: '9007199254740991': not an integer

@jazmon
Copy link
Contributor

jazmon commented Feb 21, 2024

Number.MAX_SAFE_INTEGER seems to be too big now as of git v2.43.2, we ended up patching it and using 2147483647 as the new safe maximum instead. This repo seems unmaintained though so I can highly recommend patching it manually for now

@ecstaticrainbow
Copy link

@jazmon Do you have an example of the patch? Unsure what and where you'd put a fix. Thanks

@jazmon
Copy link
Contributor

jazmon commented Feb 21, 2024

@ecstaticrainbow here

index a28a5eb2565d237bd0eff65e6222511287424b5a..464a642e71538ed8e79291b41bae821512eaa950 100644
--- a/dist/git.js
+++ b/dist/git.js
@@ -240,9 +240,11 @@ class Git {
             const startSha = (await this.shaExists(start))
                 ? await exec_promise_1.default("git", ["rev-parse", start])
                 : "";
+            const maxNumber = 2147483647;
             const log = await gitlog_1.gitlogPromise({
                 repo: process.cwd(),
-                number: Number.MAX_SAFE_INTEGER,
+                number: maxNumber,
                 fields: ["hash", "authorName", "authorEmail", "rawBody"],
                 // If start === firstCommit then we want to include that commit in the changelog
                 // Otherwise it was that last release and should not be included in the release.

@laughedelic
Copy link
Contributor

@jazmon could you still submit a PR? I can do it if you don't have time, just let me know.

Maybe we can get @hipstersmoothie to merge the fix for this blocking bug?

@jazmon
Copy link
Contributor

jazmon commented Feb 21, 2024

I would but I have an open PR #2414 that fixes another bug here and it's been open for months without anyone looking at it, doesn't seem very productive to create any more PRs to fix things. Might need to fork this library instead

Zweer pushed a commit to Zweer/auto that referenced this issue Feb 21, 2024
@Zweer
Copy link
Contributor

Zweer commented Feb 21, 2024

PR opened : #2426

@tferullo
Copy link

If anyone is running into this on Github Actions ubuntu runner, I have the worst temporary workaround ever:

- name: Install specific git version
  run: |
    sudo apt-get update
    sudo add-apt-repository ppa:git-core/ppa 
    sudo apt install git=1:2.34.1-1ubuntu1.10 git-man=1:2.34.1-1ubuntu1.10 -y --allow-downgrades

don't judge me, it works.

@sqaisar
Copy link

sqaisar commented Feb 21, 2024

@tferullo It works with these specific git versions. This should be fixed in this repo.

@Ermag
Copy link

Ermag commented Feb 21, 2024

Here is a shell command that applies the fix from @jazmon

sed -i 's/Number.MAX_SAFE_INTEGER/2147483647/' ./node_modules/@auto-it/core/dist/git.js

@jazmon
Copy link
Contributor

jazmon commented Feb 21, 2024

Thanks @Zweer for the PR 👍

If anyone is running into this on Github Actions ubuntu runner, I have the worst temporary workaround ever:

- name: Install specific git version
  run: |
    sudo apt-get update
    sudo add-apt-repository ppa:git-core/ppa 
    sudo apt install git=1:2.34.1-1ubuntu1.10 git-man=1:2.34.1-1ubuntu1.10 -y --allow-downgrades

don't judge me, it works.

This will fail once that version of git is not published in the git-core ppa anymore

@tferullo
Copy link

This will fail once that version of git is not published in the git-core ppa anymore

Yup, very excited for that 😄

@fernandoiury
Copy link

This will fail once that version of git is not published in the git-core ppa anymore

Yup, very excited for that 😄

I think you command is actually installing the ubuntu repo version not the ppa.

@wpniederer
Copy link

Also having the same issue for my repos using Auto, starting today.

@hipstersmoothie
Copy link
Collaborator

We're getting the fix out!

hipstersmoothie added a commit that referenced this issue Feb 22, 2024
Fixing git `2.43.0` max number issue #2425
@patjacobs-magic
Copy link

11.0.5 fixes the issue for me. Thank you for the quick turnaround!

lmestel added a commit to kickstartDS/storybook-addon-jsonschema that referenced this issue Feb 22, 2024
szuelch added a commit to mumprod/hr-design-system-handlebars that referenced this issue Feb 22, 2024
szuelch added a commit to mumprod/hr-design-system-handlebars that referenced this issue Feb 22, 2024
🐛 Update auto package to it's latest version to solve the issue from intuit/auto#2425
@aldrichdev
Copy link
Contributor Author

11.0.5 is working well so far. Thank you @jazmon, @Zweer and @hipstersmoothie! Closing this issue.

github-merge-queue bot pushed a commit to tldraw/tldraw that referenced this issue Feb 23, 2024
Our canary builds are broken right now, see
https://github.com/tldraw/tldraw/actions/runs/8018554530/job/21904677162#step:4:13

Looks like `auto@11.0.5` solves this
intuit/auto#2425

### Change Type

- [ ] `patch` — Bug fix
- [ ] `minor` — New feature
- [ ] `major` — Breaking change
- [ ] `dependencies` — Changes to package dependencies[^1]
- [ ] `documentation` — Changes to the documentation only[^2]
- [ ] `tests` — Changes to any test code only[^2]
- [x] `internal` — Any other changes that don't affect the published
package[^2]
- [ ] I don't know
@hipstersmoothie
Copy link
Collaborator

If any contributors want to help maintain auto I'm open to the idea! auto def hasn't been on my mind since moving to a more product focused role but I still use the project outside work a lot. I've now moved back to a platform team so I'll be more active.

(If anyone want to just that platform team we're hiring descript.com)

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