Skip to content
This repository has been archived by the owner on May 23, 2019. It is now read-only.

Docker support? #183

Closed
polarathene opened this issue Jun 16, 2016 · 14 comments
Closed

Docker support? #183

polarathene opened this issue Jun 16, 2016 · 14 comments

Comments

@polarathene
Copy link

I've been using the official OH2 docker image, I added the jar for habmin(0.1.6) to a mounted volume for the openhab/addons folder and was able to select the UI in the browser of my host OS. I'm not sure why but few menu options would respond to my clicks. I got the z-wave bindings and things to open and they were stuck on a spinning arrow symbol. I was also able to access scheduler which had some entries in the calendar.

I'm not sure if this is the case out of Docker, if not any ideas on how to debug?

@cdjackson
Copy link
Contributor

Can you open the browser debug console and see if there's an error being thrown?

@polarathene
Copy link
Author

I'll be sure to check that as soon as I can. I did briefly look at the console and I was seeing a bunch of information showing up but I don't recall anything that looked like errors(they might have been further up).

I've had user/group permission issues with access to the host serial device earlier, presumably that isn't an issue with the .jar since the UI was present in the browser. Could be a port maybe.

@cdjackson
Copy link
Contributor

I guess you mean that the user/group permissions are preventing the ZWave port opening? This shouldn't have any bearing on the HABmin JAR. Once the UI is loaded, most of the services are using the standard REST services. So bindings, things, item config etc are all served straight out of the OH runtime.

In most browsers, there should be an icon in the debugger if there is an error.

@polarathene
Copy link
Author

polarathene commented Jun 16, 2016

That was the case but I had solved it prior to using HABmin. I'm able to use my ZWave controller to control some devices in Paper UI, although not having luck with the Yale door lock despite setting the network security key in the config to what I had paired it with in a nodejs project from earlier.

Checking the console I see:

unreachable code after return statement referring to itemModel.js:186. You return null before it's return statement, I guess that was intentional for now?

At a later point when navigating through the side menu I got this warning:
Something is wrong with the Timeline scale. Limited drawing of grid lines to 1000 lines. from vis.js:21107

No other issues, rest of console output is REST activity and status updates. I do have a thing(Hue) that's reporting itself offline and a configuration error, that's ok as I haven't set that up properly yet. Sonos is another thing being reported and that's going fine.

Charts and Dashboard do not respond to clicks, no urls show when moused over and instead of the pointer icon used for some buttons I get the text select cursor instead.

Moving onto third menu item, Automation, rules has the button pointer cursor and a url but no response to clicking, I right clicked and opened it in another tab and that tab fails to load, nothing being thrown in the webconsole, tab is just left with a spinning icon with Connecting. Scheduler appears to work fine, but Notifications also links to this too?

Sitmaps is empty(I've not created any). Configuration, all buttons have url and proper cursor, however only clicking Bindings does something. The Bindings page is largely empty with two panes, the left one says Installed Bindings, underneath a loading icon spins(but it's jittery as the rotation point is not perfectly centered I guess(consider a bitmap over glyph perhaps?) and the text loading beside it, this does not change after a long wait(More than 10 mins). Of note, Paper UI has a similar issue when installing bindings with it's blue circle not disappearing, a refresh is required to verify a binding installed properly. Doing a refresh on this page to treat it like I did Paper UI, UI goes dark and a modal pop up says The server is offline. Several notifications appear to the top right:

  • Error loading inbox!
  • %%KEY_NOT_FOUND%%
  • Error loading the sitemap list!
  • Error loading the dashboard list!

In the webconsole:

  • There are many REST Processing failed in 343692 with various number values. These are scattered throughout.
  • [localizationService] Failed to load: languages/en-GB/thing.lang.json
  • [localizationService] Failed to load: languages/en-GB/rule.lang.json
  • [localizationService] Failed to load: languages/en-GB/binding.lang.json
  • [localizationService] Failed to load: languages/en-GB/dashboard.lang.json
  • [localizationService] Key not found: habmin.chartErrorGettingCharts
  • [localizationService] Failed to load: languages/en-GB/item.lang.json
  • [localizationService] Failed to load: languages/en-GB/extensions.lang.json
  • [localizationService] Failed to load: languages/en-GB/floorplan.lang.json
  • [localizationService] Failed to load: languages/en-GB/chart.lang.json
  • [localizationService] Failed to load: languages/en-GB/smarthome.lang.json
  • [localizationService] Failed to load: languages/en-GB/services.lang.json
  • The connection to http://localhost:8080/rest/events?topics=smarthome/items/* was interrupted while the page was loading.
  • Firefox can't establish a connection to the server at http://localhost:8080/rest/events?topics=smarthome/links/*.
  • The connection to http://localhost:8080/rest/events?topics=smarthome/things/* was interrupted while the page was loading.
  • Firefox can't establish a connection to the server at http://localhost:8080/rest/events?topics=smarthome/inbox/*.
  • Removing saved authentication data!
  • App logged in at startup
  • REST start get Date 2016-06-16T23:02:31.797Z, quite a few of these.
  • Updated to undefined
  • Various version info followed by New Release available 0.1.5 9 Jan Even though I'm on a later version.

Sidebar menu has icons but no text, obviously due to localization errors. The top menu bar no longer has the 8 inbox notifications it once showed, again likely due to the error for inbox rest call. the other configuration menu items I opened in other tabs still had spinning loading icon but seemed to have loaded their pages. I had done this prior to the refresh on Bindings page, refreshing Bindings again and the page works again(I had closed the additional HABmin tabs I opened, not sure if they were causing the problems above). Refreshed again, got the same problems above, refreshing once more returns the page to how I described it prior to all the errors. This doesn't seem to matter where I refresh, any page in HABmin seems to cause it, I assume because it's a SPA.

Continuing down the side menu, Tools. The Log Reader displays no url on hover but does work whereas the Network Viewer does not appear to do anything. Both use the text select cursor instead of button pointer. No errors in console. Users and it's My Preferences page seems to work too.

I'll try reproduce outside of Docker later today. I'll check if the same issues occur in Chrome in case it's due to Firefox.

@cdjackson
Copy link
Contributor

I suspect this must be a docker issue - or something to do with your config since at least most of what you list above works fine.

Clearly from the errors in the log there's something fundimentally wrong given there are a LOT of files that are not being downloaded. I don't know if this is an issue with Docker, or your system for some other reason, but these files should be available.

@polarathene
Copy link
Author

@cdjackson I just got around to checking HABmin via Chromium, I've only clicked to the Bindings page and it loaded instantly with the information that should be there. Went and checked with Firefox again it was missing the text labels on the sidebar once more, clicked configuration icon and then Bindings url on hover showed but page did not update. Here is the web console output:

mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create vis.js:29763:417
unreachable code after return statement eventModel.js:17:12
unreachable code after return statement itemModel.js:186:12
unreachable code after return statement thingModel.js:252:12
Removing saved authentication data! userModel.js:42:13
REST start get Date 2016-06-17T08:24:29.908Z restModel.js:47:13
App logged in at startup app.js:331:13
REST start get Date 2016-06-17T08:24:29.912Z restModel.js:47:13
unreachable code after return statement eventModel.js:17:12
Prefixed Fullscreen API is deprecated. Please use unprefixed API for fullscreen. For more help https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API screenfull.js:135:12
Updated to  undefined itemModel.js:48:17
Version 0.1.5 draft=false pre=false 2016-05-24T15:13:58Z userCheckForUpdate.js:29:25
Version 0.1.4 draft=false pre=false 2016-04-10T22:06:26Z userCheckForUpdate.js:29:25
Version 0.1.3 draft=false pre=false 2016-03-31T09:44:01Z userCheckForUpdate.js:29:25
Version 0.1.2 draft=false pre=false 2016-03-26T18:52:01Z userCheckForUpdate.js:29:25
Version 0.0.15 draft=false pre=false 2015-06-19T22:24:49Z userCheckForUpdate.js:29:25
Version 0.0.14 draft=false pre=false 2015-05-25T21:36:00Z userCheckForUpdate.js:29:25
Version 0.0.13 draft=false pre=false 2015-05-03T23:07:23Z userCheckForUpdate.js:29:25
Version 0.0.12 draft=false pre=false 2015-04-23T12:57:14Z userCheckForUpdate.js:29:25
Version 0.0.11 draft=false pre=false 2015-04-14T16:14:54Z userCheckForUpdate.js:29:25
Version 0.0.10 draft=false pre=false 2015-04-06T18:12:46Z userCheckForUpdate.js:29:25
Version 0.0.9 draft=false pre=false 2015-03-20T21:54:43Z userCheckForUpdate.js:29:25
Version 0.0.8 draft=false pre=false 2015-03-08T15:07:08Z userCheckForUpdate.js:29:25
Version 0.0.7 draft=false pre=false 2015-02-22T19:55:30Z userCheckForUpdate.js:29:25
Version 0.0.6 draft=false pre=false 2015-02-01T11:24:18Z userCheckForUpdate.js:29:25
Version 0.0.5 draft=false pre=false 2015-01-18T22:32:52Z userCheckForUpdate.js:29:25
Version 0.0.4 draft=false pre=true 2015-01-09T00:25:41Z userCheckForUpdate.js:29:25
Version 0.0.3 draft=false pre=true 2015-01-02T20:36:38Z userCheckForUpdate.js:29:25
Version 0.0.2 draft=false pre=true 2014-12-14T21:19:33Z userCheckForUpdate.js:29:25
New Release available 0.1.5 9 Jan userCheckForUpdate.js:60:25
REST start get Date 2016-06-17T08:25:00.241Z restModel.js:47:13

Doesn't really appear to be much errors there besides the unreachable code? No idea why it works fine with Chromium and not Firefox, would assume it's safe to say it's not due to my Docker setup though.

The files were sometimes available, it seemed to alternate based on refreshing the tab, although like described some menu items would not navigate to their content on click. Are you able to verify if Firefox works fine on your end? I'm open to testing some more after the weekend. Have a Mac nearby, could also try VMs and openHAB locally instead of running in Docker.

@cdjackson
Copy link
Contributor

Don't worry about the unreachable code errors - it's not relevant. I've just stuck in a return statement to avoid some code.

Why were you previously getting these errors "Failed to load: languages/en-GB/binding.lang.json". If you get this, then you won't get any strings. Also, "can't establish a connection to the server at http://localhost:8080/rest/events?topics=smarthome/links/*." is very strange - you won't get any updates if you have this sort of error. Again, SSE works find in the version of FF that I have so I don't think that this connection issue is a problem with FF.

I've tested this with Chrome, Safari, Opera and Firefox, and it's wored fine on all browsers. I normally use Chrome, but occasionally switch to Firefox to make sure things are ok, and I know a lot of others are using Firefox.

@polarathene
Copy link
Author

I primarily use Chrome myself, however not quite been an option for me this week. I will test Firefox from another machine to see if it's specific to my system install of it or something else.

The errors you're referring to only appear on Firefox if I refreshed the tab. Refreshing it again seemed to not trigger the errors and get everything into the previous half working state I described initially, refreshing once more would put it in that state that threw all the errors and had issues displaying text. Paper UI worked fine(95% of the time at least) in Firefox so I'm not sure what HABmin does differently? Local storage, https call or caching perhaps?

Will let you know how further testing goes on Monday :)

@polarathene
Copy link
Author

Tested on Chrome and Firefox on OSX(separate machine on the network), worked fine until I opened a 2nd tab of HABmin. Noticed I had an additional tab on my machine(130+ tabs) from earlier. Closed it and HABmin seems to work fine now on my machine with Firefox.

So the issue appears to be multiple HABmin tabs on any browser. Though it's fine to have HABmin tab on each browser at the same time.

@cdjackson
Copy link
Contributor

This issue might be that ESH REST server can't have more than 3 (or there-abouts) clients open since I don't see any reason that you shouldn't be able to have more than 1 HABmin instance open, but there is a limitation in ESH REST server.

@polarathene
Copy link
Author

polarathene commented Jun 20, 2016

That wouldn't explain why it's fine to access HABmin via multiple browsers at once, but not via multiple tabs of a browser would it? Not a major issue now that I know it was because of a buried HABmin tab, I don't suppose many users would use multiple tabs for HABmin?

Would be good if you can confirm this bug on your end btw :)

@cdjackson
Copy link
Contributor

I wouldn't have expected it to make any difference if you have multiple browsers, or multiple tabs - the result should be the same - multiple instances and multiple REST connections.

I've definately seen other issues raised in OH2 where people try and open multiple UIs (not HABmin) and find there's a limit and some transfers are then aborted.

@polarathene
Copy link
Author

If you can confirm it's the same issue on your end, I guess it might be due to a browser API or caching/storage that the browser handles that can be shared across tabs of the same site/ui but the browsers isolate that from one another?

If you can verify the issue exists on your end too I could go open up an issue on an openHAB repo?

@cdjackson
Copy link
Contributor

So, I confirm (I think) what you see. I suspect it’s a browser issue… I’ve found that I can’t open 2 HABmins in the same browser. I also confirm that this is the same with PaperUI (i.e. you can only run a single PaperUI - opening a second in a tab of the same browser, or another window from the same browser, doesn’t work). I can open multiple versions in different browsers (i.e. one in Chrome, and another in Firefox works fine).

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

No branches or pull requests

2 participants