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

Upgrade to v2 beta, JSON monitors are broken until re saved #5294

Closed
1 task done
mmomjian opened this issue Oct 31, 2024 · 2 comments Β· Fixed by #5295
Closed
1 task done

Upgrade to v2 beta, JSON monitors are broken until re saved #5294

mmomjian opened this issue Oct 31, 2024 · 2 comments Β· Fixed by #5295
Labels
bug Something isn't working releaseblocker blocking bugs encountered with a new release

Comments

@mmomjian
Copy link

mmomjian commented Oct 31, 2024

πŸ“‘ I have found these related issues/pull requests

N/A

πŸ›‘οΈ Security Policy

Description

After an upgrade to v2, JSON monitors are broken until edited and re saved.

Error:
image

Monitor #174 'API check': Failing: Error evaluating JSON query: Invalid condition null. Response from server was: true | Interval: 600 seconds | Type: json-query | Down Count: 0 | Resend Interval: 0

When the monitor is edited, the correct info is populated, and when Saved the monitor comes back up.

image

(this screenshot is from a different monitor with the same issue, should say true)

πŸ‘Ÿ Reproduction steps

Setup a JSON monitor in v1 and upgrade to v2 beta

πŸ‘€ Expected behavior

JSON monitors are preserved

πŸ˜“ Actual Behavior

JSON monitors require re saving

🐻 Uptime-Kuma Version

2.0.0-beta

πŸ’» Operating System and Arch

Ubuntu 20.04 armv7

🌐 Browser

Chrome 130

πŸ–₯️ Deployment Environment

  • Runtime: Version: 27.3.1
    API version: 1.47
    Go version: go1.22.7

  • Database: sqlite

  • Filesystem used to store the database on: EXT4

  • number of monitors: 200+

πŸ“ Relevant log output

2024-10-31T15:38:19-04:00 [MONITOR] WARN: Monitor #174 'API check': Failing: Error evaluating JSON query: Invalid condition null. Response from server was: true | Interval: 600 seconds | Type: json-query | Down Count: 0 | Resend Interval: 0
@mmomjian mmomjian added the bug Something isn't working label Oct 31, 2024
@CommanderStorm CommanderStorm added the releaseblocker blocking bugs encountered with a new release label Oct 31, 2024
@CommanderStorm
Copy link
Collaborator

That is a bit unfortunate.

table.string("json_path_operator").defaultTo(null);

null should have been "=="
Will provide a PR

I also just noticed that I might have merged the same/overlapping functionality twice.
(compare the way monitor conditions for the dns monitor work vs the json monitor.. 🫀)

@mmomjian
Copy link
Author

mmomjian commented Nov 1, 2024

Thank you! I did the migration on a copy of my data so I am not planning on using this version in prod. Glad it can be fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working releaseblocker blocking bugs encountered with a new release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants