kizniche / ttn-tracker

Download GPS data transmitted to The Things Network for live display on a map
https://kylegabriel.com/projects/2019/04/lorawan-tracker-and-mapper.html
62 stars 17 forks source link

Issue with GCC and sqlalchemy implementation #10

Closed FloatingOne closed 3 years ago

FloatingOne commented 3 years ago

Thanks for sharing this very useful code and app!

I found some recent issues. Not sure if general issue or it was just me stumbling across this.

(1) GCC causing make build to fail

Initial container build was not succesful. Looking into the logs shows:

gcc: error: src/greenlet/greenlet.c: No such file or directory
gcc: fatal error: no input files

Specific command that caused this behaviour:

gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/local/include/python3.6m -c src/greenlet/greenlet.c -o build/temp.linux-armv7l-3.6/src/greenlet/greenlet.o

Seems GCC is not part of "python:3.6-slim-stretch".

See: Python SDK issue

Therefore adjusted flask_app/Dockerfile as following: Out: python:3.6-slim-stretch In: python:3.7

For sure not optimal as it blows up entire container, but works for now.

(2) flask_app container rebooting because of sqlalchemy

Second thing I noticed: Container "ttn-tracker_flask_app" was reloading every 5 seconds. After looking into the logs, those were pointing towards sqlalchemy integration ("AttributeError: can't set attribute").

See: sqlalchemy version issue

Therefore, I have adjusted preferences file as following: Out: flask_sqlalchemy==2.4.4 In: flask_sqlalchemy==2.5.1

Using this settings, issue is solved. Not sure if best way, though.

Hope this helps. Cheers

kizniche commented 3 years ago

Thanks for the big report. Much appreciated. I'll commit the change.

FloatingOne commented 3 years ago

You are very welcome!

Not sure if this is the final solution, though. Would be great if someone could test and confirm both, the issue and the workaround.

Cheers

kizniche commented 3 years ago

Stretch is an older debian distro. I'll do some testing with a more recent slim version and maybe just add an apt install line to get the dependency.

kizniche commented 3 years ago

Fixed in latest commit.