telefonicaid / fiware-device-simulator

Simulator of FIWARE-compatible devices (UltraLight 2.0, JSON & NGSIv2)
GNU Affero General Public License v3.0
8 stars 13 forks source link

Error launching simulation: Error: EINVAL: invalid argument, readlink '/etc/localtime' #37

Open cayetanobv opened 7 years ago

cayetanobv commented 7 years ago

Hi team,

When I run this config /examples/urbo-simulation-environment.json raise this error:

{"time":"2017-05-12T09:36:02.580Z","lvl":"INFO","msg":"info event: Simulation configuration transpiling successfully completed!"}
{"time":"2017-05-12T09:36:03.891Z","lvl":"INFO","msg":"stop event"}
{"time":"2017-05-12T09:36:03.898Z","lvl":"INFO","msg":"end event"}
Fri, 12 May 2017 09:37:46 GMT time extending Date constructor
Fri, 12 May 2017 09:37:46 GMT time attempting to resolve timezone directory.
Fri, 12 May 2017 09:37:46 GMT time checking if directory exists: /usr/share/zoneinfo
Fri, 12 May 2017 09:37:46 GMT time found timezone directory at: /usr/share/zoneinfo
Fri, 12 May 2017 09:37:46 GMT time `process.env.TZ` not initially set, attempting to resolve
Fri, 12 May 2017 09:37:46 GMT time Error: EINVAL: invalid argument, readlink '/etc/localtime'
    at Error (native)
    at Object.fs.readlinkSync (fs.js:1014:18)
    at Object.<anonymous> (/usr/src/fiware-device-simulator/node_modules/time/index.js:107:34)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
Fri, 12 May 2017 09:37:46 GMT time "currentTimezone" still not set. Checking "/etc/timezone"
Fri, 12 May 2017 09:37:46 GMT time resolved initial timezone: Etc/UTC
Fri, 12 May 2017 09:37:46 GMT time Date#setTimezone(Etc/UTC, undefined)
Fri, 12 May 2017 09:37:46 GMT time current timezone is not "Etc/UTC", calling tzset()
Fri, 12 May 2017 09:37:46 GMT time set the current timezone to: Etc/UTC

Do you know what could be happening? It has started to happen suddenly.

Thanks!

gtorodelvalle commented 7 years ago

Uhmm... Never got that error, sorry :( Since it is related to the native code of the "time" package, have you tried to get the latest updates from master and running "npm update" followed by "npm rebuild" just to force the rebuilding of the native code and check how it goes then? :)

cayetanobv commented 7 years ago

Thanks @gtorodelvalle ! I pulled latest updates from master branch and now it's running. I'm going to monitor this simulation and if I see something strange I say you. I close the issue.

cayetanobv commented 7 years ago

@gtorodelvalle I reopened this issue because simulation does not work well. We have a dockerized simulator which it is rebooted in each simulation (it sends data to Context Broker but after this it crash with the same time error).