System logs

How can I view the entire system log for the Homey? I am debugging an error reported by a GitHub user where the app just dies without any exception etc. I need to have a look at the entire system log, but I cannot find anywhere to view it. Anyone who knows?

Not possible. Perhaps you can point the user towards installing the app using the CLI, hopefully that will provide more info on why it crashes.

Yes, I have that log and nothing indicates why it crashed. There is no exception or anything. In a normal Linux environment my next step would be to check dmesg to see if the app was killed due to e.g. memory pressure or access fault (stack overflow?).

Is there any other way to investigate why an app died? Even the exit code from the Node process would be helpful, I think.

you are not able to get the low level logs due to sandboxing. For <2.x apps you needed to implement code that does stuff when the app goes out of memory or is forcefully killed by the system. Did you implement that?

If the process got killed by the OS, it should have shown on the CLI output. Just tested:

2019-01-21 18:38:17 [log] [MyApp] MyApp is running
2019-01-21 18:38:17 [log] [ManagerDrivers] [test] initializing driver
2019-01-21 18:38:22 [log] [MyApp] Killing myself...

--- INFO: name.klep.helloworld has been killed ---

Do you at least get that last line?

No, this is the last line (and the only out of the ordinary):

✖ Connection has been lost, exiting...

I wonder if it’s the built-in HTTP server that might be crashing. Any idea if they are experiencing any other issues besides your app mysteriously crashing?

Got something now. The user could reproduce the issue on the app store version and sent an error report.
The log ends with:

---- stderr ----
(node:5468) UnhandledPromiseRejectionWarning: a: network timeout at: http://localhost:80/api/manager/system/storage
    at Timeout._onTimeout (/node_modules/athom-api/dist/index.js:1:315053)
    at ontimeout (timers.js:498:11)
    at tryOnTimeout (timers.js:323:5)
    at Timer.listOnTimeout (timers.js:290:5)
(node:5468) 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: 1)
(node:5468) [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.

Not sure what it means though…

Actually, now I see that stdout and stderr are separated, so this might just be a warning that occurred earlier. Never saw this warning before though.

I´m the user with the problem… And i can add that i havent got any other problems with other apps they run like they should.

It’s a warning, in the sense that it’s not the cause for your process to exit. But it might be related to why it’s exiting.

It might be worthwhile to ask Athom (through this page) what this warning means. It seems to originate from somewhere inside Homey’s core.

@Peter_Johansson PM me your email address and I can add you to the alpha testing. I have tried adding try/catch around the block that accesses storage. Or just use the GitHub way…