zenoh icon indicating copy to clipboard operation
zenoh copied to clipboard

REST API always returns empty array

Open mbspng opened this issue 6 months ago • 6 comments

Describe the bug

REST API always returns empty array

To reproduce

Build an run this Docker code

# Use an official Ubuntu as a parent image
FROM ubuntu:20.04 AS builder

# Set environment variables to non-interactive to prevent prompts
ENV DEBIAN_FRONTEND=noninteractive
ENV PYENV_ROOT /root/.pyenv
ENV PATH $PYENV_ROOT/bin:$PATH

# Install system dependencies
RUN apt-get update && \
    apt-get install -y \
    python3-pip \
    wget \
    git \
    libasio-dev \
    libtinyxml2-dev \
    swig \
    libpython3-dev \
    python3-venv \
    sudo \
    build-essential \
    libssl-dev \
    gcc-10 \
    g++-10 \
    make \
    libssl-dev \
    zlib1g-dev \
    libbz2-dev \
    libreadline-dev \
    libsqlite3-dev \
    curl \
    llvm \
    libncurses5-dev \
    libncursesw5-dev \
    xz-utils \
    tk-dev \
    libffi-dev \
    liblzma-dev && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

# Install pyenv and set Python version
RUN curl https://pyenv.run | bash && \
    pyenv install 3.10.13 && \
    pyenv global 3.10.13

# RUN wget --no-check-certificate https://download.eclipse.org/zenoh/debian-repo/zenoh-keyring.gpg -O - | apt-key add -
RUN echo "deb [trusted=yes] https://download.eclipse.org/zenoh/debian-repo/ /" | tee -a /etc/apt/sources.list > /dev/null
RUN apt-get update && \
    apt-get install -y zenoh

CMD ["zenohd", "--id", "8513e6171ad48733194c2bab57a5dd86"]
docker build -f Dockerfile -t zenoh-test .
docker run -d -p 8000:8000 zenoh-test

Then send curl commands from docs (https://zenoh.io/docs/apis/rest/)

# Put a string value in demo/example/test
curl -X PUT -H "content-type:text/plain" -d 'Hello World!' http://localhost:8000/demo/example/test

Now I expect to see that data when I query it, but I do not:

$ curl -X GET http://localhost:8000/demo/example/test/\*\*
[]%
$ curl -X GET http://localhost:8000/demo/\*\*     
[]%
$ curl -X GET http://localhost:8000/whatever 
[]%    

System info

See docker code.

zenohd v1.0.0-alpha.6 built with rustc 1.75.0 (82e1608df 2023-12-21)

mbspng avatar Aug 07 '24 17:08 mbspng