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

RangeError: Invalid time value #3652

Closed
mcsteele8 opened this issue Feb 1, 2023 · 7 comments · Fixed by #3653
Closed

RangeError: Invalid time value #3652

mcsteele8 opened this issue Feb 1, 2023 · 7 comments · Fixed by #3653

Comments

@mcsteele8
Copy link

Bug

Issue with new events.emit("log") logic added in 0.12.49

Current Behavior

When running garden deploy {module-name} the follow error is thrown and interrupts the deploy process

RangeError: Invalid time value
    at Date.toISOString (<anonymous>)
    at /snapshot/project/tmp/pkg/cli/node_modules/@garden-io/core/src/plugins/kubernetes/run.ts:811:31
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

Expected behavior

No error to be present when running garden deploy {module-name}

Reproducible example

run garden deploy {module-name and the same output happens:

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🌍 Running in namespace {namespace} in environment {cluster}
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

✔ providers → Getting status... → Cached
ℹ Run with --force-refresh to force a refresh of provider statuses.
✔ graph → Resolving 142 modules... → Done
✔ create-dea-dirty-topics → Checking result... → Done
✔ create-review-rocket-cleanser-topics → Checking result... → Done
✔ create-core-usw2-topics → Checking result... → Done
✔ review-rocket-db-setup → Checking result... → Done
✔ halberd-setup → Checking result... → Done
✔ azeroth-create-db → Checking result... → Done
✔ azeroth-migrations → Checking result... → Done
✔ azeroth-es-migrate → Checking result... → Done
✔ arth0-migrations → Checking result... → Done
✔ space-jam-setup → Checking result... → Done
✔ black-mamba-setup → Checking result... → Done
✔ black-mamba-es-setup → Checking result... → Done
✔ crunchwrap-supreme-setup → Checking result... → Done
✔ anakin-setup → Checking result... → Done
✔ arth0-create-db → Checking result... → Done
✔ redis → Getting build status for v-b8ece8345c... → Already built
✔ kafka-connect → Getting build status for v-e24d1cd492... → Already built
✔ deku-seed → Getting build status for v-7075f2b7cc... → Already built
✔ mithrandir → Getting build status for v-7037917451... → Already built
✔ stormcrow → Getting build status for v-836ae17af0... → Already built
✔ azeroth → Getting build status for v-9c744f94e9... → Already built
✔ crunchwrap-supreme → Getting build status for v-6f2a082c4f... → Already built
✔ arth0 → Getting build status for v-fea39dda0c... → Already built
✔ space-jam → Getting build status for v-e510e71153... → Already built
⠼ halberd → Getting build status for v-ac6f2e43d1...
⠸ magic → Getting build status for v-29eafe2c57...
⠙ anakin → Getting build status for v-c53e029997...
⠋ black-mamba → Getting build status for v-1de7ae993f...
⠏ review-rocket → Getting build status for v-7018d347fd...
⠹ kazaam → Getting build status for v-b76c9136ea...
✔ black-mamba-web-headless → Deploying version v-43065cd4c3... → Already deployed
✔ postgres-extended-configuration-13 → Deploying version v-a2ac642d04... → Already deployed
✔ kafka-scripts → Deploying version v-16ecf2897e... → Already deployed
✔ postgres-extended-configuration → Deploying version v-01f53a9984... → Already deployed
✔ redis-sts → Deploying version v-5934fb3c31... → Already deployed
✔ zookeeper → Deploying version v-9ad724020f... → Already deployed
✔ elasticsearch → Deploying version v-23ca028524... → Already deployed
✔ rabbitmq → Deploying version v-3c6c124699... → Already deployed
⠇ kafka → Deploying version v-781801a23d...
ℹ kafka → StatefulSet/kafka: AttachVolume.Attach succeeded for volume "pvc-b543f79c-5337-4a61-b728-75815f79fcdc"
✔ redis → Deploying version v-eebc14cdf6... → Already deployed
✔ postgres-13 → Deploying version v-034197b6e9... → Already deployed
✔ postgres → Deploying version v-3d9240e698... → Already deployed
✔ deku-seed → Deploying version v-d5c418b8f5... → Already deployed
Ingress: {ingress}
✔ azeroth-create-db → Already run
⠴ azeroth-es-migrate → Running...
✔ azeroth-migrations → Already run
⠹ crunchwrap-supreme-setup → Running...
⠦ arth0-create-db → Running...
RangeError: Invalid time value
at Date.toISOString ()
at /snapshot/project/tmp/pkg/cli/node_modules/@garden-io/core/src/plugins/kubernetes/run.ts:811:31
at processTicksAndRejections (node:internal/process/task_queues:95:5)

Workaround

downgrade to 0.12.48

Your environment

macOS running garden-cli deploying to EKS

garden version 0.12.49

@edvald
Copy link
Collaborator

edvald commented Feb 1, 2023

Thanks for reporting this @mcsteele8! @eysi09 can you take a look quickly?

@eysi09
Copy link
Collaborator

eysi09 commented Feb 1, 2023

Yes, will do!

@eysi09
Copy link
Collaborator

eysi09 commented Feb 1, 2023

@mcsteele8, can you confirm that this only happens on 0.12.49?

Or do you see the same error on 0.12.48?

You can switch back by running garden self-update 0.12.48

@eysi09
Copy link
Collaborator

eysi09 commented Feb 1, 2023

Ah, I see what it is.

Previously we were calling timestamp.getTime(), now we're calling timestamp.toISOString().

Turns out the former returns NaN if the timestamp is bad, the latter throws. That is:

new Date("foo").getTime() // NaN
new Date("foo").toISOString() // Uncaught RangeError

Gotta love the date API :)

@mcsteele8
Copy link
Author

@eysi09 correct, version 0.12.48 does not contain this bug. Switching back to 0.12.48 is the only way to get things to work

@eysi09
Copy link
Collaborator

eysi09 commented Feb 1, 2023

The fix is ready in #3653. We'll cut a release as soon as it's merged.

@eysi09
Copy link
Collaborator

eysi09 commented Feb 2, 2023

Hi @mcsteele8, just wanted to let you know that we have a new release (0.12.50) that should fix this issue.

You can run garden self-update to update to this latest version.

Please let us know if you still bump into any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants