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

X Error of failed request: BadRequest (invalid request code or no such operation) #2

Open
spuder opened this issue Dec 27, 2021 · 8 comments

Comments

@spuder
Copy link
Owner

spuder commented Dec 27, 2021

This works outside of docker, but fails inside of docker

MYTMPDIR="$(mktemp -d)"
trap 'rm -rf -- "$MYTMPDIR"' EXIT
echo "Creating temp directory ${MYTMPDIR}"
filename=$(basename "$file")
echo "Basename: $filename"
docker run --rm -v $(PWD):/data -v ${MYTMPDIR}:/foo spuder/openscad:latest openscad /dev/null -D '$vpt = [0,0,0];' -D '$vpd = 20; $vpr = [0,$t * 360,0];' -o '/foo/foo.png' -D 'cube([2,3,4]);' --imgsize=250,250 --animate 3 --colorscheme 'Tomorrow Night' --viewall --autocenter
Normalized CSG tree has 1 elements
Geometries in cache: 1
Geometry cache size in bytes: 728
CGAL Polyhedrons in cache: 0
CGAL cache size in bytes: 0
Total rendering time: 0:00:00.087
Exporting /dev/null...
Compiling design (CSG Products normalization)...
Normalized CSG tree has 1 elements
Geometries in cache: 1
Geometry cache size in bytes: 728
CGAL Polyhedrons in cache: 0
CGAL cache size in bytes: 0
Total rendering time: 0:00:00.081
X Error of failed request:  BadRequest (invalid request code or no such operation)
  Major opcode of failed request:  0 ()
  Serial number of failed request:  39
  Current serial number in output stream:  40
@spuder
Copy link
Owner Author

spuder commented Dec 27, 2021

Cleaning the temp directory seems to fix it in atleast 1 situation (but isn't consitent)

@spuder
Copy link
Owner Author

spuder commented Dec 27, 2021

May need opengl?

https://github.com/jamesbrink/docker-opengl

But I'm pretty sure I've had this working several times in docker before

@spuder
Copy link
Owner Author

spuder commented Dec 27, 2021

Reducing the --animate to 3 works (sometimes)

docker run --rm -v $(PWD):/data -v ${MYTMPDIR}:/foo spuder/openscad:latest openscad /dev/null -D '$vpd = 20; $vpr = [0,$t * 360,0];' -o '/foo/foo.png' -D 'cube([2,3,4]);' --imgsize=250,250 --animate 3 --colorscheme 'Tomorrow Night' --viewall --autocenter --preview

@spuder
Copy link
Owner Author

spuder commented Dec 27, 2021

Worked

    docker run --memory 2048m --oom-kill-disable --rm -v $(PWD):/data -v ${MYTMPDIR}:/foo spuder/openscad:latest openscad /dev/null -D '$vpd = 20; $vpr = [0,$t * 360,0];' -o '/foo/foo.png' -D 'cube([2,3,4]);' --imgsize=250,250 --animate 3 --colorscheme 'Tomorrow Night' --viewall --autocenter --preview

But running again immediately throws error.
Deleting $MYTMPDIR/*.png still throws error
Running again still throws error

@spuder
Copy link
Owner Author

spuder commented Dec 27, 2021

Looks like this only happens when --animate >4. Opened ticket to figure out what is happening openscad/openscad#4028

@spuder
Copy link
Owner Author

spuder commented Dec 27, 2021

Workaround:

By commenting out these lines in the entrypoint.sh and starting with a fresh $MYTMPDIR. I"m able to reduce (but not eliminate) crashes when > 3

# XVFB_WHD=${XVFB_WHD:-1280x720x16}
# Xvfb :99 -ac -screen 0 $XVFB_WHD -nolisten tcp &
# sleep 2
# export DISPLAY=:99
rm $MYTMPDIR/*; docker run --rm -v $(PWD):/data -v ${MYTMPDIR}:/foo spuder/openscad:latest openscad /dev/null -D '$vpd = 20; $vpr = [0,$t * 360,0];' -o '/foo/foo.png' -D 'cube([2,3,4]);' --imgsize=100,100 --animate 4 --colorscheme 'Tomorrow Night' --viewall --autocenter --preview; ls $MYTMPDIR

@spuder
Copy link
Owner Author

spuder commented Dec 28, 2021

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

1 participant