more G-Labs products

Author Topic: Pepper DB update failure  (Read 2589 times)

May 02, 2016, 06:06:09 AM
Read 2589 times

jensc

  • **
  • Information
  • Jr. Member
  • Posts: 34
rc519 on Win 7:

Pepper DB update function fails.  Progress window pops up and vanishes instantly.  No error message but the log indicates the hardcoded web address for Pepper is trashed.

I tried to update after HG indicated none of my devices are found in the database during their setup. I.E., "No device info was found for manufacturer ID = xxxx:xxxx:xxxx".
Seems as if that data does not exist in my installation.

2016-05-01 20:28:24.3758 Info WebServiceGateway   ::1   HTTP   GET   200 /api/HomeAutomation.ZWave/1/Db.Update/http%3A%2F%2Fpepper1.net%2Fzwavedb%2Fdevice%2Fexport%2Fdevice_archive.zip?_=1462159507326 [OPEN]
2016-05-01 20:28:24.4226 Info WebServiceGateway   ::1   HTTP   GET   200 /api/HomeAutomation.ZWave/1/Db.Update/http%3A%2F%2Fpepper1.net%2Fzwavedb%2Fdevice%2Fexport%2Fdevice_archive.zip?_=1462159507326 [CLOSED AFTER 0.041 seconds]

Try this address in your browser and see how far you get:

"http%3A%2F%2Fpepper1.net%2Fzwavedb%2Fdevice%2Fexport%2Fdevice_archive.zip"

There is no error returned in HG if the site is unavailable.  I corrected the address in a browser session and received the file but where do I put the resulting unzipped data in the HG file structure?

Derp!

JC


« Last Edit: May 02, 2016, 08:05:36 AM by jensc »

May 02, 2016, 09:12:39 PM
Reply #1

Bounz

  • ***
  • Information
  • Full Member
  • Posts: 94
The address is ok.
Do you have any other information in log file about updating pepper1 db? Here is example from my homegenie.log:
Code: [Select]
2016-05-02 22:00:33.4064 Info WebServiceGateway 46.188.1.1 HTTP GET 200 /api/HomeAutomation.ZWave/1/Db.Update/http%3A%2F%2Fpepper1.net%2Fzwavedb%2Fdevice%2Fexport%2Fdevice_archive.zip [OPEN]
2016-05-02 22:00:33.4242 Debug Downloading archive from http://pepper1.net/zwavedb/device/export/device_archive.zip.
2016-05-02 22:00:35.1209 Debug Extracting archive from 'archive.zip' to 'temp' folder.
2016-05-02 22:00:40.4092 Debug Creating consolidated DB.

If you don't have such information in your log file you can change logging settings in NLog.config file (located in the root HG installation folder). Change logging rules so they look like this:
Code: [Select]
<rules>
    <logger name="*" minlevel="Trace" writeTo="debugger" />
  </rules>

Also I attach a Peppe1 db file (p1db.xml), you should place it inside the HG_root\lib\mig folder.
Edit: file is too large to be attached here, so you can download it from Dropbox: https://dl.dropboxusercontent.com/u/930921/p1db.xml

May 02, 2016, 10:16:59 PM
Reply #2

jensc

  • **
  • Information
  • Jr. Member
  • Posts: 34

In a fresh install of rc519, there is the file "p1db_custom.xml" (much smaller) in the /lib/mig folder but "p1db.xml" is not there.  Shouldn't there be the latest p1db file that was available when Gene compiled the install file to be updated after the installation?

This is my current nlog.config file:

<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <targets>
        <target name="debugger" xsi:type="Console" layout="${longdate} ${level} ${message}"/>
  </targets>

  <rules>
    <logger name="*" minlevel="Trace" writeTo="debugger" />
  </rules>
</nlog>


You can see your suggested mod is already in place.

My log does not contain anything that looks like these lines in your log sample:

2016-05-02 22:00:33.4242 Debug Downloading archive from http://pepper1.net/zwavedb/device/export/device_archive.zip.
2016-05-02 22:00:35.1209 Debug Extracting archive from 'archive.zip' to 'temp' folder.
2016-05-02 22:00:40.4092 Debug Creating consolidated DB.

Mine has only this:

2016-05-01 20:28:24.4226 Info WebServiceGateway   ::1   HTTP   GET   200 /api/HomeAutomation.ZWave/1/Db.Update/http%3A%2F%2Fpepper1.net%2Fzwavedb%2Fdevice%2Fexport%2Fdevice_archive.zip?_=1462159507326 [CLOSED AFTER 0.041 seconds]

What does that mean?

In addition, your sample contains a gateway IP address "46.188.1.1" where mine at that point has "::1", whatever that is.

I've tried a fresh install on four other computers here with exact same results.

JC


May 02, 2016, 10:26:26 PM
Reply #3

jensc

  • **
  • Information
  • Jr. Member
  • Posts: 34

Another attempt results in this:

2016-05-02 13:20:24.5762 Info WebServiceGateway   ::1   HTTP   GET   200 /api/HomeAutomation.HomeGenie/Config/Interfaces.List/ [OPEN]
2016-05-02 13:20:24.5762 Info WebServiceGateway   ::1   HTTP   GET   200 /api/HomeAutomation.HomeGenie/Config/Interfaces.List/ [CLOSED AFTER 0.001 seconds]
2016-05-02 13:20:37.6775 Info WebServiceGateway   ::1   HTTP   GET   200 /api/HomeAutomation.HomeGenie/Config/Interfaces.List/ [OPEN]
2016-05-02 13:20:37.6775 Info WebServiceGateway   ::1   HTTP   GET   200 /api/HomeAutomation.HomeGenie/Config/Interfaces.List/ [CLOSED AFTER 0.001 seconds]
2016-05-02 13:20:41.2758 Info WebServiceGateway   ::1   HTTP   GET   200 /api/HomeAutomation.ZWave/1/Db.Update/http%3A%2F%2Fpepper1.net%2Fzwavedb%2Fdevice%2Fexport%2Fdevice_archive.zip [OPEN]
2016-05-02 13:20:41.3218 Info WebServiceGateway   ::1   HTTP   GET   200 /api/HomeAutomation.ZWave/1/Db.Update/http%3A%2F%2Fpepper1.net%2Fzwavedb%2Fdevice%2Fexport%2Fdevice_archive.zip [CLOSED AFTER 0.046 seconds]
2016-05-02 13:20:42.0942 Info WebServiceGateway   ::1   HTTP   GET   200 /api/HomeAutomation.ZWave/1/Db.Update/http%3A%2F%2Fpepper1.net%2Fzwavedb%2Fdevice%2Fexport%2Fdevice_archive.zip [OPEN]
2016-05-02 13:20:42.1082 Info WebServiceGateway   ::1   HTTP   GET   200 /api/HomeAutomation.ZWave/1/Db.Update/http%3A%2F%2Fpepper1.net%2Fzwavedb%2Fdevice%2Fexport%2Fdevice_archive.zip [CLOSED AFTER 0.013 seconds]
2016-05-02 13:20:42.7090 Info WebServiceGateway   ::1   HTTP   GET   200 /api/HomeAutomation.ZWave/1/Db.Update/http%3A%2F%2Fpepper1.net%2Fzwavedb%2Fdevice%2Fexport%2Fdevice_archive.zip [OPEN]
2016-05-02 13:20:42.7240 Info WebServiceGateway   ::1   HTTP   GET   200 /api/HomeAutomation.ZWave/1/Db.Update/http%3A%2F%2Fpepper1.net%2Fzwavedb%2Fdevice%2Fexport%2Fdevice_archive.zip [CLOSED AFTER 0.015 seconds]

That "::1" thing looks like a fragment of an IPv6 address.

Could this be the issue?

JC

May 02, 2016, 10:37:50 PM
Reply #4

jensc

  • **
  • Information
  • Jr. Member
  • Posts: 34
Bounz,

BTW, I placed the p1db.xml file, that you sent, in the proper directory and I continue to get "No device info was found for manufacturer ID" when entering setup for every device.

JC

May 02, 2016, 11:10:36 PM
Reply #5

Bounz

  • ***
  • Information
  • Full Member
  • Posts: 94
Ok, I've just installed HG on Win10 x64 machine and can confirm, that upgrading P1 DB doesn't work.
It's related with error of loading ICSharpCode.SharpZipLib assembly, which is used to handle zip archives. I'll try to fix it.
Code: [Select]
2016-05-02 23:59:50.3837 Error HomeAutomation.HomeGenie Trapper Unhandled Exception Error.Exception System.IO.FileLoadException: Could not load file or assembly 'ICSharpCode.SharpZipLib, Version=0.86.0.518, Culture=neutral, PublicKeyToken=1b03e6acf1164f73' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'ICSharpCode.SharpZipLib, Version=0.86.0.518, Culture=neutral, PublicKeyToken=1b03e6acf1164f73'
   at MIG.Interfaces.HomeAutomation.Pepper1Db.Update(String pepper1Url)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()

=== Pre-bind state information ===
LOG: DisplayName = ICSharpCode.SharpZipLib, Version=0.86.0.518, Culture=neutral, PublicKeyToken=1b03e6acf1164f73
 (Fully-specified)
LOG: Appbase = file:///C:/Program Files/HomeGenie/
LOG: Initial PrivatePath = NULL
Calling assembly : MIG.HomeAutomation, Version=1.0.5933.24614, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Program Files\HomeGenie\HomeGenie.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Post-policy reference: ICSharpCode.SharpZipLib, Version=0.86.0.518, Culture=neutral, PublicKeyToken=1b03e6acf1164f73
LOG: Attempting download of new URL file:///C:/Program Files/HomeGenie/ICSharpCode.SharpZipLib.DLL.
WRN: Comparing the assembly name resulted in the mismatch: PUBLIC KEY TOKEN
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

Quote
BTW, I placed the p1db.xml file, that you sent, in the proper directory and I continue to get "No device info was found for manufacturer ID" when entering setup for every device.
Did you restart HG service after this manipulations?

May 02, 2016, 11:23:59 PM
Reply #6

Bounz

  • ***
  • Information
  • Full Member
  • Posts: 94
Well, try to replace ICSharpCode.SharpZipLib.dll with attached file. It should solve issue with updating pepper1 db.

May 02, 2016, 11:45:33 PM
Reply #7

jensc

  • **
  • Information
  • Jr. Member
  • Posts: 34
Quote
Did you restart HG service after this manipulations?

Yes...

May 03, 2016, 12:05:43 AM
Reply #8

Bounz

  • ***
  • Information
  • Full Member
  • Posts: 94
If after replacing ICSharpCode.SharpZipLib.dll the problem with getting node info will remain, please edit NLog.config to enable additional logs:
Code: [Select]
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <targets>
        <target name="debugger" xsi:type="Console" layout="${longdate} ${level} ${message}"/>
        <target name="file" xsi:type="File" fileName="HG.log" layout="${longdate} ${level} ${message}" concurrentWrites="true"/>
  </targets>

  <rules>
    <logger name="*" minlevel="Trace" writeTo="debugger" />
    <logger name="*" minlevel="Trace" writeTo="file" />
  </rules>
</nlog>
Then there will apper HG.log file in the root of HG folder with debug logs. Look there for strings like "Found 0 elements in p1db.xml with query".

May 03, 2016, 12:14:55 AM
Reply #9

jensc

  • **
  • Information
  • Jr. Member
  • Posts: 34
Bounz,

You fixed it!  Good work.  Note that it was not working with Win 7, 8, or 10.

Also, under Win 10, dammit, when you receive a file from someone else, i.e., "p1db.xml",  Windows 10 blocks it so update was unable to overwrite it and locked up after your fix.  I had to enter file properties and "unblock" it.  Then, of course, it worked.  That's the richest man on Earth trying to protect us from ourselves....  bastard!  The old programmers adage says: "When you've finally made your software idiot proof only an idiot can use it."  OK, then, what if you're not an idiot.  Jesus, Mary and feckin' Joseph!

I continue to get "No device info was found for manufacturer ID" when entering setup for every device.  Clearly another issue.

JC

May 03, 2016, 12:21:12 AM
Reply #10

Bounz

  • ***
  • Information
  • Full Member
  • Posts: 94
Glad to hear that issue with updating pepper1 db is fixed.
About getting error "No device info was found for manufacturer ID" - use steps from my previos reply (http://www.homegenie.it/forum/index.php?topic=1544.msg9778#msg9778)

May 03, 2016, 01:28:57 AM
Reply #11

jensc

  • **
  • Information
  • Jr. Member
  • Posts: 34
Bounz,

Here is the hg.log file if you wish to wander through it.

JC

May 03, 2016, 07:46:28 AM
Reply #12

Bounz

  • ***
  • Information
  • Full Member
  • Posts: 94
Well, found it.
Issue was because MIG.HomeAutomation.dll was compiled using Newtonsoft.Json version 8.0.2, but the rest part of HG uses Newtonsoft.Json version 7.0.1, so Mig.HomeAutomation was not able to find the dll needed.

I created a pull request on GitHub. Meanwhile you could replace MIG.HomeAutomation.dll in your HG_root\lib\mig folder on one from attached file.

May 03, 2016, 10:57:21 PM
Reply #13

jensc

  • **
  • Information
  • Jr. Member
  • Posts: 34
Bounz,

Thank you!

It appears that between us we mashed two bugs.

Team work works!

Cheers!

JC

May 04, 2016, 12:21:41 AM
Reply #14

jensc

  • **
  • Information
  • Jr. Member
  • Posts: 34
Bounz,

After that last updated file "MIG.HomeAutomation.dll" it appears the configuration backup is not functioning.

"http://control/api/HomeAutomation.HomeGenie/Config/System.Configure/System.ConfigurationBackup" opens another browser screen and doesn't display the usual dialog box and no backup file is created.

JC