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

Grizzly did not find expected key #341

Closed
asreich opened this issue Feb 16, 2024 · 4 comments
Closed

Grizzly did not find expected key #341

asreich opened this issue Feb 16, 2024 · 4 comments

Comments

@asreich
Copy link
Contributor

asreich commented Feb 16, 2024

I updated to use Grizzly 0.3.1 after using 0.2.0 to sync dashboards from Grafana 7.1.1 to Grafana Cloud 10.3/4.x. 0.2.0 worked last December but 0.3.0 has Alert resources I'd like to add so I've updated.

I am getting an error I did not get last time:

grr apply -d resources -t "DashboardFolder/*" -t "Dashboard/*"
Flag --directory has been deprecated, now it is inferred from the operating system
FATA[0003] Error decoding resources/dashboards/MbJTL4Viz/dashboard-_F63xZIVz.yaml: yaml: line 21: did not find expected key

The lines in question:

...
    links: []
    panels:
        - content: |4+
            # Service Status

            More operations info and useful links available here: [Service Operations](https://ourdomain.com/display/PS/Service+Operations)



          datasource: null
...

When I remove the 4+ it seems happy, but this 4+ was there last time I synced and it worked no problem. There is also a 4- out there which it's also breaking on. This is the first time I've seen numbers after a | in YAML before.

Please let me know if you need any more info from me.

EDIT: Seems like there's an id field and a version field that aren't present in 0.2.0

@asreich
Copy link
Contributor Author

asreich commented Feb 16, 2024

Also getting the following error when trying to apply Dashboards now. DashboardFolders work, Dashboards do not.

grr apply -d resources -t "Dashboard/*"

FATA[0006] [POST /dashboards/db][404] postDashboardNotFound  &{Error: Message:0xc00e6776a0 Status:not-found} 

EDIT: Trying 0.2.0 again it gives me a better error:

FATA[0007] Non-200 response from Grafana while applying dashboard -2wbK9J7k: 404 Not Found {"message":"Dashboard not found","status":"not-found"} 

@malcolmholmes
Copy link
Collaborator

There is an issue with Golang YAML parsers not being able to handle the objects that Grafana creates (e.g. putting newlines or special characters into keys).

The simple solution is to use the (new) --output json feature. You can set that in your context with grr config set output-format json (you can also set the target with grr config set targets Dashboard (the .* isn't needed anymore).

@asreich
Copy link
Contributor Author

asreich commented Mar 14, 2024

Linking likely related tickets #245 #301

@malcolmholmes
Copy link
Collaborator

Closing in lieu of #245.

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