ServiceUnavailable error in cypher statement from guides.neo4j.com/wiki

241 views
Skip to first unread message

Colin Goldberg

unread,
May 24, 2018, 4:20:38 PM5/24/18
to Neo4j
Hi,

I recently created a sandbox instance (blank) so I could test https://guides.neo4j.com/wiki.

Using https://guides.neo4j.com/wiki, I had success running the first cypher statement to populate the graph with Wikipedia categories. However, the second cypher statement produces an error - after running for a few seconds.

Here's the statement:
UNWIND range(0,4) as level
CALL apoc.cypher.doIt("
MATCH (c:Category { pagesFetched: false, level: $level })
CALL apoc.load.json('https://en.wikipedia.org/w/api.php?format=json&action=query&list=categorymembers&cmtype=page&cmtitle=Category:' + apoc.text.urlencode(c.catName) + '&cmprop=ids%7Ctitle&cmlimit=500')
YIELD value as results
UNWIND results.query.categorymembers AS page
MERGE (p:Page {pageId: page.pageid})
ON CREATE SET p.pageTitle = page.title, p.pageUrl = 'http://en.wikipedia.org/wiki/' + apoc.text.urlencode(replace(page.title, ' ', '_'))
WITH p,c
MERGE (p)-[:IN_CATEGORY]->(c)
WITH DISTINCT c
SET c.pagesFetched = true", { level: level }) YIELD value
RETURN value

And here's the error message:
Error ServiceUnavailable
WebSocket connection failure. Due to security constraints in your web browser, the reason for the failure is not available to this Neo4j Driver. Please use your browsers development console to determine the root cause of the failure. Common reasons include the database being unavailable, using the wrong connection URL or temporary network problems. If you have enabled encryption, ensure your browser is configured to trust the certificate Neo4j is configured to use. WebSocket `readyState` is: 3

The js console shows error message: neo4j-web.min.js:20 WebSocket is already in CLOSING or CLOSED state.

I posted this on the neoj4 Slack channel - any help is appreciated.

Thanks

Colin Goldberg


Colin Goldberg

unread,
May 25, 2018, 10:13:58 AM5/25/18
to Neo4j
As an addendum to this post:

I installed neo4j community edition version 3.4.0 on an AWS EC2 (Linux) instance, and did not get the ServiceUnavailable error as above. The error occurred on my MacBook Pro macos 10.13.4

Colin Goldberg

J Barrasa (Neo4j)

unread,
Jun 12, 2018, 8:02:03 PM6/12/18
to Neo4j
Hi Colin, sounds like the wikipedia rest api might not be responding to the requests as expected.
There might be a limit in the number of requests per sec that it will serve for unauthenticated users?

If that's the case I'd recommend you try executing manually 4 times the code inside the apoc.cypher.doit  instead of using UNWIND range(0,4) as level CALL...
 
Hope this helps,

JB.

Colin Goldberg

unread,
Jun 13, 2018, 11:20:21 AM6/13/18
to Neo4j
Thanks for your response. I guessed that timing was at the bottom of it. Something to consider as I try to automate.

CG
Reply all
Reply to author
Forward
0 new messages