# Error with 1.2.0 & genieacs-cwmp (Unhandled Promise Rejection Warning)

**URL:** <https://forum.genieacs.com/t/error-with-1-2-0-genieacs-cwmp-unhandled-promise-rejection-warning/1057>\
**Category:** Uncategorized\
**Created:** [September 16, 2020, 4:16pm UTC](https://forum.genieacs.com/t/error-with-1-2-0-genieacs-cwmp-unhandled-promise-rejection-warning/1057 "2020-09-16T16:16:12Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![tripout](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/tripout/32/164_2.png) [@tripout](https://forum.genieacs.com/u/tripout)\
**Post date:** [September 16, 2020, 4:16pm UTC](https://forum.genieacs.com/t/error-with-1-2-0-genieacs-cwmp-unhandled-promise-rejection-warning/1057/1 "2020-09-16T16:16:12Z")

</div>

I recently moved a bunch of CPE over to GenieACS (latest pulled from github), their inform interval is set for 3600 seconds but I have not recieved another inform since 12:31:44pm yesterday. I checked the services and they are all running but found this error was spit out by genieacs-cwmp.

```
Sep 15 12:31:44 acs genieacs-cwmp[977]: (node:1078) UnhandledPromiseRejectionWarning: Error 
[ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
Sep 15 12:31:44 acs genieacs-cwmp[977]: at ServerResponse.setHeader 
(_http_outgoing.js:518:11)
Sep 15 12:31:44 acs genieacs-cwmp[977]: at ServerResponse.writeHead (_http_server.js:273:21)
Sep 15 12:31:44 acs genieacs-cwmp[977]: at /home/genieacs/genieacs/dist/bin/genieacs- 
cwmp:2:131004
Sep 15 12:31:44 acs genieacs-cwmp[977]: at runMicrotasks (<anonymous>)
Sep 15 12:31:44 acs genieacs-cwmp[977]: at processTicksAndRejections 
(internal/process/task_queues.js:97:5)
Sep 15 12:31:44 acs genieacs-cwmp[977]: (node:1078) UnhandledPromiseRejectionWarning: 
Unhandled promise rejection. This error originated either by throwing inside of an async function 
without a catch block, or by rejecting a promise whic...
```

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [September 16, 2020, 4:41pm UTC](https://forum.genieacs.com/t/error-with-1-2-0-genieacs-cwmp-unhandled-promise-rejection-warning/1057/2 "2020-09-16T16:41:27Z")

</div>

Your title and the body of your message are not consistent. Did you pull the v1.2.0 tag, or did you pull latest? There have been several fixes since v1.2.0.

If you are running v1.2.0, I suggest you update to master.

---

<div class="post-metadata">

**Author:** ![tripout](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/tripout/32/164_2.png) [@tripout](https://forum.genieacs.com/u/tripout)\
**Post date:** [September 16, 2020, 4:44pm UTC](https://forum.genieacs.com/t/error-with-1-2-0-genieacs-cwmp-unhandled-promise-rejection-warning/1057/3 "2020-09-16T16:44:16Z")

</div>

Ah yes, I should’ve checked github first. I apologize. It looks like I am running a copy from Sept 9th from github and I see recent fixes.

---

<div class="post-metadata">

**Author:** ![zaidka](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/zaidka/32/9_2.png) [@zaidka](https://forum.genieacs.com/u/zaidka)\
**Post date:** [September 16, 2020, 6:27pm UTC](https://forum.genieacs.com/t/error-with-1-2-0-genieacs-cwmp-unhandled-promise-rejection-warning/1057/4 "2020-09-16T18:27:53Z")

</div>

Are you still getting this error after updating?

---

<div class="post-metadata">

**Author:** ![tripout](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/tripout/32/164_2.png) [@tripout](https://forum.genieacs.com/u/tripout)\
**Post date:** [September 16, 2020, 8:23pm UTC](https://forum.genieacs.com/t/error-with-1-2-0-genieacs-cwmp-unhandled-promise-rejection-warning/1057/5 "2020-09-16T20:23:58Z")

</div>

I have updated from the latest master on github and let it run for a bit. Came back from lunch and saw this error again.

```
Sep 16 12:34:13 acs genieacs-cwmp[22406]: (node:23530) UnhandledPromiseRejectionWarning: Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
Sep 16 12:34:13 acs genieacs-cwmp[22406]: at ServerResponse.setHeader (_http_outgoing.js:518:11)
Sep 16 12:34:13 acs genieacs-cwmp[22406]: at ServerResponse.writeHead (_http_server.js:273:21)
Sep 16 12:34:13 acs genieacs-cwmp[22406]: at /home/genieacs/genieacs/dist/bin/genieacs-cwmp:2:131043
Sep 16 12:34:13 acs genieacs-cwmp[22406]: at runMicrotasks (<anonymous>)
Sep 16 12:34:13 acs genieacs-cwmp[22406]: at processTicksAndRejections (internal/process/task_queues.js:97:5)
Sep 16 12:34:13 acs genieacs-cwmp[22406]: (node:23530) 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 https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 20)
```

---

<div class="post-metadata">

**Author:** ![zaidka](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/zaidka/32/9_2.png) [@zaidka](https://forum.genieacs.com/u/zaidka)\
**Post date:** [September 17, 2020, 1:14am UTC](https://forum.genieacs.com/t/error-with-1-2-0-genieacs-cwmp-unhandled-promise-rejection-warning/1057/6 "2020-09-17T01:14:26Z")

</div>

Are you sure you’re running the most up to date version? As of 1.2.1 unhandled promise rejections should never occur. You should get a regular exception instead.

---

<div class="post-metadata">

**Author:** ![tripout](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/tripout/32/164_2.png) [@tripout](https://forum.genieacs.com/u/tripout)\
**Post date:** [September 17, 2020, 4:34am UTC](https://forum.genieacs.com/t/error-with-1-2-0-genieacs-cwmp-unhandled-promise-rejection-warning/1057/7 "2020-09-17T04:34:38Z")

</div>

I double checked everything and can confirm that I am running 1.2.1.

When I run it manually instead of starting from systemd

```
root@acs:/home/genieacs/genieacs# /home/genieacs/genieacs/dist/bin/genieacs-cwmp
2020-09-17T04:32:28.746Z [INFO] genieacs-cwmp starting; pid=2074 version="1.2.1+20200916172228"

```

I also modified the systemd file on my previous install to point to this location.

```
[Service]
User=genieacs
EnvironmentFile=/home/genieacs/genieacs/genieacs.env
ExecStart=/home/genieacs/genieacs/dist/bin/genieacs-cwmp
```

---

<div class="post-metadata">

**Author:** ![npoxBocT](https://avatars.discourse-cdn.com/v4/letter/n/58956e/32.png) [@npoxBocT](https://forum.genieacs.com/u/npoxBocT)\
**Post date:** [September 17, 2020, 9:48am UTC](https://forum.genieacs.com/t/error-with-1-2-0-genieacs-cwmp-unhandled-promise-rejection-warning/1057/8 "2020-09-17T09:48:48Z")

</div>

The same with genie-ui. A lot of “UnhandledPromiseRejectionWarning: Unhandled promise rejection.”  
version=“1.2.1+20200909044125” from npm

> **log part for ex.**
>
> ```
> Sep 17 14:39:03 shelter genieacs-ui[2974]: (node:2986) UnhandledPromiseRejectionWarning: TypeError: this.exprSynths.map(...).flat is not a function
> Sep 17 14:39:03 shelter genieacs-ui[2974]: at Dt.true (/usr/local/lib/node_modules/genieacs/bin/genieacs-ui:2:39324)
> Sep 17 14:39:03 shelter genieacs-ui[2974]: at xt.true (/usr/local/lib/node_modules/genieacs/bin/genieacs-ui:2:40137)
> Sep 17 14:39:03 shelter genieacs-ui[2974]: at Ut (/usr/local/lib/node_modules/genieacs/bin/genieacs-ui:2:48240)
> Sep 17 14:39:03 shelter genieacs-ui[2974]: at Ft (/usr/local/lib/node_modules/genieacs/bin/genieacs-ui:2:49952)
> Sep 17 14:39:03 shelter genieacs-ui[2974]: at Ht (/usr/local/lib/node_modules/genieacs/bin/genieacs-ui:2:50312)
> Sep 17 14:39:03 shelter genieacs-ui[2974]: at mn.get (/usr/local/lib/node_modules/genieacs/bin/genieacs-ui:2:77550)
> Sep 17 14:39:03 shelter genieacs-ui[2974]: at dispatch (/usr/local/lib/node_modules/genieacs/node_modules/koa-compose/index.js:42:32)
> Sep 17 14:39:03 shelter genieacs-ui[2974]: at /usr/local/lib/node_modules/genieacs/node_modules/koa-router/lib/router.js:372:16
> Sep 17 14:39:03 shelter genieacs-ui[2974]: at dispatch (/usr/local/lib/node_modules/genieacs/node_modules/koa-compose/index.js:42:32)
> Sep 17 14:39:03 shelter genieacs-ui[2974]: at /usr/local/lib/node_modules/genieacs/node_modules/koa-compose/index.js:34:12
> Sep 17 14:39:03 shelter genieacs-ui[2974]: (node:2986) 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(). (rejection id: 4)
> 
> ```

---

<div class="post-metadata">

**Author:** ![zaidka](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/zaidka/32/9_2.png) [@zaidka](https://forum.genieacs.com/u/zaidka)\
**Post date:** [September 18, 2020, 12:27am UTC](https://forum.genieacs.com/t/error-with-1-2-0-genieacs-cwmp-unhandled-promise-rejection-warning/1057/9 "2020-09-18T00:27:57Z")

</div>

So I was wrong when I assumed the linter rule that I added recently to guard against unhandled promise rejections covers every possible case. @tripout, just fixed this edge case so please update from git master and try again.

@npoxBocT, you’ll just need to upgrade your Node.js to 12 or 14.

---

<div class="post-metadata">

**Author:** ![npoxBocT](https://avatars.discourse-cdn.com/v4/letter/n/58956e/32.png) [@npoxBocT](https://forum.genieacs.com/u/npoxBocT)\
**Post date:** [September 18, 2020, 5:54am UTC](https://forum.genieacs.com/t/error-with-1-2-0-genieacs-cwmp-unhandled-promise-rejection-warning/1057/10 "2020-09-18T05:54:33Z")

</div>

oh. @zaidka thank u. solved

---

<div class="post-metadata">

**Author:** ![tripout](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/tripout/32/164_2.png) [@tripout](https://forum.genieacs.com/u/tripout)\
**Post date:** [September 18, 2020, 4:57pm UTC](https://forum.genieacs.com/t/error-with-1-2-0-genieacs-cwmp-unhandled-promise-rejection-warning/1057/11 "2020-09-18T16:57:10Z")

</div>

@zaidka I downloaded the latest master zip from github, ran npm install and upon running npm run build i get the following error.

```
> genieacs@1.2.1 build /home/genieacs/genieacs
> node -r esm -r ts-node/register/transpile-only build/build

Error: @rollup/plugin-typescript TS2717: Subsequent property declarations must have the same 
type. Property 'authorizer' must be of type 'Authorizer', but here has type 'Authorizer'.
at error (/home/genieacs/genieacs/node_modules/rollup/dist/shared/rollup.js:5212:30)
at throwPluginError (/home/genieacs/genieacs/node_modules/rollup/dist/shared/rollup.js:17798:12)
at Object.error (/home/genieacs/genieacs/node_modules/rollup/dist/shared/rollup.js:18417:24)
at emitDiagnostic (/home/genieacs/genieacs/node_modules/@rollup/plugin- 
typescript/dist/index.js:415:17)
at reportDiagnostics (/home/genieacs/genieacs/node_modules/@rollup/plugin- 
typescript/dist/index.js:423:9)
at Array.forEach (<anonymous>)
at emitFilesAndReportErrors 
(/home/genieacs/genieacs/node_modules/typescript/lib/typescript.js:108219:21)
at Object.result.afterProgramCreate 
(/home/genieacs/genieacs/node_modules/typescript/lib/typescript.js:108390:13)
at Object.afterProgramCreate (/home/genieacs/genieacs/node_modules/@rollup/plugin- 
typescript/dist/index.js:515:29)
at synchronizeProgram 
(/home/genieacs/genieacs/node_modules/typescript/lib/typescript.js:108654:22)
```

---

<div class="post-metadata">

**Author:** ![zaidka](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/zaidka/32/9_2.png) [@zaidka](https://forum.genieacs.com/u/zaidka)\
**Post date:** [September 18, 2020, 5:13pm UTC](https://forum.genieacs.com/t/error-with-1-2-0-genieacs-cwmp-unhandled-promise-rejection-warning/1057/12 "2020-09-18T17:13:20Z")

</div>

This is odd. What version of Node are you using?

---

<div class="post-metadata">

**Author:** ![tripout](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/tripout/32/164_2.png) [@tripout](https://forum.genieacs.com/u/tripout)\
**Post date:** [September 18, 2020, 5:14pm UTC](https://forum.genieacs.com/t/error-with-1-2-0-genieacs-cwmp-unhandled-promise-rejection-warning/1057/13 "2020-09-18T17:14:17Z")

</div>

```
root@acs:/home/genieacs/genieacs# node --version
v12.18.3
root@acs:/home/genieacs/genieacs#

```

Version 12.18.3.

---

<div class="post-metadata">

**Author:** ![zaidka](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/zaidka/32/9_2.png) [@zaidka](https://forum.genieacs.com/u/zaidka)\
**Post date:** [September 18, 2020, 5:23pm UTC](https://forum.genieacs.com/t/error-with-1-2-0-genieacs-cwmp-unhandled-promise-rejection-warning/1057/14 "2020-09-18T17:23:57Z")

</div>

Can you run the following command and share the result: `npm ls --depth 0`

---

<div class="post-metadata">

**Author:** ![tripout](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/tripout/32/164_2.png) [@tripout](https://forum.genieacs.com/u/tripout)\
**Post date:** [September 18, 2020, 5:25pm UTC](https://forum.genieacs.com/t/error-with-1-2-0-genieacs-cwmp-unhandled-promise-rejection-warning/1057/15 "2020-09-18T17:25:40Z")

</div>

Here are the results;

> **[root@acs:/home/genieacs/genieacs# npm ls --depth 0genieacs@1.2.1 /home/genieac...](https://pastebin.com/9ATB35r4)**
>
> Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.

---

<div class="post-metadata">

**Author:** ![zaidka](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/zaidka/32/9_2.png) [@zaidka](https://forum.genieacs.com/u/zaidka)\
**Post date:** [September 18, 2020, 5:27pm UTC](https://forum.genieacs.com/t/error-with-1-2-0-genieacs-cwmp-unhandled-promise-rejection-warning/1057/16 "2020-09-18T17:27:42Z")

</div>

That’s identical to what I got. Can you confirm no changes have been made to the code?

---

<div class="post-metadata">

**Author:** ![tripout](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/tripout/32/164_2.png) [@tripout](https://forum.genieacs.com/u/tripout)\
**Post date:** [September 18, 2020, 5:45pm UTC](https://forum.genieacs.com/t/error-with-1-2-0-genieacs-cwmp-unhandled-promise-rejection-warning/1057/17 "2020-09-18T17:45:20Z")

</div>

I can confirm I’ve not made any changes to the code, I download the master from github, copy it over to the proper folder, run the npm install and npm run build command.

---

<div class="post-metadata">

**Author:** ![zaidka](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/zaidka/32/9_2.png) [@zaidka](https://forum.genieacs.com/u/zaidka)\
**Post date:** [September 18, 2020, 5:51pm UTC](https://forum.genieacs.com/t/error-with-1-2-0-genieacs-cwmp-unhandled-promise-rejection-warning/1057/18 "2020-09-18T17:51:41Z")

</div>

I’m clueless here. Need to give this some thought. Maybe run `npm run lint` to see if you get any errors or warnings?

---

<div class="post-metadata">

**Author:** ![tripout](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/tripout/32/164_2.png) [@tripout](https://forum.genieacs.com/u/tripout)\
**Post date:** [September 18, 2020, 5:55pm UTC](https://forum.genieacs.com/t/error-with-1-2-0-genieacs-cwmp-unhandled-promise-rejection-warning/1057/19 "2020-09-18T17:55:07Z")

</div>

I do get a couple errors showing up in ui/ui/app.ts here is the pastebin from the part where it starts to error.

> **[\> genieacs@1.2.1 lint-tsc /home/genieacs/genieacs\> tsc...](https://pastebin.com/2gLqUPKn)**
>
> Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.

---

<div class="post-metadata">

**Author:** ![zaidka](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/zaidka/32/9_2.png) [@zaidka](https://forum.genieacs.com/u/zaidka)\
**Post date:** [September 18, 2020, 6:06pm UTC](https://forum.genieacs.com/t/error-with-1-2-0-genieacs-cwmp-unhandled-promise-rejection-warning/1057/20 "2020-09-18T18:06:33Z")

</div>

> ui/ui/app.ts

There should not be such file. Looks like you have another copy of the project under `ui` directory…

[Next page](https://forum.genieacs.com/t/error-with-1-2-0-genieacs-cwmp-unhandled-promise-rejection-warning/1057.md?page=2)
