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

Push Dashboard cannot open since 2.6.0 #4302

Closed
willli666 opened this issue Oct 29, 2017 · 13 comments
Closed

Push Dashboard cannot open since 2.6.0 #4302

willli666 opened this issue Oct 29, 2017 · 13 comments

Comments

@willli666
Copy link

Issue Description

Ever since upgrading to 2.6.0, I'm not able to open/view the Push section in parse dashboard. The page keeps on loading in 2.6.0 and becomes all white in 2.6.2

Steps to reproduce

Run parse server and parse dashboard on localhost. Click on Core and you can see all classes. Click on Push and it hangs there.

I even went to dabase and manually deleted all the Audience records but it didn't help.

Logs/Trace

this is on 2.6.0
parse-server-example running on port 1337.
error: Error generating response. ParseError { code: 1, message: 'bad key in untransform: _last_used' } code=1, message=bad key in untransform: _last_used
error: bad key in untransform: _last_used code=1, message=bad key in untransform: _last_used

this is on 2.6.1
error: Error generating response. SyntaxError: Unexpected token o in JSON at position 1
at Object.parse (native)
at /Users/anli/Documents/workspace_apollo/apolloParseServer/node_modules/parse-server/lib/Routers/AudiencesRouter.js:57:29
at Array.forEach (native)
at /Users/anli/Documents/workspace_apollo/apolloParseServer/node_modules/parse-server/lib/Routers/AudiencesRouter.js:56:26
at process._tickDomainCallback (internal/process/next_tick.js:135:7)
error: Uncaught internal server error. SyntaxError: Unexpected token o in JSON at position 1
at Object.parse (native)
at /Users/anli/Documents/workspace_apollo/apolloParseServer/node_modules/parse-server/lib/Routers/AudiencesRouter.js:57:29
at Array.forEach (native)
at /Users/anli/Documents/workspace_apollo/apolloParseServer/node_modules/parse-server/lib/Routers/AudiencesRouter.js:56:26
at process._tickDomainCallback (internal/process/next_tick.js:135:7) SyntaxError: Unexpected token o in JSON at position 1
at Object.parse (native)
at /Users/anli/Documents/workspace_apollo/apolloParseServer/node_modules/parse-server/lib/Routers/AudiencesRouter.js:57:29
at Array.forEach (native)
at /Users/anli/Documents/workspace_apollo/apolloParseServer/node_modules/parse-server/lib/Routers/AudiencesRouter.js:56:26
at process._tickDomainCallback (internal/process/next_tick.js:135:7)
SyntaxError: Unexpected token o in JSON at position 1
at Object.parse (native)
at /Users/anli/Documents/workspace_apollo/apolloParseServer/node_modules/parse-server/lib/Routers/AudiencesRouter.js:57:29
at Array.forEach (native)
at /Users/anli/Documents/workspace_apollo/apolloParseServer/node_modules/parse-server/lib/Routers/AudiencesRouter.js:56:26
at process._tickDomainCallback (internal/process/next_tick.js:135:7)

Environment Setup

  • Server

    • parse-server version (Be specific! Don't say 'latest'.) : 2.6.0 ,2.6.2 and above
    • Operating System: macbook localhost
  • Database

    • MongoDB version: mlab shared cluster 3.2.16
@flovilmart
Copy link
Contributor

please provide the logs when running with VERBOSE=1

@flovilmart
Copy link
Contributor

Can you also provide the failing requests/responses from the browser/parse-dashboard ?

@willli666
Copy link
Author

This is running 2.6.2
When I click on Push section in the left menu bar, it prints out this error.

Here is the screenshot in chrome.
screenshot

verbose: REQUEST for [GET] /parse/push_audiences: {} method=GET, url=/parse/push_audiences, host=localhost:1337, connection=keep-alive, content-length=217, pragma=no-cache, cache-control=no-cache, origin=http://localhost:1337, user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36, content-type=text/plain, accept=*/*, referer=http://localhost:1337/dashboard/apps/apollo%20Parse%20Prod/push/new, accept-encoding=gzip, deflate, br, accept-language=en-US,en;q=0.8,zh-CN;q=0.6,zh;q=0.4,zh-TW;q=0.2,es;q=0.2, cookie=__atuvc=0%7C25%2C0%7C26%2C0%7C27%2C0%7C28%2C6%7C29; fs_uid=www.fullstory.com2TARZ5629499534213120:5634387206995968; _okdetect=%7B%22token%22%3A%2215076901647830%22%2C%22proto%22%3A%22http%3A%22%2C%22host%22%3A%22localhost%3A3000%22%7D; _ok=6527-402-10-2596; gsScrollPos-391=0; NPS_bd7f509b_last_seen=1508565731472; gsScrollPos-2537=0; _okac=9cbe237f0e4f4a102057835b35bcd8da; _okla=1; u-upsellit14433=pixelSeen; ab=%7B%22Sample%20Test%22%3A0%7D; _ga=GA1.1.988033562.1459658117; _gid=GA1.1.2105547307.1509218705; u-upsellitc4104=pixelSeen; usi_source=aff; olfsk=olfsk5998611791496524; wcsid=dno3kqnVAhRJRzPM6x2Le0W08K0JE3G6; hblid=FxQ6Sd7CR1hsFK1i6x2Le9aeDWQL40E0; connect.sid=s%3ALHIWcpnMoJwEke0wxJ74VisHtVjtZHLw.FYq1%2FE8chrLl3VO5PDW6WPk7r3X9GcMM1ydM%2F31B0%2FU; _oklv=1509222730876%2Cdno3kqnVAhRJRzPM6x2Le0W08K0JE3G6; _okbk=vi3%3Dinactive%2Ccd4%3Dtrue%2Cvi5%3D0%2Cvi4%3D1509218705472%2Cvi2%3Dfalse%2Cvi1%3Dfalse%2Ccd8%3Dchat%2Ccd6%3D0%2Ccd5%3Daway%2Ccd3%3Dfalse%2Ccd2%3D0%2Ccd1%3D0%2C; session=eyJjc3JmU2VjcmV0IjoiQzVITWZObC1ialN5dnp5QzJwa05XOXVfIiwiZmxhc2giOnt9LCJwYXNzcG9ydCI6eyJ1c2VyIjoiYXBvbGxvYm94In19; session.sig=SPcaZ7kS2BqkmyjnMIPuxhl6G74, error: Error generating response. SyntaxError: Unexpected token o in JSON at position 1 at Object.parse (native) at /Users/anli/Documents/workspace_apollo/apolloParseServer/node_modules/parse-server/lib/Routers/AudiencesRouter.js:57:29 at Array.forEach (native) at /Users/anli/Documents/workspace_apollo/apolloParseServer/node_modules/parse-server/lib/Routers/AudiencesRouter.js:56:26 at process._tickDomainCallback (internal/process/next_tick.js:135:7) error: Uncaught internal server error. SyntaxError: Unexpected token o in JSON at position 1 at Object.parse (native) at /Users/anli/Documents/workspace_apollo/apolloParseServer/node_modules/parse-server/lib/Routers/AudiencesRouter.js:57:29 at Array.forEach (native) at /Users/anli/Documents/workspace_apollo/apolloParseServer/node_modules/parse-server/lib/Routers/AudiencesRouter.js:56:26 at process._tickDomainCallback (internal/process/next_tick.js:135:7) SyntaxError: Unexpected token o in JSON at position 1 at Object.parse (native) at /Users/anli/Documents/workspace_apollo/apolloParseServer/node_modules/parse-server/lib/Routers/AudiencesRouter.js:57:29 at Array.forEach (native) at /Users/anli/Documents/workspace_apollo/apolloParseServer/node_modules/parse-server/lib/Routers/AudiencesRouter.js:56:26 at process._tickDomainCallback (internal/process/next_tick.js:135:7) SyntaxError: Unexpected token o in JSON at position 1 at Object.parse (native) at /Users/anli/Documents/workspace_apollo/apolloParseServer/node_modules/parse-server/lib/Routers/AudiencesRouter.js:57:29 at Array.forEach (native) at /Users/anli/Documents/workspace_apollo/apolloParseServer/node_modules/parse-server/lib/Routers/AudiencesRouter.js:56:26 at process._tickDomainCallback (internal/process/next_tick.js:135:7)

@willli666
Copy link
Author

I then checked AudiencesRouter line 56. It crashed at the JSON.parse because the item.query is already an object.

`
return _rest2.default.find(req.config, req.auth, '_Audience', body.where, options, req.info.clientSDK).then(function (response) {

    response.results.forEach(function (item) {
      item.query = JSON.parse(item.query);
    });

    return { response: response };

`

So I deleted all the audience documents from mongodb. They are just previous saved push audience queries. Then there is no errors any more but the push page still not loading.

Here is the new screenshot screenshot It hangs at this loading stage.
Here is the log
verbose: REQUEST for [GET] /apolloboxdev/push_audiences: {} method=GET, url=/apolloboxdev/push_audiences, host=localhost:1337, connection=keep-alive, content-length=187, pragma=no-cache, cache-control=no-cache, origin=http://localhost:1337, user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36, content-type=text/plain, accept=*/*, referer=http://localhost:1337/dashboard/apps/apollo%20Parse%20Dev/push/new, accept-encoding=gzip, deflate, br, accept-language=en-US,en;q=0.8,zh-CN;q=0.6,zh;q=0.4,zh-TW;q=0.2,es;q=0.2, cookie=__atuvc=0%7C25%2C0%7C26%2C0%7C27%2C0%7C28%2C6%7C29; fs_uid=www.fullstory.com2TARZ5629499534213120:5634387206995968; _okdetect=%7B%22token%22%3A%2215076901647830%22%2C%22proto%22%3A%22http%3A%22%2C%22host%22%3A%22localhost%3A3000%22%7D; _ok=6527-402-10-2596; gsScrollPos-391=0; NPS_bd7f509b_last_seen=1508565731472; gsScrollPos-2537=0; _okac=9cbe237f0e4f4a102057835b35bcd8da; _okla=1; u-upsellit14433=pixelSeen; ab=%7B%22Sample%20Test%22%3A0%7D; _ga=GA1.1.988033562.1459658117; _gid=GA1.1.2105547307.1509218705; u-upsellitc4104=pixelSeen; usi_source=aff; olfsk=olfsk5998611791496524; wcsid=dno3kqnVAhRJRzPM6x2Le0W08K0JE3G6; hblid=FxQ6Sd7CR1hsFK1i6x2Le9aeDWQL40E0; connect.sid=s%3ALHIWcpnMoJwEke0wxJ74VisHtVjtZHLw.FYq1%2FE8chrLl3VO5PDW6WPk7r3X9GcMM1ydM%2F31B0%2FU; _oklv=1509222730876%2Cdno3kqnVAhRJRzPM6x2Le0W08K0JE3G6; _okbk=vi3%3Dinactive%2Ccd4%3Dtrue%2Cvi5%3D0%2Cvi4%3D1509218705472%2Cvi2%3Dfalse%2Cvi1%3Dfalse%2Ccd8%3Dchat%2Ccd6%3D0%2Ccd5%3Daway%2Ccd3%3Dfalse%2Ccd2%3D0%2Ccd1%3D0%2C; session=eyJjc3JmU2VjcmV0IjoiNlQwdDFoeEFaVktyRktkbXYtWWxoUTJuIiwiZmxhc2giOnt9LCJwYXNzcG9ydCI6eyJ1c2VyIjoiYXBvbGxvYm94In19; session.sig=FNFpR6ZypBkWZcjBN6fLX8JsPKs, verbose: RESPONSE from [GET] /apolloboxdev/push_audiences: { "response": { "results": [] } } results=[]

@kelset
Copy link

kelset commented Nov 23, 2017

Same issue here, any update?

Using:

    "parse": "1.10.2",
    "parse-dashboard": "1.1.2",
    "parse-server": "2.6.5",

btw if I go back to the old version of parse-dashboard:

Using:

    "parse": "1.10.2",
    "parse-dashboard": "1.1.0",
    "parse-server": "2.6.5",

The error is still shown but the Push section works.

@montymxb
Copy link
Contributor

montymxb commented Nov 24, 2017

Please see #811 in parse-dashboard and the merged PR. This will not be available until the next release is published by the way. In the meantime try configuring your push localizations and see if that doesn't fix it.

@kelset
Copy link

kelset commented Dec 4, 2017

Hey @montymxb thanks for the heads-up; do you know how can I test it?
I have tried to point my package.json to master but I get this error Uncaught SyntaxError: Unexpected token < which I found out means that the dashboard is not built.

And I've tried to do a yarn && yarn run dashboard in the .../node_modules/parse_dashboard but got many different errors so I think I'm missing out on something.

If the only way to "have that fix" is for @flovilmart to do a new release, can I ask you if there is any way I can help in getting to a point that a release for parse-dashboard can be produced?

@montymxb
Copy link
Contributor

montymxb commented Dec 4, 2017

@kelset Until a new release is published you have a couple of options.

  • You can roll back to 1.1.0 and hang tight until we roll out a fix
  • You can use the most recent release but configure your push localizations, even using an empty array will work

If you're up for it you can also try building the dashboard yourself. But I imagine you're getting it from npm and you would probably like to keep it that way.

@JacobJT
Copy link

JacobJT commented May 3, 2018

As @montymxb pointed out, the dashboard not opening was an issue with parse-dashboard, which was patched in 1.2.0.

However, using both the latest parse-dashboard (1.2.0) and parse-server (2.7.4), opening the push page is still causing a lot of server error logs similar to what @tjlian616 mentioned. Are these of concern?

error: Error generating response. SyntaxError: Unexpected token o in JSON at position 1
    at Object.parse (native)
    at _ClassesRouter2.default.handleFind._rest2.default.find.then.response.results.forEach.item (MY_PATH/node_modules/parse-server/lib/Routers/AudiencesRouter.js:37:27)
    at Array.forEach (native)
    at _ClassesRouter2.default.handleFind._rest2.default.find.then.response (MY_PATH/node_modules/parse-server/lib/Routers/AudiencesRouter.js:36:24)
    at process._tickDomainCallback (internal/process/next_tick.js:129:7) 
error: Uncaught internal server error. SyntaxError: Unexpected token o in JSON at position 1
    at Object.parse (native)
    at _ClassesRouter2.default.handleFind._rest2.default.find.then.response.results.forEach.item (MY_PATH/node_modules/parse-server/lib/Routers/AudiencesRouter.js:37:27)
    at Array.forEach (native)
    at _ClassesRouter2.default.handleFind._rest2.default.find.then.response (MY_PATH/node_modules/parse-server/lib/Routers/AudiencesRouter.js:36:24)
    at process._tickDomainCallback (internal/process/next_tick.js:129:7) SyntaxError: Unexpected token o in JSON at position 1
    at Object.parse (native)
    at _ClassesRouter2.default.handleFind._rest2.default.find.then.response.results.forEach.item (MY_PATH/node_modules/parse-server/lib/Routers/AudiencesRouter.js:37:27)
    at Array.forEach (native)
    at _ClassesRouter2.default.handleFind._rest2.default.find.then.response (MY_PATH/node_modules/parse-server/lib/Routers/AudiencesRouter.js:36:24)
    at process._tickDomainCallback (internal/process/next_tick.js:129:7)
SyntaxError: Unexpected token o in JSON at position 1
    at Object.parse (native)
    at _ClassesRouter2.default.handleFind._rest2.default.find.then.response.results.forEach.item (MY_PATH/node_modules/parse-server/lib/Routers/AudiencesRouter.js:37:27)
    at Array.forEach (native)
    at _ClassesRouter2.default.handleFind._rest2.default.find.then.response (MY_PATH/node_modules/parse-server/lib/Routers/AudiencesRouter.js:36:24)
    at process._tickDomainCallback (internal/process/next_tick.js:129:7)

Pushes are sending properly, and the dashboard now opens, but the dashboard/apps/APP_NAME/push/new url (Send New Push option from the sidebar) hangs. Past Pushes and Audiences options do not hang and show no errors.

Potentially also of note: I do not have any Audiences at all. I saw in the other repo the error with the dashboard not opening the push page was old Audience objects not having a pushLocale value or something. I do not have any audiences, so it shouldn't be missing data from those audiences. Maybe it's the lack of audiences entirely?

Is this something to report on the Parse-Dashboard repo, or is it a Parse-Server issue?

@mtrezza
Copy link
Member

mtrezza commented May 15, 2018

@JacobJT Check the _Audience collection in the database to make sure you do not have any existing audiences that may cause the error.

You may not see existing audiences in the dashboard because the audience entries cannot be displayed due to, well, the error you are describing.

@JacobJT
Copy link

JacobJT commented May 15, 2018

@mtrezza Ahh, I do see a single _Audience value dating back to 2016, going by the date this was after we migrated to our own database, though I don't think we had yet left Parse.com.

Is there a way to delete this via the mLab dashboard? or am I going to have to use the mongo cli for this?

@mtrezza
Copy link
Member

mtrezza commented May 15, 2018

@JacobJT To delete it via the mLab dashboard go to https://mlab.com/databases/<yourDBname>/collections/_Audience. There you can edit or delete the documents, i.e. audience entries.

@stale
Copy link

stale bot commented Sep 18, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

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

6 participants