OPC UA Adaptor index.js error

0

Hi,
I followed the tutorial for the OPC UA adaptor for Greengrass. But, I got the below mentioned error for the lambda function.
[2019-02-13T16:54:13.431+01:00][INFO]-Running [arn:aws:lambda:eu-central-1:[Customer number]:function:Lambda_OPCUA:1]
[2019-02-13T16:54:13.436+01:00][ERROR]-Failed to import function handler index.handler due to exception: SyntaxError: Invalid regular expression flags
[2019-02-13T16:54:13.437+01:00][ERROR]-/lambda/index.js:30
[2019-02-13T16:54:13.437+01:00][ERROR]- certificateFile: /greengrass/certs/.pem.crt,
[2019-02-13T16:54:13.437+01:00][ERROR]- ^
[2019-02-13T16:54:13.437+01:00][ERROR]-SyntaxError: Invalid regular expression flags
[2019-02-13T16:54:13.437+01:00][ERROR]- at createScript (vm.js:80:10)
[2019-02-13T16:54:13.437+01:00][ERROR]- at Object.runInThisContext (vm.js:139:10)
[2019-02-13T16:54:13.437+01:00][ERROR]- at Module._compile (module.js:617:28)
[2019-02-13T16:54:13.437+01:00][ERROR]- at Object.Module._extensions..js (module.js:664:10)
[2019-02-13T16:54:13.437+01:00][ERROR]- at Module.load (module.js:566:32)
[2019-02-13T16:54:13.437+01:00][ERROR]- at tryModuleLoad (module.js:506:12)
[2019-02-13T16:54:13.437+01:00][ERROR]- at Function.Module._load (module.js:498:3)
[2019-02-13T16:54:13.437+01:00][ERROR]- at Module.require (module.js:597:17)
[2019-02-13T16:54:13.437+01:00][ERROR]- at require (internal/module.js:11:18)
[2019-02-13T16:54:13.437+01:00][ERROR]- at new Runtime (/runtime/nodejs6.10/lambda_nodejs_runtime.js:210:28)
[2019-02-13T16:54:14.128+01:00][INFO]-Running [arn:aws:lambda:eu-central-1:[Customer number]:function:Lambda_OPCUA:1]
[2019-02-13T16:54:14.133+01:00][ERROR]-Failed to import function handler index.handler due to exception: SyntaxError: Invalid regular expression flags
[2019-02-13T16:54:14.134+01:00][ERROR]-/lambda/index.js:30
[2019-02-13T16:54:14.134+01:00][ERROR]- certificateFile: /greengrass/certs/
.pem.crt,
[2019-02-13T16:54:14.134+01:00][ERROR]- ^
[2019-02-13T16:54:14.134+01:00][ERROR]-SyntaxError: Invalid regular expression flags
[2019-02-13T16:54:14.134+01:00][ERROR]- at createScript (vm.js:80:10)
[2019-02-13T16:54:14.134+01:00][ERROR]- at Object.runInThisContext (vm.js:139:10)
[2019-02-13T16:54:14.134+01:00][ERROR]- at Module._compile (module.js:617:28)
[2019-02-13T16:54:14.134+01:00][ERROR]- at Object.Module._extensions..js (module.js:664:10)
[2019-02-13T16:54:14.134+01:00][ERROR]- at Module.load (module.js:566:32)
[2019-02-13T16:54:14.134+01:00][ERROR]- at tryModuleLoad (module.js:506:12)
[2019-02-13T16:54:14.134+01:00][ERROR]- at Function.Module._load (module.js:498:3)
[2019-02-13T16:54:14.134+01:00][ERROR]- at Module.require (module.js:597:17)
[2019-02-13T16:54:14.134+01:00][ERROR]- at require (internal/module.js:11:18)
[2019-02-13T16:54:14.134+01:00][ERROR]- at new Runtime (/runtime/nodejs6.10/lambda_nodejs_runtime.js:210:28)
[2019-02-13T16:54:14.927+01:00][INFO]-Running [arn:aws:lambda:eu-central-1:[Customer number]:function:Lambda_OPCUA:1]
[2019-02-13T16:54:14.932+01:00][ERROR]-Failed to import function handler index.handler due to exception: SyntaxError: Invalid regular expression flags
[2019-02-13T16:54:14.933+01:00][ERROR]-/lambda/index.js:30
[2019-02-13T16:54:14.933+01:00][ERROR]- certificateFile: /greengrass/certs/.pem.crt,
[2019-02-13T16:54:14.933+01:00][ERROR]- ^
[2019-02-13T16:54:14.933+01:00][ERROR]-SyntaxError: Invalid regular expression flags
[2019-02-13T16:54:14.933+01:00][ERROR]- at createScript (vm.js:80:10)
[2019-02-13T16:54:14.933+01:00][ERROR]- at Object.runInThisContext (vm.js:139:10)
[2019-02-13T16:54:14.933+01:00][ERROR]- at Module._compile (module.js:617:28)
[2019-02-13T16:54:14.933+01:00][ERROR]- at Object.Module._extensions..js (module.js:664:10)
[2019-02-13T16:54:14.933+01:00][ERROR]- at Module.load (module.js:566:32)
[2019-02-13T16:54:14.933+01:00][ERROR]- at tryModuleLoad (module.js:506:12)
[2019-02-13T16:54:14.933+01:00][ERROR]- at Function.Module._load (module.js:498:3)
[2019-02-13T16:54:14.933+01:00][ERROR]- at Module.require (module.js:597:17)
[2019-02-13T16:54:14.933+01:00][ERROR]- at require (internal/module.js:11:18)
[2019-02-13T16:54:14.933+01:00][ERROR]- at new Runtime (/runtime/nodejs6.10/lambda_nodejs_runtime.js:210:28)
[2019-02-13T16:54:15.718+01:00][INFO]-Running [arn:aws:lambda:eu-central-1:[Customer number]:function:Lambda_OPCUA:1]
[2019-02-13T16:54:15.724+01:00][ERROR]-Failed to import function handler index.handler due to exception: SyntaxError: Invalid regular expression flags
[2019-02-13T16:54:15.725+01:00][ERROR]-/lambda/index.js:30
[2019-02-13T16:54:15.725+01:00][ERROR]- certificateFile: /greengrass/certs/
.pem.crt,
[2019-02-13T16:54:15.725+01:00][ERROR]- ^
[2019-02-13T16:54:15.725+01:00][ERROR]-SyntaxError: Invalid regular expression flags
[2019-02-13T16:54:15.725+01:00][ERROR]- at createScript (vm.js:80:10)
[2019-02-13T16:54:15.725+01:00][ERROR]- at Object.runInThisContext (vm.js:139:10)
[2019-02-13T16:54:15.725+01:00][ERROR]- at Module._compile (module.js:617:28)
[2019-02-13T16:54:15.725+01:00][ERROR]- at Object.Module._extensions..js (module.js:664:10)

Any help would be grateful.
Thanks,
Santosh

Edited by: SantoshPanda on Feb 13, 2019 8:35 AM

gefragt vor 5 Jahren175 Aufrufe
1 Antwort
0

Hi SantoshPanda,

I assume you're following this guide:
https://docs.aws.amazon.com/greengrass/latest/developerguide/opcua.html

Please attach the logs from your lambda, if any. Those logs are stored at:
[Greengrass-Install-Location]/ggc/var/log/user/[region]/[customer number]

Please also attach your index.js file.

Thanks,
Keagen

AWS
KR-AWS
beantwortet vor 5 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen