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

Error: Invalid grit.yml #316

Open
stovmascript opened this issue May 6, 2024 · 11 comments
Open

Error: Invalid grit.yml #316

stovmascript opened this issue May 6, 2024 · 11 comments

Comments

@stovmascript
Copy link

stovmascript commented May 6, 2024

I'm running into this error after a clean install of the Grit CLI:

root@7ca230e16e58:/srv# grit apply 'remove_import(from=`"react"`)'
Fetching release URL from: https://api.keygen.sh//v1/accounts/custodian-dev/artifacts/gouda-linux-arm64
Fetching release URL from: https://api.keygen.sh//v1/accounts/custodian-dev/artifacts/cli-linux-arm64
Fetching release URL from: https://api.keygen.sh//v1/accounts/custodian-dev/artifacts/timekeeper-linux-arm64
Fetching release URL from: https://api.keygen.sh//v1/accounts/custodian-dev/artifacts/marzano-linux-arm64
Your working tree currently has untracked changes and Grit will rewrite files in place. Do yo
Your working tree currently has untracked changes and Grit will rewrite files in place. Do you want to proceed? yes
Error: Invalid grit.yml: patterns[0].samples[1]: missing field `output` at line 22 column 9
root@7ca230e16e58:/srv# grit -V
grit 0.1.1
@morgante
Copy link
Contributor

morgante commented May 6, 2024

Can you run grit init? Where did you install from?

@stovmascript
Copy link
Author

I tried both with and without grit init (it's stated as optional).

This output is after installing via curl -fsSL https://docs.grit.io/install | bash in a Docker container. But I did also try using the npm installation on my host machine and ran into the same error.

@stovmascript
Copy link
Author

stovmascript commented May 6, 2024

grit init actually produces the same error:

root@7ca230e16e58:/srv# grit init
Initialized grit config at /srv/.grit/grit.yaml
Error: Invalid grit.yml: patterns[0].samples[1]: missing field `output` at line 22 column 9

@morgante
Copy link
Contributor

morgante commented May 6, 2024

We have tests that run it, so I'm having trouble finding the root cause. Could you try replicating in a CodeSandbox?

@stovmascript
Copy link
Author

Oops, looks like the npm installed version on my host machine actually works.

@morgante
Copy link
Contributor

morgante commented May 6, 2024

That's interesting, since they should theoretically end up with the same final binary.

@stovmascript
Copy link
Author

I'll try to reproduce the error in some public container.

@stovmascript
Copy link
Author

Tried in this "Devbox": https://codesandbox.io/p/devbox/heuristic-danny-kjl98p and works just fine 🤔

@stovmascript

This comment was marked as outdated.

@stovmascript

This comment was marked as outdated.

@stovmascript
Copy link
Author

stovmascript commented May 7, 2024

I've narrowed it down to the image architecture.

I'm on a M1 Mac. I pulled the default Ubuntu image as well as the x64 image:

docker pull ubuntu
docker pull --platform linux/amd64 ubuntu

image

Then I created a container for both, mounting a directory which I want to run Grit on. After installing and running Grit, if fails on the Arm image, but works on the x64 image.

Arm image

$ docker run -v $(pwd)/src:/srv/src -ti fabf3a8d494905382641dda35544832ec77b90f18b543d0f0b526fb9ed602786 /bin/bash
root@df1279867049:/# apt-get update && apt-get install -y curl && curl -fsSL https://docs.grit.io/install | bash
# ...
root@df1279867049:/# source /root/.bashrc
root@df1279867049:/# grit apply 'remove_import(from=`"react"`)'
Fetching release URL from: https://api.keygen.sh//v1/accounts/custodian-dev/artifacts/cli-linux-arm64
Fetching release URL from: https://api.keygen.sh//v1/accounts/custodian-dev/artifacts/marzano-linux-arm64
Fetching release URL from: https://api.keygen.sh//v1/accounts/custodian-dev/artifacts/timekeeper-linux-arm64
Fetching release URL from: https://api.keygen.sh//v1/accounts/custodian-dev/artifacts/gouda-linux-arm64
Error: Invalid grit.yml: patterns[0].samples[1]: missing field `output` at line 22 column 9
root@df1279867049:/# 

x64 image

$ docker run -v $(pwd)/src:/srv/src -ti bf3dc08bfed031182827888bb15977e316ad797ee2ccb63b4c7a57fdfe7eb31d /bin/bash # Linux image
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
root@f74db6378f44:/# apt-get update && apt-get install -y curl && curl -fsSL https://docs.grit.io/install | bash
# ...
oot@f74db6378f44:/# grit apply 'remove_import(from=`"react"`)'
Fetching release URL from: https://api.keygen.sh//v1/accounts/custodian-dev/artifacts/cli-linux-x64
Fetching release URL from: https://api.keygen.sh//v1/accounts/custodian-dev/artifacts/gouda-linux-x64
Fetching release URL from: https://api.keygen.sh//v1/accounts/custodian-dev/artifacts/workflow_runner-linux-x64
Fetching release URL from: https://api.keygen.sh//v1/accounts/custodian-dev/artifacts/timekeeper-linux-x64
Fetching release URL from: https://api.keygen.sh//v1/accounts/custodian-dev/artifacts/marzano-linux-x64
./srv/src/types/global.d.ts
     1  import { IAppStore } from '~/store/models/AppStore'
     2
     3  declare global {
     4    namespace NodeJS {
# ...

Edit: Fixed nomenclature: not "Linux", but x64 rather.

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

No branches or pull requests

2 participants