Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Openhab-Cloud Docker-Container throws error after Login #227

Closed
darkblackside opened this issue Dec 13, 2018 · 5 comments
Closed

[Bug] Openhab-Cloud Docker-Container throws error after Login #227

darkblackside opened this issue Dec 13, 2018 · 5 comments

Comments

@darkblackside
Copy link

Docker-Container throws error for website:

Error: /opt/openhabcloud/views/index.ejs:2
    1| <% section = 'index' %>
 >> 2| <%- include header.ejs %>
    3|       <% if (!user) { %>
    4| 
    5| <section id="content">

/opt/openhabcloud/views/header.ejs:154
    152|                         <li class="openhab-offline">
    153|                             <!-- <a data-toggle="tooltip" data-placement="left" title data-original-title="Last seen on xxx">openHAB <%= openhabstatus %></a> -->
 >> 154|                             <a href="/events?source=openhab" title="Since <%= date_util(openhablastonline, timeZone).calendar()%>">Offline</a>
    155|                         </li>
    156|                         <% } %>
    157|                         <% } %>

Unknown Timezone: 'UTC'
    at Function.tzset (/data/node_modules/time/index.js:149:15)
    at Date.setTimezone (/data/node_modules/time/index.js:251:18)
    at to_local (/opt/openhabcloud/date_util.js:22:17)
    at to_moment (/opt/openhabcloud/date_util.js:35:30)
    at Object.module.exports [as date_util] (/opt/openhabcloud/date_util.js:39:12)
    at eval (eval at compile (/data/node_modules/ejs/lib/ejs.js:549:12), <anonymous>:84:26)
    at eval (eval at compile (/data/node_modules/ejs/lib/ejs.js:549:12), <anonymous>:146:10)
    at returnedFn (/data/node_modules/ejs/lib/ejs.js:580:17)
    at tryHandleCache (/data/node_modules/ejs/lib/ejs.js:223:34)
    at View.exports.renderFile [as engine] (/data/node_modules/ejs/lib/ejs.js:437:10)
    at View.render (/data/node_modules/express/lib/view.js:128:8)
    at tryRender (/data/node_modules/express/lib/application.js:640:10)
    at Function.render (/data/node_modules/express/lib/application.js:592:3)
    at ServerResponse.render (/data/node_modules/express/lib/response.js:971:7)
    at exports.index (/opt/openhabcloud/routes/homepage.js:8:7)
    at Layer.handle [as handle_request] (/data/node_modules/express/lib/router/layer.js:95:5)
    at next (/data/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/data/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/data/node_modules/express/lib/router/layer.js:95:5)
    at /data/node_modules/express/lib/router/index.js:281:22
    at Function.process_params (/data/node_modules/express/lib/router/index.js:335:12)
    at next (/data/node_modules/express/lib/router/index.js:275:10)

This error is displayed after login/registration on the website. Some people solve this error by not using alpine-linux, which the openhabcloud-app-Container is based on. Maybe alpine-linux doesn't allow accessing the timezones of the system by tzset-function.

Also I tried to create my own docker-container by dockerfile of this repository, but this doesn't seem to work. The sourcecode of the openhab-cloud is missing there. Is the dockerfile the sourcecode of the container in the dockerhub?

Is this docker-thing working for anyone?

@darkblackside darkblackside changed the title Openhab-Cloud Docker-Container throws error after Login [Bug] Openhab-Cloud Docker-Container throws error after Login Dec 13, 2018
@victoryNap
Copy link

victoryNap commented Jun 3, 2019

Any update on this issue? I'm running into it as well.

@darkblackside
Copy link
Author

You've to set up all your docker containers manually. Finally I made it working, but not with this offical files. These have to be updated!

@victoryNap
Copy link

@darkblackside Could you commit your files to a branch?

@darkblackside
Copy link
Author

Hey,

yes I can do that for you. But beware, these files are not in use anymore and I don't know if these are the final files or if I forgot to commit some of them.

https://github.com/darkblackside/Openhab-Cloud-Config

I'm currently working on a better solution, especially for the newly published local commands for Google Home. If I write a good solution for that, I'll publish it. Stay tuned :)

@mapled
Copy link
Contributor

mapled commented Mar 11, 2020

I have the same issue. It appears randomly. Sometimes different browsers have different results at the same time. Maybe it is a client issue?
My app log from the container says

app         | 2020-03-11T22:25:00.304Z - error:  uncaughtException: Unknown Timezone: 'UTC' date=Wed Mar 11 2020 23:25:00 GMT+0100 (UTC), pid=1, uid=100, gid=65533, cwd=/opt/openhabcloud, execPath=/usr/bin/node, version=v7.10.1, argv=[/usr/bin/node, /opt/openhabcloud/app.js], rss=98177024, heapTotal=70438912, heapUsed=62031952, external=18209973, loadavg=[0.1201171875, 0.09423828125, 0.02880859375], uptime=43934, trace=[column=15, file=/data/node_modules/time/index.js, function=Function.tzset, line=149, method=tzset, native=false, column=15, file=/data/node_modules/time/index.js, function=Date.mktime, line=518, method=mktime, native=false, column=21, file=/data/node_modules/time/index.js, function=Date.setSeconds, line=378, method=setSeconds, native=false, column=32, file=/data/node_modules/cron/lib/cron.js, function=CronTime.sendAt, line=73, method=sendAt, native=false, column=30, file=/data/node_modules/cron/lib/cron.js, function=CronTime.getTimeout, line=85, method=getTimeout, native=false, column=33, file=/data/node_modules/cron/lib/cron.js, function=CronJob.start, line=341, method=start, native=false, column=35, file=/data/node_modules/cron/lib/cron.js, function=Timeout.callbackWrapper [as _onTimeout], line=373, method=callbackWrapper [as _onTimeout], native=false, column=14, file=timers.js, function=ontimeout, line=386, method=null, native=false, column=5, file=timers.js, function=tryOnTimeout, line=250, method=null, native=false, column=5, file=timers.js, function=Timer.listOnTimeout, line=214, method=listOnTimeout, native=false], stack=[Error: Unknown Timezone: 'UTC',     at Function.tzset (/data/node_modules/time/index.js:149:15),     at Date.mktime (/data/node_modules/time/index.js:518:15),     at Date.setSeconds (/data/node_modules/time/index.js:378:21),     at CronTime.sendAt (/data/node_modules/cron/lib/cron.js:73:32),     at CronTime.getTimeout (/data/node_modules/cron/lib/cron.js:85:30),     at CronJob.start (/data/node_modules/cron/lib/cron.js:341:33),     at Timeout.callbackWrapper [as _onTimeout] (/data/node_modules/cron/lib/cron.js:373:35),     at ontimeout (timers.js:386:14),     at tryOnTimeout (timers.js:250:5),     at Timer.listOnTimeout (timers.js:214:5)]
app         | 2020-03-11T22:25:00.310Z - error:  tzname=[UTC, ], timezone=0, daylight=0

Output from browser:

Error: /opt/openhabcloud/views/index.ejs:2
    1| <% section = 'index' %>
 >> 2| <%- include header.ejs %>
    3|       <% if (!user) { %>
    4| 
    5| <section id="content">

/opt/openhabcloud/views/header.ejs:149
    147|                         <% if (openhabstatus == 'online') { %>
    148|                         <li class="openhab-online">
 >> 149|                             <a href="/events?source=openhab" title="Since <%= date_util(openhablastonline, timeZone).calendar()%>">Online</a>
    150|                         </li>
    151|                         <% } else { %>
    152|                         <li class="openhab-offline">

Unknown Timezone: 'UTC'
    at Function.tzset (/data/node_modules/time/index.js:149:15)
    at Date.setTimezone (/data/node_modules/time/index.js:251:18)
    at to_local (/opt/openhabcloud/date_util.js:22:17)
    at to_moment (/opt/openhabcloud/date_util.js:35:30)
    at Object.module.exports [as date_util] (/opt/openhabcloud/date_util.js:39:12)
    at eval (eval at compile (/data/node_modules/ejs/lib/ejs.js:549:12), <anonymous>:75:26)
    at eval (eval at compile (/data/node_modules/ejs/lib/ejs.js:549:12), <anonymous>:146:10)
    at returnedFn (/data/node_modules/ejs/lib/ejs.js:580:17)
    at tryHandleCache (/data/node_modules/ejs/lib/ejs.js:223:34)
    at View.exports.renderFile [as engine] (/data/node_modules/ejs/lib/ejs.js:437:10)
    at View.render (/data/node_modules/express/lib/view.js:128:8)
    at tryRender (/data/node_modules/express/lib/application.js:640:10)
    at Function.render (/data/node_modules/express/lib/application.js:592:3)
    at ServerResponse.render (/data/node_modules/express/lib/response.js:971:7)
    at exports.index (/opt/openhabcloud/routes/homepage.js:8:7)
    at Layer.handle [as handle_request] (/data/node_modules/express/lib/router/layer.js:95:5)
    at next (/data/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/data/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/data/node_modules/express/lib/router/layer.js:95:5)
    at /data/node_modules/express/lib/router/index.js:281:22
    at Function.process_params (/data/node_modules/express/lib/router/index.js:335:12)
    at next (/data/node_modules/express/lib/router/index.js:275:10)

This only happens, when I am logged in. After deleting the cookie, I can see the login page again without any problems.
Any ideas how to solve this?
Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants