TrumanCrafts / world-generator

The World Generator
3 stars 0 forks source link

[ERROR] RuntimeException occurred while executing wpscript.js when exporting images #1

Open imide opened 9 months ago

imide commented 9 months ago

Currently generating an earth map on Debian 12. Following everything on the README. Full error log:



2024-02-18 21:23:55,768 - INFO - wpscript - minutor for S37W177 output:
2024-02-18 21:23:55,768 - ERROR - wpscript - minutor for S37W177 error: QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::begin: Paint device returned engine == 0, type: 3

2024-02-18 21:23:55,768 - INFO - wpscript - WorldPainter for S37W177 done
2024-02-18 21:23:56,098 - INFO - wpscript - WorldPainter for N23W177...
2024-02-18 21:23:56,321 - INFO - wpscript - WorldPainter for S34W177 output: images imported
[ERROR] RuntimeException occurred while executing wpscript.js
java.lang.RuntimeException: org.pepsoft.worldpainter.tools.scripts.ScriptException: File /workspace/Data/image_exports/S34W177/heightmap/S34W177.png not found
        at org.openjdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:524)
        at org.openjdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:442)
        at org.openjdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:399)
        at org.openjdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:395)
        at org.openjdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:146)
        at java.scripting/javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:247)
        at org.pepsoft.worldpainter.tools.ScriptingTool.main(ScriptingTool.java:193)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:84)
        at com.install4j.runtime.launcher.UnixLauncher.start(UnixLauncher.java:69)
        at install4j.org.pepsoft.worldpainter.tools.ScriptingTool.main(Unknown Source)
Caused by: org.pepsoft.worldpainter.tools.scripts.ScriptException: File /workspace/Data/image_exports/S34W177/heightmap/S34W177.png not found
        at org.pepsoft.worldpainter.tools.scripts.AbstractOperation.sanityCheckFileName(AbstractOperation.java:48)
        at org.pepsoft.worldpainter.tools.scripts.GetHeightMapOp.go(GetHeightMapOp.java:71)
        at org.pepsoft.worldpainter.tools.scripts.GetHeightMapOp.go(GetHeightMapOp.java:39)
        at org.openjdk.nashorn.internal.scripts.Script$Recompilation$2$268435453A$wpscript.:program$:split-6(wpscript.js:602)
        at org.openjdk.nashorn.internal.scripts.Script$wpscript.:program(wpscript.js)
        at org.openjdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:646)
        at org.openjdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:513)
        at org.openjdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:520)
        ... 13 common frames omitted

2024-02-18 21:23:56,321 - ERROR - wpscript - WorldPainter for S34W177 error: WorldPainter scripting host version 2.21.0.```
imide commented 9 months ago

Fixed: Issue was coming from outdated WorldPainter. Fixed by changing the Dockerfile to download 2.22.0. Here is my Dockerfile:


FROM debian:bookworm

RUN apt update && apt install -y \
    git wget dpkg unzip axel\
    gcc zlib1g-dev\
    build-essential \
    libssl-dev \
    libffi-dev \
    # install python3
    python3-dev \
    python3-pip \
    python3-setuptools \
    python3-wheel \
    python3-venv \
    # install openjdk-17
    openjdk-17-jdk \
    xserver-xorg xorg xvfb \
    cmake libboost-dev \
    libexpat1-dev  libbz2-dev \
    # imagemagick
    libpng-dev libjpeg-dev libtiff-dev imagemagick \
    # install QGIS 
    gnupg software-properties-common\
    && mkdir -m755 -p /etc/apt/keyrings \
    && wget -O /etc/apt/keyrings/qgis-archive-keyring.gpg https://download.qgis.org/downloads/qgis-archive-keyring.gpg \
    && echo 'Types: deb deb-src' >> /etc/apt/sources.list.d/qgis.sources \
    && echo 'URIs: https://qgis.org/debian' >> /etc/apt/sources.list.d/qgis.sources \
    && echo 'Suites: bookworm' >> /etc/apt/sources.list.d/qgis.sources \
    && echo 'Architectures: amd64' >> /etc/apt/sources.list.d/qgis.sources \
    && echo 'Components: main' >> /etc/apt/sources.list.d/qgis.sources \
    && echo 'Signed-By: /etc/apt/keyrings/qgis-archive-keyring.gpg' >> /etc/apt/sources.list.d/qgis.sources \
    && apt update \
    && apt install -y qgis qgis-plugin-grass\
    # install worldpainter
    && wget -O /tmp/worldpainter_2.22.0.deb https://www.worldpainter.net/files/worldpainter_2.22.0.deb \
    && dpkg -i /tmp/worldpainter_2.22.0.deb \
    && rm /tmp/worldpainter_2.22.0.deb \
    && mkdir -p /root/.local/share/worldpainter/ \
    ## change worldpainter config
    && sed -i 's/# -Xmx512m/-Xmx6G/g' /opt/worldpainter/wpscript.vmoptions \
    # install Minutor
    && wget -O /tmp/Minutor.Ubuntu-22.04.zip https://github.com/mrkite/minutor/releases/download/2.20.0/Minutor.Ubuntu-22.04.zip \
    && unzip /tmp/Minutor.Ubuntu-22.04.zip \
    && chmod +x minutor \
    && mv minutor /usr/bin/ \
    && rm /tmp/Minutor.Ubuntu-22.04.zip \
    # post cleanup
    && apt clean \
    # pip install osmium
    && pip3 install osmium pebble pyyaml --break-system-packages \
    && rm -rf /root/.cache/pip \
    && rm -rf /var/lib/apt/lists/* \
    # remove Imagemagick policy
    && rm /etc/ImageMagick-6/policy.xml \
    # setup work space
    && mkdir -p /workspace

COPY config /root/.local/share/worldpainter/config
COPY policy.xml /etc/ImageMagick-6/policy.xml

WORKDIR /workspace

# run run.sh
CMD ["./run.sh"]
imide commented 9 months ago

nevermind i lied lmao. sometimes it errors still.