kermitt2 / grobid

A machine learning software for extracting information from scholarly documents
https://grobid.readthedocs.io
Apache License 2.0
3.59k stars 459 forks source link

jep.JepException: <class 'lmdb.ReadonlyError'>: data/db/glove-840B: Permission denied #1176

Closed RLWOHIO closed 1 month ago

RLWOHIO commented 1 month ago

Operating System and architecture (arm64, amd64, x86, etc.)

HPC linux

What is your Java version

JDK17

Log and information

apptainer run --no-home --cleanenv --writable-tmpfs --pwd "/work/ECOTOXKG/grobid_0.8.0" grobid_0.8.0.custom.sif WARN [2024-10-03 14:43:47,028] org.hibernate.validator.internal.properties.javabean.JavaBeanExecutable: HV000254: Missing parameter metadata for ResponseMeteredLevel(String, int), which declares implicit or synthetic parameters. Automatic resolution of generic type information for method parameters may yield incorrect results if multiple parameters have the same erasure. To solve this, compile your code with the '-parameters' flag. ERROR [2024-10-03 14:44:05,146] org.grobid.core.jni.DeLFTModel: DeLFT model initialization failed. ! jep.JepException: <class 'lmdb.ReadonlyError'>: data/db/glove-840B: Permission denied ! at /usr/local/lib/python3.8/dist-packages/delft/utilities/Embeddings.make_embeddings_simple(Embeddings.py:276) ! at /usr/local/lib/python3.8/dist-packages/delft/utilities/Embeddings.init(Embeddings.py:72) ! at /usr/local/lib/python3.8/dist-packages/delft/sequenceLabelling/wrapper.load(wrapper.py:591) ! at .(:1) ! at jep.Jep.eval(Native Method) ! at jep.Jep.eval(Jep.java:312) ! at org.grobid.core.jni.DeLFTModel$InitModel.run(DeLFTModel.java:65) ! at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ! at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ! at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ! at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ! at java.base/java.lang.Thread.run(Thread.java:833) [Wapiti] Loading model: "/work/ECOTOXKG/grobid_0.8.0/opt/grobid/grobid-home/models/name/header/model.wapiti" Model path: /work/ECOTOXKG/grobid_0.8.0/opt/grobid/grobid-home/models/name/header/model.wapiti [Wapiti] Loading model: "/work/ECOTOXKG/grobid_0.8.0/opt/grobid/grobid-home/models/name/citation/model.wapiti" Model path: /work/ECOTOXKG/grobid_0.8.0/opt/grobid/grobid-home/models/name/citation/model.wapiti

Further information

I followed the steps outlined in the issue #1150 by cboulanger. The sandbox runs totally fine: apptainer run --no-home --cleanenv --writable-tmpfs --pwd "/work/ECOTOXKG/grobid_0.8.0" grobid_0.8.0/

Afterwards, I built a container out of it successfully: apptainer build grobid_0.8.0.custom.sif grobid_0.8.0/

When running this container though, I got lmdb.ReadonlyError due to permission denied: apptainer run --no-home --cleanenv --writable-tmpfs --pwd "/work/ECOTOXKG/grobid_0.8.0" grobid_0.8.0.custom.sif

how to open lmdb with write access when running the container using Apptainer? Is there a "writable" option somewhere in apptainer build or run command? I couldn't figure out. Thanks in advance!

RLWOHIO commented 1 month ago

well, looks like an easy fix. All I had to do is to add write permissions to /data and its subdirs under grobid_0.8.0 sandbox and rebuild it into a container image. Now all works well.

Please close this issue.