cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
12913
Views
6
Helpful
2
Replies

IR800 - Simple docker python app crashes immediately

Levi Iiams
Level 1
Level 1

I'm trying to use the base image found at: iox-docker/ir800/base-rootfs/yocto-2.1.1/ , since it includes python3 support.  Python2 is not an option; I need to use python requests module.  The python2 compiled in the yocto1.7 image does not include contextlib

When I run my app in docker - all is good. Does what it should do. 

I package it using ioxclient, deploy it to an 829, it starts, everything looks fine, but then app stops immediately. 

My dockerfile:

FROM devhub-docker.cisco.com/iox-docker/ir800/base-rootfs:yocto-2.1.1

RUN opkg update && opkg install python-core && opkg install python-pip

RUN /usr/bin/pip install requests

COPY web-relay.py /web-relay.py

RUN chmod 777 /web-relay.py

CMD /usr/bin/python /web-relay.py

Here is container_log_application:

2018-05-18 10:49:48.031+0000: starting up

PATH=/sbin:/usr/sbin:/bin:/usr/bin LIBVIRT_DEBUG=3 LIBVIRT_LOG_OUTPUTS=3:stderr /usr/lib64/libvirt/libvirt_lxc --name webrelay --console 22 --security=smack --handshake 25 --veth vnet1

PATH=/bin:/sbin TERM=linux container=lxc-libvirt HOME=/ container_uuid=add3d48a-536b-4f4e-922d-d9548c26730d LIBVIRT_LXC_UUID=add3d48a-536b-4f4e-922d-d9548c26730d LIBVIRT_LXC_NAME=webrelay startcontainer.sh

2018-05-18 10:49:48.221+0000: 1: info : libvirt version: 1.2.19

2018-05-18 10:49:48.221+0000: 1: warning : lxcContainerUnmountSubtree:617 : Failed to unmount '/.oldroot/var/volatile/run/libvirt/lxc/webrelay.devpts', trying to detach subtree '/.oldroot': Invalid argument

Here is watchdog:

Waiting to get the ip for interfaces: eth0

Got the ip address for interface eth0

All interfaces got the ips

APP START TIME:1526604752

App webrelay started with PID : 36

Monitoring this process now

App webrelay completed with exit code: 0

APP END TIME:1526604752

Time taken by App : 0 minutes and 0 seconds.

Waiting to get the ip for interfaces: eth0

Got the ip address for interface eth0

All interfaces got the ips

APP START TIME:1526640591

App webrelay started with PID : 36

Monitoring this process now

App webrelay completed with exit code: 0

APP END TIME:1526640591

Time taken by App : 0 minutes and 0 seconds.

I've even attached tech_support file. 

Please help! 

2 Replies 2

Levi Iiams
Level 1
Level 1

I worked it out

So I fixed my Dockerfile first.  Instead of calling python3 bin, just ran my script directly.  Much cleaner/easier to run.

Then I found the article on how to run ioxclient w/ debug (NOTE: on my client, if I do

ioxclient application activate <name> --debug

it fails

ioxclient application activate <name> -debug

Works.

YAY I'm excited!

Hello, @Levi Iiams 

I know it's been a couple of years now but I am facing the exact same issue, the only thing is that I don't understand what you did to solve the problem, do you remember?