cmdntd reported a failure during a Discourse upgrade, encountering a Pups::ExecError related to bundle install and a git pull error indicating a failure to allocate 100GB of memory. The logs also showed a Ruby version mismatch (Ruby 3.4.10 vs. Gemfile requirement ~> 4.0.0). Although cmdntd confirmed system memory was normal, pfaffman noted that attempting to allocate 100GB is abnormal and suggested checking if the /var/discourse directory was outdated or if ./launcher rebuild was used instead of git pull.
Ed_S asked for clarification on the installation standard, the .yml version setting (which was default), and requested more log details. cmdntd confirmed a standard standalone install. Ed_S explained that Ruby version issues typically reside in the Docker image rather than the OS and suggested debugging the memory issue by checking disk space (df -h), available memory (free), and kernel logs (dmesg | egrep -i "memory|oom"). They also recommended trying git fetch --depth=1 to limit data transfer, though cmdntd reported this still failed.
Falco suspected a pinned Docker image in the app.yml might be the cause and asked for the full configuration file. cmdntd later stated that the Git issue was resolved, but did not provide specific details on the fix. Falco requested an explanation of the solution for the benefit of the community, but no further update was provided in the thread.
I have error when try to upgrade/rebuild my discourse:
FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle install --jobs $(nproc --ignore=1) --retry 3' failed with return #<Process::Status: pid 1868 exit 18>
Location of failure: /usr/local/lib/ruby/gems/3.4.0/gems/pups-1.4.0/lib/pups/exec_command.rb:138:in 'Pups::ExecCommand#spawn'
exec failed with the params {"cd" => "$home", "tag" => "build", "hook" => "bundle_exec", "cmd" => ["su discourse -c 'bundle install --jobs $(nproc --ignore=1) --retry 3'", "su discourse -c 'bundle clean'", "su discourse -c 'find /var/www/discourse/vendor/bundle -name cache -not -path \"*/gems/*\" -type d -exec rm -rf {} +'", "su discourse -c 'find /var/www/discourse/vendor/bundle -name tmp -type d -exec rm -rf {} +'"]}
bootstrap failed with exit code 18
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.
I see this above:
Fetching gem metadata from https://rubygems.org/.
Fetching bundler 4.0.23
Installing bundler 4.0.23
Your Ruby version is 3.4.10, but your Gemfile specified ~> 4.0.0
128:signal-handler (1794492346) Received SIGTERM scheduling shutdown...
I have an error when run `sudo git pull`
sudo git pull
fatal: Out of memory, malloc failed (tried to allocate 104857600000 bytes)
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Thanks. As I understand it, any ruby version mismatch is not about your OS but about the docker image. Of course the docker image should be internally consistent.
The memory issue which causes git pull to fail is important to fix first, but I don’t have any ideas. Just possibly it’s worth trying
git fetch --depth=1
to see if that can work.
I think it’s always worth checking machine config: