Cannot create workspace with GitLab deployed on RHEL 8.x with x86_64 arch: cannot execute binary file
Summary
Cannot create workspace with GitLab deployed on RHEL 8.x with x86_64 arch. Creation fails with cannot execute binary file error.
Steps to reproduce
- Deploy a GitLab instance on a server with x64_64 arch - I've used RHEl 8.10 and GitLab 17.9.1.
- Configure workspaces by following our docs.
- Try to create a workspaces in one of the projects from the page
https://GITLAB_URL/-/remote_development/workspaces/new
What is the current bug behavior?
Creation fails with the error:
Workspace create devfile flatten failed: /opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/devfile-0.1.1/bin/devfile:
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/devfile-0.1.1/bin/devfile: cannot execute binary file
What is the expected correct behavior?
Workspace should be created successfully.
Relevant logs and/or screenshots
There's an error in puma logs pointing to the fact the binary does not have a correct architecture:
==> /var/log/gitlab/puma/puma_stderr.log <==
devfile-gem only supports os: darwin and architecture: arm64 for 'ruby' platform
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Proxy: no Current User: git Using RVM: no Ruby Version: 3.2.5 Gem Version: 3.6.3 Bundler Version:2.5.11 Rake Version: 13.0.6 Redis Version: 7.0.15 Sidekiq Version:7.2.4 Go Version: unknown GitLab information Version: 17.9.1-ee Revision: 8f67c219597 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: PostgreSQL DB Version: 14.15 URL: https://gitlab_host.tld HTTP Clone URL: https://gitlab_host.tld/some-group/some-project.git SSH Clone URL: git@gitlab_host.tld:some-group/some-project.git Elasticsearch: no Geo: no Using LDAP: no Using Omniauth: yes Omniauth Providers: GitLab Shell Version: 14.40.0 Repository storages: - default: unix:/var/opt/gitlab/gitaly/gitaly.socket GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell Gitaly - default Address: unix:/var/opt/gitlab/gitaly/gitaly.socket - default Version: 17.9.1 - default Git Version: 2.47.2
Additional information
The devfile binary has incorrect architecture indeed. Trying to run it directly also results in the same error:
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/devfile-0.1.1/bin/devfile: cannot execute binary file: Exec format error
file /opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/devfile-0.1.1/bin/devfile
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/devfile-0.1.1/bin/devfile: Mach-O 64-bit arm64 executable, flags:<|DYLDLINK|PIE>
Workaround
Build the binary manually from the project https://gitlab.com/gitlab-org/ruby/gems/devfile-gem/ or replace it with the binary obtained from a working server (I took one from Deb-based GitLab instance 17.9.1 where workspaces feature worked for me).