Updating from 3.1.0.M2 to 3.1.0.M3 on Windows

Hi Guys,

Having issues updating my Windows install from 3.1.0.M2 to 3.1.0.M3, it fails as follows:

###########################
#  openHAB update script  #
###########################

Checking whether a service exists
Checking the specified openHAB directory
Using C:\openHAB\conf as conf folder
Using C:\openHAB\userdata as userdata folder
Using C:\openHAB\runtime as runtime folder
Using C:\openHAB\addons as addons folder
The current version is 3.1.0
Changing location to C:\openHAB
Current version is equal to specified version (3.1.0.M3).  If you continue, you will REINSTALL 3.1.0.M3 rather than upgrade.
Okay to Continue? [y/N]: y
REINSTALLING version 3.1.0.M3

Making a backup of your distribution to C:\Users\Administrator\AppData\Local\Temp\openhab\backup-3.1.0
Creating backup directories in C:\Users\Administrator\AppData\Local\Temp\openhab\backup-3.1.0
Copying directory conf, userdata and runtime to C:\Users\Administrator\AppData\Local\Temp\openhab\backup-3.1.0\conf
##############################################################################################################
#  Could not backup existing distribution to C:\Users\Administrator\AppData\Local\Temp\openhab\backup-3.1.0  #
##############################################################################################################
PrintAndReturn : Could not find a part of the path 'C:\Users\Administrator\AppData\Local\Temp\openhab\backup-3.1.0\user
data\tmp\mvn\org\openhab\addons\features\karaf\org.openhab.addons.features.karaf.openhab-addons-external\3.1.0.M2\org.o
penhab.addons.features.karaf.openhab-addons-external-3.1.0.M2-influxdb.cfg'.
At C:\Users\Administrator\AppData\Local\Temp\openhab\update\runtime\bin\update.ps1:646 char:14
+ ...        exit PrintAndReturn "Could not backup existing distribution to ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,PrintAndReturn

Press any key to continue . . .

Any ideas on what I need to do, I’ve checked and am definitely using elevated permissions to run the update…

Yup. Learn to read.

and

The computer is giving you all the hints it can to assist you in resolving the issue.

@Bruce_Osborne,
are you sure?
For me, it looks like an auto-generated path by OpenHAB backup routine.
I’m afraid, the path is too long.
Joerg

Please use code fences to clean up the display of the output. It’s really hard to follow.

```
code or logs go here
```

File IO errors can be challenging to solve because what it says may not be what it means. There is a write error there. Could be the file system is iffy. Could be permissions. Could be something else. The message above indicates it can’t find part of the path. But it’s not clear whether it’s trying to read from that path or write to that path. Maybe it will be easier to follow if it were in code fences.

1 Like

Hi, hopefully the formatting is improved now @rlkoshak

EDIT: The path mentioned in the error does seem ridiculously long but obviously the upgrade script is whats setting it, not me so I don’t see the harm in asking for help @Bruce_Osborne ?

p.s. Having checked the path, I can navigate up to:

C:\Users\Administrator\AppData\Local\Temp\openhab\backup-3.1.0\userdata\tmp\mvn\org\openhab\addons\features\karaf\org.openhab.addons.features.karaf.openhab-addons-external\3.1.0.M2

OK, now that it’s easier to read it’s failing at the backup stage. There might be a bug in the upgrade script perhaps. It’s created C:\Users\Administrator\AppData\Local\Temp\openhab\backup-3.1.0.

Verify that that folder exists.

It’s trying to copy to(?)

C:\Users\Administrator\AppData\Local\Temp\openhab\backup-3.1.0\userdata\tmp\mvn\org\openhab\addons\features\karaf\org.openhab.addons.features.karaf.openhab-addons-external\3.1.0.M2\org.openhab.addons.features.karaf.openhab-addons-external-3.1.0.M2-influxdb.cfg

I don’t use Windows so I’ve never looked at the scripts but maybe it needs to generate the sub directories first? Maybe there is a command line argument missing to the copy command or something.

Does it generate the same error when you run backup.bat?

Do you actually use influx, or has it tripped up trying to backup something that isn’t there?

1 Like

Yes, it’s located at C:\Program Files\InfluxDB however the config file is influxdb.conf not .cfg

influxdb.cfg belongs to openHAB, describing the external influx server to it, and lives in the openHAB hierarchy. You edited it once. But the point is that you probably do have one.

Ah yes, I see, it’s talking about this config file: C:\openHAB\conf\services

Seems to work fine:

c:\openHAB\runtime\bin>backup.bat

###########################
#  openHAB backup script  #
###########################

Checking the specified openHAB directory
Creating backup directory C:\openHAB\backups
Using C:\openHAB\conf as conf folder
Using C:\openHAB\userdata as userdata folder
Using C:\openHAB\backups as backups folder
Using C:\openHAB\runtime as runtime folder
Creating temporary backup directory C:\Users\Administrator\AppData\Local\Temp\openhab\backup
Copying userdata and conf folder contents to temp directory
Removing unnecessary files
Removing backup folder from backup userdata if it exists
Zipping up files to C:\openHAB\backups\openhab-backup-21_04_14-08_00_19.zip
Backup created at C:\openHAB\backups\openhab-backup-21_04_14-08_00_19.zip
Removing temporary directory C:\Users\Administrator\AppData\Local\Temp\openhab\backup

So the fix seemed to be to temporarily update the temp dir from the default windows one to something else (I used c:\temp) - not sure if this was permission based issued or just the path ended up getting too long?