godot: CLI export fails

Godot version:

Godot 3.0 stable

OS/device including version:

Linux Mint 18.3 Sylvia 64-bit

Issue description:

Trying to export via command line throws following error:

ERROR: copy: Condition ' err ' is true. returned: err
   At: core/os/dir_access.cpp:313.

Steps to reproduce: Just create a bare minimum project, I used one just with a single node in a scene, nothing else. Try to export via command line.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 8
  • Comments: 44 (27 by maintainers)

Commits related to this issue

Most upvoted comments

I’ll rework the mess that is our command line interface eventually.

The error occurs even when no target file exists. And the target file never gets generated from command line. So it is a valid bug.

I confirmed with 3.0.2 stable release:

godot --export "Linux/X11" /tmp
ERROR: copy: Condition 'err ' is true. returned: err
  At: core/os/dir_access.cpp:305

I also confirmed that it exports fine from GUI editor menu.

I was able to export from my continuous delivery server. (gocd)

Hope this can help someone else.

- buildStage: 
          jobs:            
            buildJob:
              resources:
                - linux
                - mingw5
              artifacts:
                - build:
                    source: "export_windows"
                - build:
                    source: "export_osx"
                - build:
                    source: "export_linux"
                - build:
                    source: "export_linux_server"
              tasks:
                - fetch:
                    artifact_origin: gocd
                    source: "godot_server.x11.opt.tools.64.llvm"
                    destination: ""
                    is_file: yes
                    pipeline: godot-groups
                    stage: defaultStage
                    job: serverJob
                - fetch:
                    artifact_origin: gocd
                    source: "godot.templates.tpz"
                    destination: ""
                    is_file: yes
                    pipeline: godot-groups
                    stage: templateZipStage
                    job: defaultJob      
                - exec: 
                    arguments:
                      - "-c"
                      - "mkdir -p groups"
                    command: "/bin/bash"
                - exec:
                    arguments:
                      - "-c"
                      - "chmod +x ../b/repo && HOME=`pwd` ../b/repo init -u https://example.com/example/example.git -m build.xml"
                    command: "/bin/bash"
                    working_directory: "groups"
                - exec:
                    arguments:
                      - "-c"
                      - "chmod +x ../b/repo && HOME=`pwd` ../b/repo sync --force-sync"
                    command: "/bin/bash"
                    working_directory: "groups"
                - exec:
                    arguments:
                      - "-c"
                      - "git lfs fetch" 
                    command: "/bin/bash"
                    working_directory: "groups"
                - exec:
                    arguments:
                      - "-c"
                      - "mkdir -p .local/share/godot/ .config .cache" 
                    command: "/bin/bash"
                    working_directory: "groups"
                - exec:
                    arguments:
                      - "-c"
                      - "unzip godot.templates.tpz" 
                    command: "/bin/bash"
                - exec:
                    arguments:
                      - "-c"
                      - "rm -rf .local/share/godot/templates/" 
                    command: "/bin/bash"
                - exec:
                    arguments:
                      - "-c"
                      - "mkdir -p .local/share/godot/templates/`cat templates/version.txt`" 
                    command: "/bin/bash"
                - exec:
                    arguments:
                      - "-c"
                      - "mkdir -p .local/share/godot/templates/`cat templates/version.txt`" 
                    command: "/bin/bash"
                - exec:
                    arguments:
                      - "-c"
                      - "cp templates/* .local/share/godot/templates/`cat templates/version.txt`" 
                    command: "/bin/bash"
                - exec:
                    arguments:
                      - "-c"
                      - "cp templates/* .local/share/godot/templates/`cat templates/version.txt`" 
                    command: "/bin/bash"
                - exec:
                    arguments:
                      - "-c"
                      - "rm -rf templates" 
                    command: "/bin/bash"
                - exec:
                    arguments:
                      - "-c"
                      - "rm -rf export_windows" 
                    command: "/bin/bash"
                - exec:
                    arguments:
                      - "-c"
                      - "mkdir -p export_windows" 
                    command: "/bin/bash"
                # ./godot_server.x11.opt.tools.64.llvm --version and version.txt must be corresponding
                - exec:
                    arguments:
                      - "-c"
                      - chmod +x godot_server.x11.opt.tools.64.llvm && HOME=`pwd` ./godot_server.x11.opt.tools.64.llvm --export "Windows Desktop" --path groups ../export_windows/groups.exe || true
                    command: "/bin/bash"
                - exec:
                    arguments:
                      - "-c"
                      - "rm -rf export_osx" 
                    command: "/bin/bash"
                - exec:
                    arguments:
                      - "-c"
                      - "mkdir -p export_osx" 
                    command: "/bin/bash"
                - exec:
                    arguments:
                      - "-c"
                      - chmod +x godot_server.x11.opt.tools.64.llvm && HOME=`pwd` ./godot_server.x11.opt.tools.64.llvm --export "Mac OSX" --path groups ../export_osx/groups.zip || true
                    command: "/bin/bash"
                - exec:
                    arguments:
                      - "-c"
                      - "rm -rf export_linux_server" 
                    command: "/bin/bash"
                - exec:
                    arguments:
                      - "-c"
                      - "mkdir -p export_linux_server" 
                    command: "/bin/bash"
                - exec:
                    arguments:
                      - "-c"
                      - chmod +x godot_server.x11.opt.tools.64.llvm && HOME=`pwd` ./godot_server.x11.opt.tools.64.llvm --export "Linux/X11 Server" --path groups ../export_linux_server/groups.x86_64 || true
                    command: "/bin/bash"
                - exec:
                    arguments:
                      - "-c"
                      - "rm -rf export_linux" 
                    command: "/bin/bash"
                - exec:
                    arguments:
                      - "-c"
                      - "mkdir -p export_linux" 
                    command: "/bin/bash"
                - exec:
                    arguments:
                      - "-c"
                      - chmod +x godot_server.x11.opt.tools.64.llvm && HOME=`pwd` ./godot_server.x11.opt.tools.64.llvm --export "Linux/X11" --path groups ../export_linux/groups.x86_64 || true
                    command: "/bin/bash"

Edit: typos.

Thanks @fire, finally got the headless linux binary cli export to work. The bit that finally did it for me was the fact that ~/.local/share/godot/templates/{version} has to match the version.txt in the export template’s version.txt.

# This will work
cat ~/.local/share/godot/templates/3.0.6.stable/version.txt 
3.0.6.stable
# This will not work
cat ~/.local/share/godot/templates/3.0.5.stable/version.txt 
3.0.6.stable

After that the export worked on the project like a charm.

@akien-mga actually “Linux/X11” is now the name when you add a new Linux export preset. Before 3.x it was “Linux X11” indeed though.

But other than that, it is also possible to rename it now, so it could be anything.

I confirm, using the command line options from the “normal” version of Godot also fails:

~/Apps/GODOT/3.0/PRJS/vide:
$ ../../Godot_v3.0.2-stable_x11.64 --export "Linux/X11" /tmp/toto
OpenGL ES 3.0 Renderer: GeForce GTX 1050/PCIe/SSE2
ERROR: copy: Condition ' err ' is true. returned: err
   At: core/os/dir_access.cpp:305.

And just to be sure, there is no /tmp/foo file :

 ls -al /tmp/foo
ls: cannot access '/tmp/foo': No such file or directory

So the only way to export is to go through the GUI interface to export.