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

0.13: [Bug]: deploy with local mode errors: Invalid count value #4912

Closed
hnicke opened this issue Aug 2, 2023 · 4 comments · Fixed by #5327
Closed

0.13: [Bug]: deploy with local mode errors: Invalid count value #4912

hnicke opened this issue Aug 2, 2023 · 4 comments · Fixed by #5327
Labels
0.13 bug community devex Developer experience and ease of use.

Comments

@hnicke
Copy link
Contributor

hnicke commented Aug 2, 2023

Garden Bonsai (0.13) Bug

Current Behavior

When running garden deploy --local ... and the terminal width is <90 characters, garden crashes:

$ garden deploy --local bex-os

───────────── 🌳  garden dev 🌳  ─────────────

Good morning! Welcome to the Garden interactive development console.

Here, you can build, deploy, test and run anything in your project, start code syncing, stream live logs and more.

Use the command line below to enter Garden commands. Type help to get a full list of commands.
Use up/down arrow keys to scroll through your command history.

Scanning repository at /home/xxx/bex/bex-umbrella
Scanning repository at /home/xxxx/bex/bex-umbrella/.garden/sources/project/bexapp--accbe12695
Scanning repository at /home/xxx/bex/bex-umbrella/.garden/sources/project/bom-app--fc03d112c9
Scanning repository at /home/xxxx/bex/bex-umbrella/.garden/sources/project/bom--493b1ac2ed
Scanning repository at /home/xxxx/bex/bex-umbrella/.garden/sources/project/bex-os--9ce2e4e449
🌿 Explore logs, past commands, and your dependency graph in the Garden web App. Log in with garden login.
→ Run garden util hide-warning web-app to disable this warning.


Invalid count value

────────────── 🌼 🌸 🌷 🌺 🌻  ──────────────
 🌷  Thanks for stopping by, love you! ❤️

  ✔︎  Dev console is ready to go! 🚀

It doesn't matter which log level is being used (normal / debug/ silly).
The problem only occurs when deploying with local mode.

Workaround

Adjust your terminal to be >=90 chars in width.
Alternatively, launch the dev console first: garden dev. Then, from within the dev console, run deploy --local ...

Suggested solution(s)

The error is most probably caused by a RangeError, which in turn is thrown by a String.prototype.repeat() function, most probably in one of these places:

$ git grep '.repeat(' | grep logger  
core/src/logger/renderers.ts:  return diff <= 0 ? section : section + repeat(" ", diff)
core/src/logger/util.ts:  const titleString = title ? `${pad.repeat(titlePadding) + title + pad.repeat(titlePadding)}` : ""
core/src/logger/util.ts:  const dividerSideString = color(char.repeat(numberOfCharsPerSide))
core/src/logger/util.ts:  const paddingString = pad.repeat(padding)

Additional context

Your environment

  • OS: arch linux, OSX

garden version
0.13.9

@hnicke hnicke added the 0.13 label Aug 2, 2023
@vvagaytsev
Copy link
Collaborator

Thanks for reporting this, @hnicke! So the issue happens only when deploying in local mode with the default log-level, right?

It might be because the local mode prints too long messages. But the root cause seems to come from some trouble logging/utility machinery that you describe above. Huge thanks for the investigation and the suggested implementation! We'll take a look.

@vvagaytsev vvagaytsev added bug devex Developer experience and ease of use. labels Aug 2, 2023
@hnicke
Copy link
Contributor Author

hnicke commented Aug 2, 2023

@vvagaytsev you're welcome! The error happens with normal log level, with -l debug and as well with -l silly.
The problem does never occur without the local mode.

@edvald
Copy link
Collaborator

edvald commented Aug 2, 2023

I suspect the issue is that --local makes the deploy command persistent and thus puts you into the dev console. So it's probably something generally affecting the dev console.

@hnicke
Copy link
Contributor Author

hnicke commented Aug 3, 2023

The problem does not occur when running garden dev in a narrow terminal.
The dev console spins up properly.
Interestingly enough, even running deploy --local ... in the garden dev console works without issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.13 bug community devex Developer experience and ease of use.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants