Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When bblfshd binary runs inside a container, it crash #132

Closed
dpordomingo opened this issue Nov 17, 2017 · 1 comment
Closed

When bblfshd binary runs inside a container, it crash #132

dpordomingo opened this issue Nov 17, 2017 · 1 comment

Comments

@dpordomingo
Copy link
Member

When a bblfshd binary runs inside a container, it crash.

Is it an expected behavior?

How to reproduce:

I used the following Dockerfile, to define a container with a bblfshd binary inside

FROM ubuntu:16.04

WORKDIR bblfsh

RUN apt-get update && \
    apt-get install --assume-yes wget vim

ENV BBLFSH_VERSION 2.2.0
RUN wget "https://github.com/bblfsh/bblfshd/releases/download/v${BBLFSH_VERSION}/bblfshd_v${BBLFSH_VERSION}_linux_amd64.tar.gz" && \
    wget "https://github.com/bblfsh/bblfshd/releases/download/v${BBLFSH_VERSION}/bblfshctl_v${BBLFSH_VERSION}_linux_amd64.tar.gz" && \
    tar -xf "bblfshd_v${BBLFSH_VERSION}_linux_amd64.tar.gz" && \
    tar -xf "bblfshctl_v${BBLFSH_VERSION}_linux_amd64.tar.gz" && \
    mv */bblfsh* /usr/local/bin/ && \
    rm -rf bblfsh*

RUN apt-get install --assume-yes software-properties-common && \
    add-apt-repository --yes ppa:alexlarsson/flatpak && \
    apt-get update && \
    apt-get install --assume-yes libostree-1-1 tzdata

ENTRYPOINT bblfshd -log-level debug

I built the container, and entered in it:
docker build --rm --tag bblfsh-image .
docker run --detach --interactive --tty --rm --name bblfsh-container bblfsh-image
docker exec --interactive --tty bblfsh-container bash

and from its inside I installed the drivers and tried to parse a python file:

bblfshctl driver install python bblfsh/python-driver:latest;
echo "import something" > example.py
bblfshctl parse example.py

You get:

Installing python driver language from "bblfsh/python-driver:latest"... Done
Status: Fatal
Elapsed: 10.96427ms
Errors:
	- unexpected error: container_linux.go:265: starting container process caused "process_linux.go:250: running exec setns process for init caused \"exit status 34\""
[2017-11-17T21:42:48Z]  INFO bblfshd version: v2.2.0 (build: 2017-11-14T09:15:01+0000)
[2017-11-17T21:42:48Z]  INFO initializing runtime at /var/lib/bblfshd
[2017-11-17T21:42:48Z]  INFO server listening in 0.0.0.0:9432 (tcp)
[2017-11-17T21:42:48Z] DEBUG registering grpc service
[2017-11-17T21:42:48Z]  INFO control server listening in /var/run/bblfshctl.sock (unix)
...
[2017-11-17T21:43:23Z]  INFO driver python installed "bblfsh/python-driver:latest"
[2017-11-17T21:43:23Z] DEBUG detected language "python", filename "example.py"
[2017-11-17T21:43:23Z] DEBUG spawning driver instance "bblfsh/python-driver:latest" ...
nsenter: failed to unshare namespaces: Operation not permitted
WARN[0034] os: process already finished                 
[2017-11-17T21:43:23Z] ERROR error selecting pool: unexpected error: container_linux.go:265: starting container process caused "process_linux.go:250: running exec setns process for init caused \"exit status 34\""
[2017-11-17T21:43:23Z] ERROR request processed content 17 bytes, status Fatal elapsed=48.104549ms language=
@mcuadros
Copy link
Contributor

bblfshd requires root privileges

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants