I’ve tried to connect HTTP request to Exact Online. Everything seems to work fine untill the bearer token expires. Am i missing something or is there a way in the settings to refresh the token everytime the webhook receives a new call?
I receive the following message in the console; ‘www-authenticate’: 'Bearer error=“invalid_token”,error_description="The%20message%20expired%20at%2010%2F15%2F2020%2011%3A34%3A37%20AM%20and%20it%20is%20now%20…
The Exact support info says that the bearer token is valid for 10 minutes and has to be refreshed. But i don’t know how i can achieve that in the http request.
You probably can use the IF node. If the HTTP request failed due to token expiration then renew it and make the HTTP request with the new token else do nothing. There should be an endpoint to refresh the token.
Thank you for your reply! I have multiple http nodes in the flow. most of the time the flow stops on the second call from start. really weird because i haven’t seen it stop on the first call. Any idea how i can tell it to refresh the token manually?
Ok, I think I found the issue. The HTTP Node using the OAuth2 authentication method automatically refreshes the token for you. However, by default, the client id and secret are not sent in the body when calling the endpoint to refresh the token, and according to the docs, this is needed. I added an option called Include Credentials on Body (set it to true) to the OAuth2 credentials, and it should do the work. I created a branch that you can use to test locally. Please, let me know if that fixes the issue.
Hi I get the following error on running the flow and pushing the webhook request:
ERROR: Promise.allSettled is not a function
TypeError: Promise.allSettled is not a function
at Object.execute (/home/ieceetee/n8n/packages/nodes-base/nodes/HttpRequest.node.ts:835:43)
at Workflow.runNode (/home/ieceetee/n8n/packages/workflow/src/Workflow.ts:975:28)
at returnPromise (/home/ieceetee/n8n/packages/core/src/WorkflowExecute.ts:596:41)
unfortunatily after the update i received the following message on start:
(node:21670) UnhandledPromiseRejectionWarning: DriverPackageNotInstalledError: SQLite package has not been found installed. Try to install it: npm install sqlite3 --save
at new DriverPackageNotInstalledError (/home/ieceetee/n8n/src/error/DriverPackageNotInstalledError.ts:8:9)
at SqliteDriver.loadDependencies (/home/ieceetee/n8n/src/driver/sqlite/SqliteDriver.ts:135:19)
at new SqliteDriver (/home/ieceetee/n8n/src/driver/sqlite/SqliteDriver.ts:49:14)
at DriverFactory.create (/home/ieceetee/n8n/src/driver/DriverFactory.ts:43:24)
at new Connection (/home/ieceetee/n8n/src/connection/Connection.ts:128:43)
at ConnectionManager.create (/home/ieceetee/n8n/src/connection/ConnectionManager.ts:64:28)
at Object. (/home/ieceetee/n8n/src/index.ts:228:35)
at step (/home/ieceetee/n8n/node_modules/typeorm/node_modules/tslib/tslib.js:141:27)
at Object.next (/home/ieceetee/n8n/node_modules/typeorm/node_modules/tslib/tslib.js:122:57)
at /home/ieceetee/n8n/node_modules/typeorm/node_modules/tslib/tslib.js:115:75
(node:21670) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see Command-line API | Node.js v17.8.0 Documentation). (rejection id: 2)
(node:21670) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
UserSettings got generated and saved to: /root/.n8n/config
(node:21670) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 2)
(node:21670) UnhandledPromiseRejectionWarning: Error: There was an error: SQLite package has not been found installed. Try to install it: npm install sqlite3 --save
at Object.error (/home/ieceetee/n8n/node_modules/@oclif/errors/lib/index.js:26:15)
at Start.error (/home/ieceetee/n8n/node_modules/@oclif/command/lib/command.js:60:23)
at /home/ieceetee/n8n/packages/cli/commands/start.ts:231:10
(node:21670) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see Command-line API | Node.js v17.8.0 Documentation). (rejection id: 3)
I tried to start over again on Linux and Windows. Both with no luck with the modified master.
Below the error on windows after the run build:
../../node_modules/jest-diff/build/diffLines.d.ts:8:13 - error TS1005: '=' expected.
8 import type { DiffOptions } from './types';
~
../../node_modules/jest-diff/build/diffLines.d.ts:8:34 - error TS1005: ';' expected.
8 import type { DiffOptions } from './types';
~~~~~~~~~
../../node_modules/jest-diff/build/index.d.ts:10:13 - error TS1005: '=' expected.
10 import type { DiffOptions } from './types';
~
../../node_modules/jest-diff/build/index.d.ts:10:34 - error TS1005: ';' expected.
10 import type { DiffOptions } from './types';
~~~~~~~~~
../../node_modules/jest-diff/build/index.d.ts:11:1 - error TS1128: Declaration or statement expected.
11 export type { DiffOptions, DiffOptionsColor } from './types';
~~~~~~
../../node_modules/jest-diff/build/index.d.ts:11:13 - error TS1005: ';' expected.
11 export type { DiffOptions, DiffOptionsColor } from './types';
~
../../node_modules/jest-diff/build/index.d.ts:11:52 - error TS1005: ';' expected.
11 export type { DiffOptions, DiffOptionsColor } from './types';
~~~~~~~~~
../../node_modules/jest-diff/build/printDiffs.d.ts:8:13 - error TS1005: '=' expected.
8 import type { DiffOptions, DiffOptionsNormalized } from './types';
~
../../node_modules/jest-diff/build/printDiffs.d.ts:8:57 - error TS1005: ';' expected.
8 import type { DiffOptions, DiffOptionsNormalized } from './types';
~~~~~~~~~
../../node_modules/pretty-format/build/index.d.ts:7:13 - error TS1005: '=' expected.
7 import type * as PrettyFormat from './types';
~
../../node_modules/pretty-format/build/index.d.ts:7:18 - error TS1005: ';' expected.
7 import type * as PrettyFormat from './types';
~~~~~~~~~~~~
../../node_modules/pretty-format/build/index.d.ts:7:31 - error TS1005: ';' expected.
7 import type * as PrettyFormat from './types';
~~~~
../../node_modules/pretty-format/build/index.d.ts:7:36 - error TS1005: ';' expected.
7 import type * as PrettyFormat from './types';
~~~~~~~~~
Found 13 errors.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] build: `tsc`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\UNAME\AppData\Roaming\npm-cache\_logs\2020-10-27T07_39_28_139Z-debug.log
lerna ERR! npm run build exited 2 in 'n8n-workflow'
lerna ERR! npm run build exited 2 in 'n8n-workflow'
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! n8n@ build: `lerna exec npm run build`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the n8n@ build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\UNAME\AppData\Roaming\npm-cache\_logs\2020-10-27T07_39_28_186Z-debug.log
Then probably a dependency changed and it got fixed in the meantime. What you can do is to merge master in the branch from @RicardoE105. Then you will get the latest changes and it should work fine.