Error building standalone hub

64 views
Skip to first unread message

Joonas himmanen

unread,
May 19, 2020, 7:35:43 PM5/19/20
to Rhythm Badges
I'm doing a clean install for the server but when trying to run "docker-compose -f dev_ubuntu.yml build" I get the following error:

Building dependency tree...
Reading state information...
E: Unable to locate package python-pip
ERROR: Service 'openbadge-hub-py' failed to build: The command '/bin/sh -c apt-get update && apt-get install -y     python     python-dev     python-pip     python-setuptools     gcc     build-essential     libglib2.0-dev     bluez     --no-install-recommends &&     rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100

There shouldn't be anything missing and everything should be as last time so not exactly sure what's going on.

Joonas himmanen

unread,
May 19, 2020, 9:24:01 PM5/19/20
to Rhythm Badges
Just to clarify, python-pip is installed and I've tried to uninstall and reinstall it several times.

Oren Lederman

unread,
May 20, 2020, 11:43:51 AM5/20/20
to Joonas himmanen, Rhythm Badges
What's "dev_ubuntu.yml"? Doesn't seem to be part of the regular codebase. If you are trying to change the Dockerfile to use a different image as base, that base might not have the same packages as the ones I use here.

I tried the standard yaml, and it's working perfectly fine (docker-compose -f dev.yml build). It's meant to be used with Ubuntu.

--
You received this message because you are subscribed to the Google Groups "Rhythm Badges" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rhythm-badge...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rhythm-badges/084c35fd-7171-4d48-bbd9-369a1c9fec0a%40googlegroups.com.

Joonas himmanen

unread,
May 20, 2020, 2:49:57 PM5/20/20
to Rhythm Badges
I mean the development/standalone mode on openbadge-hub-py that has the following instructions:

Next, use docker-compose to run the hub itself. You can either use the dev_ubuntu.yml (for linux, mac or windows) or dev_jessie.yml (if you are using raspberry pi). For example:
docker-compose -f dev_ubuntu.yml build
docker-compose -f dev_ubuntu.yml up
For convenience, we mount the local source files, data, logs and config directories as volumes in docker. This allows faster builds and easier access to the data generated in this mode.


I can run that on the other machine but I was doing a clean install on a second laptop (Ubuntu 18.04 lts) but for some reason I get that error even though there really shouldn't be anything different. I will try to do a clean install again to see if there was some problem with any of the packages. 
Can the Python 2.7 being on End of Life now cause issues (not necessarily this one but in the future)?

Oren Lederman

unread,
May 20, 2020, 4:23:39 PM5/20/20
to Rhythm Badges
Ok, thought you meant the server. I tried to build the hub-py on my machine (a clean, new one) and I'm not getting any errors either. Perhaps check your docker version?

As for Python 2.7 - yes, it will become a serious issue. Both for the hub and the server. Migrating the hub to python 3 shouldn't be too painful. Migrating the server might - it's basically Django. If this Django server supports Python 3 it shouldn't be too difficult, but if you ned to upgrade to a newer Django, it will require more work.

Joonas himmanen

unread,
May 20, 2020, 7:04:28 PM5/20/20
to Rhythm Badges
What docker version do you use? I'll try that before a clean install

Oren Lederman

unread,
May 20, 2020, 7:49:15 PM5/20/20
to Joonas himmanen, Rhythm Badges
Docker version 19.03.8
docker-compose version 1.24.0

--
You received this message because you are subscribed to the Google Groups "Rhythm Badges" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rhythm-badge...@googlegroups.com.

Joonas himmanen

unread,
May 24, 2020, 11:46:40 PM5/24/20
to Rhythm Badges
Still getting the same error with clean install. Seems to have something to do with Pip itself. I found the following when trying to troubleshoot:

apt-get update is when this problem started, because manifests newer than April 11 no longer contain the python-pip package. I already posted this issue a few posts down, but still no resolution. Yes, python3-pip is still there and installs without problems, but doesn't solve the case of this missing package. 

Could this be the reason?
I'll post my installation "route" soon so you can see if something crucial is missing.
To unsubscribe from this group and stop receiving emails from it, send an email to rhythm...@googlegroups.com.

Joonas himmanen

unread,
May 25, 2020, 11:57:36 PM5/25/20
to Rhythm Badges
This is the "guide" that I use (making a guide so someone who has even less knowledge of Linux than me can still install the system).
Is there anything crucial missing?

I put the guide as attachment.
badgeguide2.txt

Oren Lederman

unread,
May 26, 2020, 11:54:04 AM5/26/20
to Rhythm Badges
Hey, a couple of things:
1. After you create a docker group, you'll want to add your own user to the group so you can run docker without switching users. After you do that, logout completely/restart to make sure it takes affect (just closing your terminal doesn't work).
2. The problem described above is still about getting the openbadge-hub-py to work, using the `docker-compose -f dev_ubuntu.yml build` command, right? On an Ubuntu machine, right?

I'll try to delete my entire docker cache and rebuild. But in the meantime can you try to change the "FROM ubuntu" like in the Dockerfile files to "FROM ubuntu:16.04"? That's the version of Ubuntu I originally used for these builds, so perhaps it will have the correct pip dependencies. 

Oren Lederman

unread,
May 26, 2020, 11:56:07 AM5/26/20
to Rhythm Badges
woops, changing it didn't solve the problem, BUT! It helped me recreate your issue (I deleted the older version of the image I had installed). Stay tuned...

Oren Lederman

unread,
May 26, 2020, 12:21:04 PM5/26/20
to Rhythm Badges
ok, locking the ubuntu version to 18.04 worked. I had to do it in two docker files (the main one, and the aws-backup one). Pull the latest master branch to see the updates.
Let me know whether it's working for you as well

Joonas himmanen

unread,
May 26, 2020, 1:57:01 PM5/26/20
to Rhythm Badges
Thanks to that, I was finally able to build it with the 18.04.

I did come across a new problem now that the standalone hub is up. For some reason it is unable to scan the badges, giving me the following error:
ERROR - Scan failed,Failed to execute mgmt cmd 'le on'
The badge should be running fine and bluetooth is on. Apparently it's an error for bluepy but so far couldn't figure out how to fix it.

Oren Lederman

unread,
May 26, 2020, 4:02:55 PM5/26/20
to Rhythm Badges
Umm. this one will be more difficult to debug since it seems to be running on my machine. but I might have additional packages installed, so it's harder to recreate. 
It does look familiar though. If I had to guess, it's an issue with incompatible Bluez version (we are using an old python bluetooth package that uses Bluez), or a problem finding the correct bluetooth controller on your computer.  


A couple of things to try:
1. Enter the shell in your docker container. `docker-compose -f dev_ubuntu.yml run --entrypoint /bin/bash openbadge-hub-py`
2. try `hcitool  lescan` . Does it work?
3. try `hciconfig` . What's the output? It should show one bluetooth device. If it shows more, it might get confused.

Are you running this on an Ubuntu machine, or a virtual machine that runs Ubuntu? Do you have Bluetooth support on this machine?

Joonas himmanen

unread,
May 26, 2020, 11:45:22 PM5/26/20
to Rhythm Badges
It's Ubuntu machine on laptop and bluetooth itself is working.

From 'hcitool lescan' I get: 
Set scan parameters failed: Input/output error
From 'hciconfig' I get:
Type: BR/EDR BUS: USB
BD Address: C0:CB:38:A8:A4:F1 ACL MTU: 1021 SCO MTU 64:1
UP RUNNING
RX Bytes: 1124 acl:0 sco:0 events:63 errors:0
TX bytes: 3659 acl0 sco0 commands:63 errors:0

It's using laptop's own bluetooth, could separate bluetooth dongle fix the issue? Would upgrading Bluez break everything?

Oren Lederman

unread,
May 27, 2020, 9:48:36 AM5/27/20
to Rhythm Badges
Interesting. Based on the device type, if I'm not mistaken, this device does not support bluetooth 4.0 / bluetooth low energy. Can you share the laptop make/model? Is it  new machine, or old?

A bluetooth dongle might work - I've used them before, mostly in Raspberry PI. When looking for one, look for one that supports Bluetooth 4.0. It's better if it says that it supports Linux. Search on Amazon for CSR 4.0 bluetooth dongle. CSR's chipset seems to work well on linux.

With that, you might run into a problem having multiple bluetooth devices on your machine. After installing the dongle, run the 'hciconfig' command again and check which device shows as hci0 and which one as hci1. If the new dongle registers as hci1, you'll need to change the hub-py code. Search for "hci0" in the badge-hub.py file and change it to "hci1" if needed.

Joonas himmanen

unread,
May 27, 2020, 11:34:49 AM5/27/20
to Rhythm Badges
It's Dell E4310 and it has only Bluetooth 3.0 so I guess that's the problem? The other laptop I've used is Fujitsu A532 which does have 4.0 and it was working earlier (but decided to do a clean install on separate laptop to test things)
I'll go get a Bluetooth dongle and test it

Oren Lederman

unread,
May 27, 2020, 12:32:38 PM5/27/20
to Joonas himmanen, Rhythm Badges
Yup, you got to have Bluetooth 4. That's what the badges work with (more power efficient..)

--
You received this message because you are subscribed to the Google Groups "Rhythm Badges" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rhythm-badge...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rhythm-badges/ed1565cc-71d9-4c39-821b-35a7c6e68e96%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages