Error: An API error occurred: account_inactive - node.js

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.

Related

Azure - nodejs serverless function throwing error Error: 13 INTERNAL: Failed to parse server response

I am getting the below expeception, my node serverless function is throwing exception however many time it works correctly, when I check failed request, these exceptions are found.
Exception while executing function: Functions.createParticipantUserEntry node exited with code 1
at Object.module.exports.exports.createStatusError (/azure-functions-host/workers/node/worker-bundle.js:980:15),
details: 'Failed to parse server response',LanguageWorkerConsoleLog[error]
Worker 78afd559-7c19-4b0d-9a60-9a3039049fe2 uncaught exception: Error: Error: 13 INTERNAL: Failed to parse server response
at ClientDuplexStream.<anonymous> (/azure-functions-host/workers/node/worker-bundle.js:18483:19)
at ClientDuplexStream.emit (events.js:400:28)
at ClientDuplexStream._emitStatusIfDone (/azure-functions-host/workers/node/worker-bundle.js:7691:12)
at ClientDuplexStream._receiveStatus (/azure-functions-host/workers/node/worker-bundle.js:7668:8)
at Object.onReceiveStatus (/azure-functions-host/workers/node/worker-bundle.js:23065:15)
at InterceptingListener.module.exports.InterceptingListener._callNext (/azure-functions-host/workers/node/worker-bundle.js:22322:42)
at InterceptingListener.module.exports.InterceptingListener.onReceiveStatus (/azure-functions-host/workers/node/worker-bundle.js:22372:8)
at /azure-functions-host/workers/node/worker-bundle.js:22881:18
This issue is different than Error: 14, this one is Error 13 which is related to the response while Error 14 is related to connection to the azure portal from VS Code.

Dialogflow NodeJS library issue

I'm working on a dialogflow POC where I'm trying to invoke the v2 API provided by DialogFlow. While trying the NodeJS code example provided here, I'm getting the below error
{ Error: EHOSTUNREACH undefined: Getting metadata from plugin failed with error: request to https://www.googleapis.com/oauth2/v4/token failed, reason: connect EHOSTUNREACH 0.0.38.172:80 - Local (192.168.0.103:51468)
at Object.callErrorFromStatus (/Users/devuser/Development/workspaces/df-poc/node_modules/#grpc/grpc-js/build/src/call.js:30:26)
at Http2CallStream.call.on (/Users/devuser/Development/workspaces/df-poc/node_modules/#grpc/grpc-js/build/src/client.js:96:33)
at Http2CallStream.emit (events.js:203:15)
at process.nextTick (/Users/devuser/Development/workspaces/df-poc/node_modules/#grpc/grpc-js/build/src/call-stream.js:75:22)
at process._tickCallback (internal/process/next_tick.js:61:11)
code: 'EHOSTUNREACH',
details:
'Getting metadata from plugin failed with error: request to https://www.googleapis.com/oauth2/v4/token failed, reason: connect EHOSTUNREACH 0.0.38.172:80 - Local (192.168.0.103:51468)',
metadata: Metadata { internalRepr: Map {}, options: {} } }
I have imported GOOGLE_APPLICATION_CREDENTIALS and point the environment variable to the credentials. The invocation works fine if I try the REST API route with the Authorization header.
Kindly let me know if there is something which I'm missing here.
This means EHOST (the remote host of the files you are requesting) are unreachable. They are either down, or your computer cannot access them due to some other restriction, such as location, which can be solved with a VPN.

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.

how to push data into mongodb using sparkfun phant?

I am new to phant and i cannot find a suitable documentation on phant using mongodb. because i have lots of data and it memory overflow occurs. and finally i fell into following error:
HTTP output: { [Error: EMFILE, open 'phant_streams/4d16/83403f7611e5810d57f88174fbef/stream.csv']
errno: -24,
code: 'EMFILE',
path: 'phant_streams/4d16/83403f7611e5810d57f88174fbef/stream.csv' }
events.js:87
throw Error('Uncaught, unspecified "error" event.');
^
Error: Uncaught, unspecified "error" event.
at Error (native)
at Function.emit (events.js:87:13)
at Function.<anonymous> (/usr/lib/node_modules/phant/node_modules/phant-manager-http/index.js:237:12)
at PhantMeta.<anonymous> (/usr/lib/node_modules/phant/node_modules/phant-meta-nedb/lib/phant-meta-nedb.js:243:14)
at callback (/usr/lib/node_modules/phant/node_modules/phant-meta-nedb/node_modules/nedb/lib/executor.js:30:17)
at /usr/lib/node_modules/phant/node_modules/phant-meta-nedb/node_modules/nedb/lib/datastore.js:536:25
at /usr/lib/node_modules/phant/node_modules/phant-meta-nedb/node_modules/nedb/lib/persistence.js:201:12
at fs.js:1077:21
at FSReqWrap.oncomplete (fs.js:95:15)
except this sometimes following error also occurs:
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory
thats why i want to use mongodb to prevent this error. i searched about this and finally found sparckfun library for mongodb:
https://github.com/sparkfun/phant-stream-mongodb
i installed this but nothing happened as data still not string into mongo.
so, How will i store phant data into mongodb ?
I had the same problem, specifically trying to deploy my own Phant instance on Heroku (since I wanted to circumvent Sparkfun's 50Mb limit). After some dabbling with versions of the mongodb and mongoose libraries, I successfully forked and modified their repository so that you can either run it locally or directly deploy on heroku (just make sure you provision a MongoLab add-on). Check out my fork here: https://github.com/davidlago/phant
Hope this helps!

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

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

Resources