Getting Started with Foxx and ArangoDB on Windows - "errorMessage":"unknown path" - arangodb

Yes part of the problem is I don't have a Mac Pro ;) And the demo are done on Macs.
I can get the "Hello World" app to run, loading it via the web interface and accessing via:
http://localhost:8529/_db/Test1/hello-foxx
But I cannot seem to get any other demos to load. For example oauth2:
http://localhost:8529/_db/Test1/oauth2
{"error":true,"code":404,"errorNum":404,"errorMessage":"unknown path 'oauth2'"}
UPDATE - I am also new to server side Javascript. While playing with a simple working demo, I created an error in the app.js file. The resulting output in the browser was my above 404 error. It would seem that if the app.js fails and cannot create the output file, then logically the browser can't find it. So it may not be a "Mounting" or File System error, but a JS error???

Maybe this can help you.
Run arangodb in debug mode:
arangod -c "D:\Tools\ArangoDB 2.2.5\etc\arangodb\arangod.conf"
--javascript.dev-app-path "D:\Tools\ArangoDB 2.2.5\www"
Take a look at the console output when you receive the error.
This is an internal error at a FOXX app returning 404
2014-11-07T05:07:00Z [4928] INFO ArangoDB (version 2.2.5 [win64]) is
ready for business. Have fun!
2014-11-07T05:21:47Z [4928] ERROR Cannot compute Foxx application
routes: SyntaxError: JavaScript exception in file '(snippet)' at
11,19: SyntaxError: Unexpected token * 2014-11-07T05:21:47Z [4928]
ERROR !\x09\x09if(fuzzyType != * || ! $(fts).All(function(ft){ return
typeof(fuzzy[ft]) ==
2014-11-07T05:21:47Z [4928] ERROR ! ^
2014-11-07T05:21:47Z [4928] ERROR stacktrace: SyntaxError: Unexpected
token *
2014-11-07T05:21:47Z [4928] ERROR at createModule
(common/bootstrap/modules.js:492:20)
2014-11-07T05:21:47Z [4928] ERROR at requireModuleFrom
(common/bootstrap/modules.js:645:14)
2014-11-07T05:21:47Z [4928] ERROR at requirePackage
(common/bootstrap/modules.js:805:21)
2014-11-07T05:21:47Z [4928] ERROR at [object Object].Module.require
(common/bootstrap/modules.js:1206:21)
As you can see there is an error on the FOXX code.
After fixing this is a normal output about a request:
2014-11-07T05:23:45Z [4928] INFO /dev/FreeTextEngine, incoming request from 127.0.0.1: GET http://0.0.0.0:8529/dev/FreeTextEngine/create/hotelall?type=*
2014-11-07T05:23:45Z [4928] INFO /dev/FreeTextEngine, outgoing response with status undefined of type application/json, body length: 125

Related

Error: An API error occurred: account_inactive

I tried running npm start but I'm getting this error:
> nescafe#1.0.0 start
> node app
proce: xoxb-2520645612-695846949413-JiOgrqHAMjNk5u2xBl6PZMV3
proce: b2a94e46944f576fa11073dac5368e8f
[INFO] socket-mode:SocketModeClient:0 Going to establish a new connection to Slack ...
⚡️ Bolt app is running!
/home/kr/Workspace/nescafe/node_modules/#slack/web-api/dist/errors.js:56
const error = errorWithCode(new Error(`An API error occurred: ${result.error}`), ErrorCode.PlatformError);
^
Error: An API error occurred: account_inactive
at platformErrorFromResult (/home/kr/Workspace/nescafe/node_modules/#slack/web-api/dist/errors.js:56:33)
at WebClient.apiCall (/home/kr/Workspace/nescafe/node_modules/#slack/web-api/dist/WebClient.js:181:56)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
code: 'slack_webapi_platform_error',
data: { ok: false, error: 'account_inactive', response_metadata: {} }
}
How do I resolve it? I already checked my tokens and they are correct.
The app also runs when I try running it on another laptop. I also tried calling the auth.test as suggested in another stackoverflow question, but it didn't work.
You should not post your token here on Stack Overflow, as it can be used maliciously.
The account_inactive error happens when using a bot token and the bot is uninstalled, or when the token is for a deleted user or workspace. If you reinstall your app, you should receive a new token and that should work.

PhantomJS has crashed - Fatal Windows exception, code 0xc0000005

We have built a application using EmberJS. We got a failure message when we test the application using ember test. Here I mentioned the error message
OS: Windows 8(64-bit)
PhantomJS: 2.1.1
PhantomJS - error
---
message: >
Error:
Non-zero exit code: 3221225477
Stderr:
Fatal Windows exception, code 0xc0000005.
PhantomJS has crashed. Please read the bug reporting guide at
<http://phantomjs.org/bug-reporting.html> and file a bug report.
Log: |
{ type: 'error', text: 'Error: Browser exited unexpectedly' }
{ type: 'error', text: 'Non-zero exit code: 3221225477' }
{ type: 'error',
text: 'Fatal Windows exception, code 0xc0000005.\r\nPhantomJS has crashed. Please read the bug reporting guide at\r\n<http://phantomjs.org/bug-reporting.html> and file a bug report.\r\n'
}
I was having a very similar problem running PhantomJS on Windows 10 in the WSL.
I have found that:
The crash might be originating in the QT WebSocket handling code.
Setting the Karma transports setting to polling solved my issue and PhantomJS does no longer crash on startup.
In your Karma.conf.js add :
transports: ['polling']
Reference Link
PhantomJS Crashing

Parse Server + Express - Issues with ParseError and site dying/restarting

I have deployed a Bitnami Parse stack to a Google Cloud VM. This stack is basically Apache running as a proxy, Then a MEAN stack handling parse server and dashboard etc.
Everything appears to be working fine when accessing the dashboard and sending individual CURL requests to test it's all available.
However, there appears to be a fatal flaw in that. When Parse returns one of it's errors e.g.
{"code":101,"error":"Object not found."}
Express sees it as an uncaught exception and dies. Now I realise that it's intentional behaviour (There's enough information out there as to why you don't want to persist after an uncaught exception)
The Bitnami stack uses Forever to run the Parse Server, but as you can see from the logs I will include below, you still run into issues with refused connections.
2016-11-25T11:41:16+00:00 DEBUG (7): {"code":101,"error":"Object not found."}
2016-11-25T11:41:16+00:00 DEBUG (7): Failed to connect to X.X.X.X: Connection refused
2016-11-25T11:41:17+00:00 DEBUG (7): Failed to connect to X.X.X.X: Connection refused
2016-11-25T11:41:17+00:00 DEBUG (7): Failed to connect to X.X.X.X: Connection refused
2016-11-25T11:41:17+00:00 DEBUG (7): Failed to connect to X.X.X.X: Connection refused
Meanwhile in the Forever logs:
Error generating response. ParseError { code: 101, message: 'Object not found.' } code=101, message=Object not found.
[object Object]
/opt/bitnami/apps/parse/htdocs/node_modules/parse-server/lib/ParseServer.js:425
throw err;
^
Error: EACCES: permission denied, open '/opt/bitnami/apps/parse/htdocs/logs/parse-server.info.2016-11-25'
at Error (native)
error: Forever detected script exited with code: 7
error: Script restart attempt #1
parse-server running on port 1337
parse-dashboard running on port 4040
So you can see that immediately following a Parse error being returned, The service is unavailable until Forever can restart the Parse Server.
This issue appears that it would affect all users as well, so if one user receives an exception, all users lose connection for a brief period.
So the question is, how should this be properly handled? Is Parse + Express not the way to go about it? Or is there some method of configuring Node or Express to return the API error to the requester, without Express dying (And without having to fall into the trap of using uncaughtException to keep Node alive)
Any help would be much appreciated, thank you
The logs from Forever said it's EACCES error, that means ParseServer couldn't access the log file and not able to write the info log in it.
Error: EACCES: permission denied, open '/opt/bitnami/apps/parse/htdocs/logs/parse-server.info.2016-11-25'
at Error (native)
error: Forever detected script exited with code: 7
error: Script restart attempt #1
parse-server running on port 1337
parse-dashboard running on port 4040
I think you have to change the /opt/bitnami/apps/parse/htdocs/logs with proper permission so that ParseServer can write log files in it.

banquo/phantom nodejs error - Cannot read property 'createPage' of undefined

im trying to run https://github.com/ajam/banquo-server and receiving and error
Cannot read property 'createPage' of undefined
Express server listening on port 3000
Requesting http://america.aljazeera.com
/root/banquo-server/node_modules/banquo/src/banquo.js:36
ph.createPage(openPage);
^
TypeError: Cannot read property 'createPage' of undefined
at createPage (/root/banquo-server/node_modules/banquo/src/banquo.js:36:7)
at /root/banquo-server/node_modules/node-phantom/node-phantom.js:65:6
at null._onTimeout (/root/banquo-server/node_modules/node-phantom/node-phantom.js:43:5)
at Timer.listOnTimeout (timers.js:110:15)
error: Forever detected script exited with code: 1
error: Script restart attempt #7
connect.multipart() will be removed in connect 3.0
visit https://github.com/senchalabs/connect/wiki/Connect-3.0 for alternatives
connect.limit() will be removed in connect 3.0
I have checked and an error is being returned from node-phantom.js:36 but does not specify what.
any ideas?
regards
I've had the same issue and fixed it adding the phantomjs binary to PATH.
You can test if it is already set running the command:
$ phantomjs
The following error means that it isn't:
'phantomjs' is not recognized as an internal or external command, operable program or batch file
As you said in a comment:
not a bug as this works on my local mac, not on external server
So, that's not a problem with your code. That's a problem with your environment so I guess that you also missed to set the PATH variable.

canvasengine Tiled_server Error: ENOENT, open './map.json'

This is my problem:
I try start Canvasengine example server and I get this error.
root#vps185158:/# node /var/www/canvas/canvasengine/examples/tiled_server/server/server.js
info - socket.io started
debug - client authorized
info - handshake authorized ogjRNMePBqcD_ZIkFVFK
debug - setting request GET /socket.io/1/websocket/ogjRNMePBqcD_ZIkFVFK
debug - set heartbeat interval for client ogjRNMePBqcD_ZIkFVFK
debug - client authorized for
debug - websocket writing 1::
/node_modules/canvasengine/core/engine-common.js:373
if (err) throw err;
^
Error: ENOENT, open './map.json'
at Error (native)
map.json is there, but nodejs can't find that file.
Server have Debian 7, nodejs, Socket.io and CanvasEngine 1.3.0
Looking at the code, you should either copy map.json to your working directory (which seems to be /, so I wouldn't necessarily recommend that) or start the server from its respective directory:
$ cd /var/www/canvas/canvasengine/examples/tiled_server/server/
$ node server
(although this may require setting $NODE_PATH)

Resources