Skip to content

Issue with logs pages - t.match is not a function #1459

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

Open
3 tasks done
macarthuror opened this issue Jan 27, 2020 · 9 comments
Open
3 tasks done

Issue with logs pages - t.match is not a function #1459

macarthuror opened this issue Jan 27, 2020 · 9 comments
Labels
bounty:$5 Bounty applies for fixing this issue (Parse Bounty Program) type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@macarthuror
Copy link

Make sure these boxes are checked before submitting your issue -- thanks for reporting issues back to Parse Dashboard!

  • You're running version >=1.0.23 of Parse Dashboard.

  • You're running version >=2.3.2 of Parse Server.

  • You've searched through existing issues. Chances are that your issue has been reported or resolved before.

Environment Setup

Running Locally

parse-dashboard: 2.0.5
parse-server: 3.10.0
express: 4.17.1

Steps to reproduce

Similar to #1112
Open up dashboard and navigate to logs page
Sometimes works but mostly of the time it crash

Logs/Trace

Uncaught (in promise) TypeError: t.match is not a function
    at Yf (dashboard.bundle.js:95)
    at oa (dashboard.bundle.js:45)
    at eu (dashboard.bundle.js:45)
    at xu (dashboard.bundle.js:45)
    at yu (dashboard.bundle.js:45)
    at su (dashboard.bundle.js:45)
    at dashboard.bundle.js:45
    at t.unstable_runWithPriority (dashboard.bundle.js:53)
    at qi (dashboard.bundle.js:45)
    at Gi (dashboard.bundle.js:45)
@davimacedo davimacedo added type:bug Impaired feature or lacking behavior that is likely assumed needs investigation labels Jan 27, 2020
@davehibshman
Copy link

davehibshman commented May 26, 2020

Having same problem running on local Ubuntu 20.04 box:
parse-dashboard: 2.10.0
parse-server: 4.2.0
express: 4.17.1

Updated: I had 6 days of log files on my server, 12 files total between .err and .info. I deleted them and restarted the server and now my logs link worked again. Might help figure the bug or others work around until fixed.

@FELS-Zak
Copy link

I've never had any logs -
How do you build this dashboard once you make a change ?

@Mabenan
Copy link

Mabenan commented Aug 20, 2021

I think i have found the problem for me the following line made the problem:
{"message":{"ok":0,"code":40352,"codeName":"Location40352","name":"MongoError"},"code":1,"level":"error","stack":"Error: MongoError: FieldPath cannot be constructed with empty string\n at C:\\Users\\doene\\Documents\\ServerManagerDocker\\node_modules\\parse-server\\lib\\Controllers\\DatabaseController.js:1170:21\n at runMicrotasks (<anonymous>)\n at processTicksAndRejections (internal/process/task_queues.js:95:5)","timestamp":"2021-08-20T09:59:24.974Z"}

The problem was solved when i changed the message property to a string like that:
{"message":"MongoError","code":1,"level":"error","stack":"Error: MongoError: FieldPath cannot be constructed with empty string\n at C:\\Users\\doene\\Documents\\ServerManagerDocker\\node_modules\\parse-server\\lib\\Controllers\\DatabaseController.js:1170:21\n at runMicrotasks (<anonymous>)\n at processTicksAndRejections (internal/process/task_queues.js:95:5)","timestamp":"2021-08-20T09:59:24.974Z"}

So my assumption here is that the message property is expected to be an string. Which it isn't for errors thrown by Mongo

@Mabenan
Copy link

Mabenan commented Aug 20, 2021

after looking at the source i think it would be the easiest thing to check the message property and if it is not a string to execute a stringify maybe JSON.stringify.

@mtrezza
Copy link
Member

mtrezza commented Aug 20, 2021

Thanks for the analysis! Can you verify whether this issue still exists with the current master branch?

@Mabenan
Copy link

Mabenan commented Aug 30, 2021

Yes it does

@mtrezza
Copy link
Member

mtrezza commented Aug 30, 2021

@Mabenan Thanks for confirming. The next step would be to determine whether this should be fixed in Parse Server (where the log is written) or in dashboard (where the log is parsed).

If the expectation also from Parse Server side is that message is a string, not an object, then it would be enough to JSON.stringify the message value before writing it to the log. Given the naming, I would assume that message should always be a string, so this would be a Parse Server PR.

In addition, Parse Dashboard could handle this more gracefully and not crash when not being able to read a log line, but displayed an error instead. Bu this is a secondary PR, as it is not the underlying issue.

@mtrezza mtrezza added the bounty:$5 Bounty applies for fixing this issue (Parse Bounty Program) label Oct 4, 2021
@youwhoyou
Copy link

still not fixed

@mtrezza
Copy link
Member

mtrezza commented Sep 27, 2022

As explained above, these 2 issues:

  • Parse Dashboard: fail gracefully if log cannot be parsed
  • Parse Server: log message must always be a string, not an object

Anyone who wants to pick up any of these 2 issues, please go ahead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bounty:$5 Bounty applies for fixing this issue (Parse Bounty Program) type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
Development

No branches or pull requests

7 participants