Replacement of the Apt Snapshot Repository

That looks like an SD card failure to me. I’ll try and run some tests on upgrades.

Hi MikeH!
After executing this the echo part and the wget part I try to run: sudo apt-get install -t unstable openhab-online
E: Value “unstable” not allowed for APT::DEFAULT-RELEASE, value is not available.
What do I make wrong -how can I correct this.
I make a fresh installation on a raspberry PI with actual image.
Thanks for your help.
Georg

wget -qO - 'https://bintray.com/user/downloadSubjectPublicKey?username=openhab' | sudo apt-key add -
echo 'deb http://dl.bintray.com/openhab/apt-repo2 unstable main' | sudo tee /etc/apt/sources.list.d/openhab2.list
sudo apt-get update
sudo apt-get install openhab2 

Will work fine. If you’re looking for the more stable beta branch, then it’s

wget -qO - 'https://bintray.com/user/downloadSubjectPublicKey?username=openhab' | sudo apt-key add -
echo 'deb http://dl.bintray.com/openhab/apt-repo2 testing main' | sudo tee /etc/apt/sources.list.d/openhab2.list
sudo apt-get update
sudo apt-get install openhab2 
1 Like

Thanks Benjy
for four quick reply
it worked.
Kind regards
Georg

Hi, a quick question
I used openhasbian install. I was on the old snapshot build #65x. Today updated the repo to the unstable branch to get the latest build and that got me to the #693

But that’s a build from 4th Jan, Why not the latest?

sudo apt-get update 
sudo apt-get upgrade 

Is not taking me any further?

should I do ?
sudo apt-get install openhab2

Will it upgrade my curent setup and keep my config? I’m afraid to do a separate parallel install and not to mess my house.

First of all, take a backup of your configs. You won’t lose anything during the upgrade but as they say: “better safe than sorry”

Then, follow these steps:

Thanks, I missed that post.
sudo apt-get install openhab2
got me to the latest version without the problems. Just lost server saved habpanel, as usual, but that stays in local browser and can be saved back to the server easily

1 Like

That’s weird but now I have the problem with the serial port after upgrading from snapshot to beta/RC.
I’ve created a separate thread on this issue.

Hi guys,

Anyone had any issues upgrading today to the lastest oh2 apt-get unstable version?
I just did an apt-get update + upgrade and restarted my rpi3 and openhab2 doesn’t come online fully.

The OH2 service is active if I check “systemctl status openhab2.service” but karaf doesn’t respond and neither does any of the guis at 192.168.x.x:8080.

Any advice on where I should start my trouble shooting?
I’m rather new to running both linux and openhab2 and this is a new problem to me.

Start by looking into the /var/log/openhab2/openhab.log file.

sudo su // switch to root
cd /var/log/openhab2 // change directory to the logging directory (optional)
systemctl stop openhab2.service // stop OH2
rm /var/log/openhab2/openhab.log // remove the existing log file
systemctl start openhab2.service // start OH2
tail -f /var/log/openhab2/openhab.log // monitor the log file for errors

Post here your findings :slight_smile:

Nice thank you Angelos. I wasn’t aware that you could tail the log outside of karaf. :slight_smile:

Now tailling the log didn’t give me a whole lot of extra info I’m afraid.
This is my log after starting the openhab2 service and the tailing the log:

2017-01-29 17:50:48.396 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'main_door_open.rules'
2017-01-29 17:50:48.794 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'brand_juvelias.rules'
2017-01-29 17:50:48.819 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'back_door_open.rules'
2017-01-29 17:50:48.854 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'brand_sovrum.rules'
2017-01-29 17:50:48.875 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'brand_hallen.rules'

Nothing more comes.
I added new rules yesterday. So to be safe I removed all the rules. Then restarted the openhab2 service.
The openhab log i now entirely empty.
ssh openhab@localhost -p 8101 gives me "connection refused"
systemctl status openhab2.service says the service is running.

Maybe I should wait until the next release comes? Maybe something went wrong in the latest one?

Does it give any other info (maybe a hint that something is wrong)?

root@homer:~# systemctl status openhab2.service 
● openhab2.service - openHAB 2 - empowering the smart home
   Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled)
   Active: active (running) since Sun 2017-01-29 14:43:54 EET; 4h 45min ago
     Docs: http://docs.openhab.org
           https://community.openhab.org
  Process: 5190 ExecStop=/usr/share/openhab2/runtime/bin/stop (code=exited, status=1/FAILURE)
 Main PID: 5414 (karaf)
   CGroup: /system.slice/openhab2.service
           ├─5414 /bin/bash /usr/share/openhab2/runtime/bin/karaf server
           └─5587 /usr/bin/java -Dopenhab.home=/usr/share/openhab2 -Dopenhab.conf=/etc/openhab2 -Dopenhab.runtime=/usr/share/openhab2/runtime -...

Jan 29 14:43:54 homer systemd[1]: Started openHAB 2 - empowering the smart home.
Jan 29 14:43:54 homer start.sh[5414]: Launching the openHAB runtime...
root@homer:~# 

check also the output of java -version command.

Another way to deal with this could be: Backup your /etc/openhab2/ and /var/lib/openhab2 folders and then apt-get remove openhab2 followed by apt-get install openhab2 (to re-install it without losing your configs). This would be the last resort.

I updated my OH2 Snapshot recently and I didn’t have any problems (from the deb http://dl.bintray.com/openhab/apt-repo2 unstable main repository)

The status is similar to yours. No indications of anything wrong going on.

pi@Home:/var/log/openhab2 $ sudo systemctl status openhab2.service
● openhab2.service - openHAB 2 - empowering the smart home
   Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled)
   Active: active (running) since Sun 2017-01-29 18:13:39 CET; 58min ago
     Docs: http://docs.openhab.org
           https://community.openhab.org
 Main PID: 525 (karaf)
   CGroup: /system.slice/openhab2.service
           ├─ 525 /bin/bash /usr/share/openhab2/runtime/bin/karaf server
           └─1038 /usr/bin/java -Dopenhab.home=/usr/share/openhab2 -Dopenhab....

Jan 29 18:13:39 SkyNetHome systemd[1]: Started openHAB 2 - empowering the s...e.
Jan 29 18:13:40 SkyNetHome start.sh[525]: Launching the openHAB runtime...
Hint: Some lines were ellipsized, use -l to show in full.
pi@Home:/var/log/openhab2 $

I’ll give a re-install a try and see if that changes anything.
Cheers Angelos

1 Like

Did the full re-install and it’s now working again. So strange! Luckily all settings were intact! :smiley:

1 Like

I had the same yesterday, stopped openhab using systemctl, cleaned up cache and tmp directories, and started again using systemctl - this fixed it for me. Perhaps (@maintainers) it might make sense to clean cache/tmp during updates as well ?

Nice, thanks for the advice Max. I’ll make a note of this until next time. :slight_smile:

Definitely yes - I would have thought the upgrade does this already. @Benjy & @theo: Can you comment?

It is indeed:

upgrade)
 removeCache() 
[...] 

removeCache(){
    rm -rf /var/lib/openhab2/cache || true
    rm -rf /var/lib/openhab2/tmp || true
}
1 Like

Just FTR:

I upgraded (apt-get installation) to the latest snapshot today (was on stable before). OH came back up after the update/upgrade, no need to clear any cache directories. Karaf access etc. are all working.

So no general problem. But @ErikAhl also got it working again I see.

Glad you have it working, I’m not sure what the difference would be, removal of cache and tmp folders has been an unchanged feature of the deb packages since well before it moved to it’s own Github repo (before B5).