-
Notifications
You must be signed in to change notification settings - Fork 33
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
fatal flex scanner internal error--end of buffer missed #113
Comments
Is anyone here, and knows something about this issue? @alexamici do you know something about this? |
Are you launching multiple threads to decode GRIB messages? |
I think this is what happens when calling |
@shahramn setting parallel to False does not raise the issue. So it works. Does this help to understand the issue? |
The eCodes library needs to be built with thread-safety (mutexes). So if you are building it using cmake, add the following option: |
So I reverted my changes and added the installtion of eccodes again: RUN wget https://cmake.org/files/v3.20/cmake-3.20.1.tar.gz
RUN tar -xzvf cmake-3.20.1.tar.gz
WORKDIR cmake-3.20.1/
RUN apt-get update && apt-get install --fix-missing -yqq
RUN ./bootstrap
RUN make -j$(nproc) && make install
WORKDIR /
RUN curl https://confluence.ecmwf.int/download/attachments/45757960/eccodes-2.39.0-Source.tar.gz?api=v2 -o /tmp/eccodes-2.39.0-Source.tar.gz
RUN tar -xzf /tmp/eccodes-2.39.0-Source.tar.gz
RUN mkdir build \
&& cd build \
&& cmake /eccodes-2.39.0-Source -DCMAKE_INSTALL_PREFIX=/usr/local/share/eccodes -DENABLE_ECCODES_THREADS=ON -DENABLE_JPG=ON \
&& make install
COPY ./requirements.txt /opt/requirements.txt
RUN pip3 install --no-cache-dir -r /opt/requirements.txt --no-binary eccodes I am using eccodes=2.39.0 in my requirements.txt here. I added Now the script terminates without any further information. Same with using cfgrib: Running root@6c0426ac3fbb:/app# python -m eccodes selfcheck
/usr/local/lib/python3.10/site-packages/gribapi/__init__.py:23: UserWarning: ecCodes 2.38.0 or higher is recommended. You are running version 2.28.0
warnings.warn(
Found: ecCodes v2.28.0.
Library: libeccodes.so.0
Definitions: /app/eccodes_definitions/dmi_grib_definitions:/app/eccodes_definitions/definitions.edzw-2.36.0-2:/eccodes-2.39.0-Source/definitions/:/usr/share/eccodes/definitions
Samples: /usr/share/eccodes/samples
Your system is ready. Where does this version is coming from? What kind of dependency can lead to this downgrade? |
Setting root@7168fbbebeda:/app# export ECCODES_PYTHON_USE_FINDLIBS=0
root@7168fbbebeda:/app# python -m eccodes selfcheck
Found: ecCodes v2.39.0.
Library: /usr/local/lib/python3.10/site-packages/eccodes.libs/libeccodes-e85d471c.so
Definitions: /app/eccodes_definitions/dmi_grib_definitions:/app/eccodes_definitions/definitions.edzw-2.36.0-2:/eccodes-2.39.0-Source/definitions/:/MEMFS/definitions
Samples: /MEMFS/samples
Your system is ready. But this does not change anythin that the script just terminates without any excpetion. |
There is something that causes installation of a legcy version of eccodes and I can't figure out where it is coming from The output currently is: root@3cabf806d1f1:/app# python -m eccodes selfcheck
/usr/local/lib/python3.10/site-packages/gribapi/__init__.py:23: UserWarning: ecCodes 2.38.0 or higher is recommended. You are running version 2.28.0
warnings.warn(
Found: ecCodes v2.28.0.
Library: libeccodes.so.0
Definitions: /eccodes-2.39.0-Source/definitions:/app/eccodes_definitions/dmi_grib_definitions:/app/eccodes_definitions/definitions.edzw-2.36.0-2:/usr/share/eccodes/definitions
Samples: /usr/share/eccodes/samples
Your system is ready Here is my Dockerfile: FROM python:3.10-slim
ENV DEBIAN_FRONTEND=noninteractive
ENV TERM=linux
RUN set -ex \
&& apt update \
&& apt install -y apt-transport-https curl
WORKDIR /tmp
RUN set -ex \
&& buildDeps=' \
libnetcdf-dev \
libhdf5-dev \
libbz2-dev \
' \
&& apt-get update -yqq \
&& apt-get install -yqq --no-install-recommends \
$buildDeps \
cdo \
wget \
bzip2 \
liblcms2-dev \
libtiff-dev \
libpng-dev \
libz-dev \
libaec-dev \
gfortran \
protobuf-compiler \
build-essential \
libssl-dev \
libopenjp2-7-dev \
libopenjp2-tools \
&& apt-get remove -y $buildDeps \
&& apt-get autoremove -y \
&& apt-get update
RUN wget https://cmake.org/files/v3.20/cmake-3.20.1.tar.gz
RUN tar -xzvf cmake-3.20.1.tar.gz
WORKDIR cmake-3.20.1/
RUN apt-get update && apt-get install --fix-missing -yqq
RUN ./bootstrap
RUN make -j$(nproc) && make install
WORKDIR /
RUN curl https://confluence.ecmwf.int/download/attachments/45757960/eccodes-2.39.0-Source.tar.gz?api=v2 -o /tmp/eccodes-2.39.0-Source.tar.gz
RUN tar -xzf /tmp/eccodes-2.39.0-Source.tar.gz
RUN mkdir build \
&& cd build \
&& cmake /eccodes-2.39.0-Source -DCMAKE_INSTALL_PREFIX=/usr/local/share/eccodes -DENABLE_ECCODES_THREADS=ON -DENABLE_JPG=ON \
&& make install
COPY ./requirements.txt /opt/requirements.txt
RUN pip3 install --no-dependencies --no-cache-dir -r /opt/requirements.txt
RUN curl https://files.pythonhosted.org/packages/c2/a4/fb4c7e2f7df631ff2cfdf345f6978452c00bdc24b0c9eff33081d6d533f4/eccodes-2.39.0-py3-none-any.whl -o /tmp/eccodes-2.39.0-py3-none-any.whl
RUN pip3 install --no-dependencies --no-cache-dir /tmp/eccodes-2.39.0-py3-none-any.whl
RUN curl https://files.pythonhosted.org/packages/62/c6/7e8a2b07d2404a79b2cea577962f88e02662ba2b85e073b6e5eed8081878/cfgrib-0.9.14.1-py3-none-any.whl -o /tmp/cfgrib-0.9.14.1-py3-none-any.whl
RUN pip3 install --no-dependencies --no-cache-dir /tmp/cfgrib-0.9.14.1-py3-none-any.whl
ENV PYTHONPATH="/app:/app"
#COPY entrypoint.sh /
#COPY .env .env
WORKDIR /app
#COPY entrypoint.sh /
#COPY .env /app/.env
COPY . .
#ENTRYPOINT ["/entrypoint.sh"]
And here is my requirements.txt:
Hopefully you can figure out where the old installation is coming from. |
What happened?
I updated my project to the latest eccodes version from 2.30.2 to 2.39.0. Now I am receiving
error while parsing ecmwf open data forecast.
What are the steps to reproduce the bug?
I am using
python:3.10-slim
Docker image as basis and I removed all manually installed eccodes binary.As you can see I am having some additional definitions, removing them does not change anything to the fact that using:
leads to the issue named above.
Using
cfgrib.open_datasets()
works fine.By changing the ECCODES_DEFINITIONS_PATH I am receiving different Errors.
Version
v2.39.0
Platform (OS and architecture)
python3.10-slim Docker image
Relevant log output
Accompanying data
https://data.ecmwf.int/forecasts/20241129/00z/ifs/0p25/oper/
Organisation
alitiq
The text was updated successfully, but these errors were encountered: