# How to resolve Pups exec errors during Discourse bootstrap

**URL:** https://meta.discourse.org/t/how-to-resolve-pups-exec-errors-during-discourse-bootstrap/362619
**Category:** Support
**Created:** [April 18, 2025, 12:38pm UTC](https://meta.discourse.org/t/how-to-resolve-pups-exec-errors-during-discourse-bootstrap/362619 "2025-04-18T12:38:46Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Thomas\_Rother](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thomas_rother/32/423597_2.png) [@Thomas\_Rother](https://meta.discourse.org/u/Thomas_Rother)
#### Post date: [April 18, 2025, 12:38pm UTC](https://meta.discourse.org/t/how-to-resolve-pups-exec-errors-during-discourse-bootstrap/362619/1 "2025-04-18T12:38:46Z")

</div>

I am creating a new discourse instance from scratch for development purposes and see this bootstrap error again:

```plaintext
FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 1002 exit 1>
Location of failure: /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in `spawn'
exec failed with the params {"cd"=>"$home", "tag"=>"migrate", "hook"=>"db_migrate", "cmd"=>["su discourse -c 'bundle exec rake db:migrate'"]}
bootstrap failed with exit code 1

```

Container setup is with two containers for webonly and dataonly (redis) and with an external postgresql database. Commenting the maxmind settings does not change anything.

Any ideas what I can do here?

---

<div class="post-metadata">

### Author: ![Ed\_S](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ed_s/32/134015_2.png) [@Ed\_S](https://meta.discourse.org/u/Ed_S)
#### Post date: [April 18, 2025, 8:00pm UTC](https://meta.discourse.org/t/how-to-resolve-pups-exec-errors-during-discourse-bootstrap/362619/2 "2025-04-18T20:00:50Z")

</div>

Best guess would be that you don’t have enough memory - in which case, add swap or move to a larger-RAM instance. Try `free -h`.

---

<div class="post-metadata">

### Author: ![Thomas\_Rother](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thomas_rother/32/423597_2.png) [@Thomas\_Rother](https://meta.discourse.org/u/Thomas_Rother)
#### Post date: [April 18, 2025, 8:33pm UTC](https://meta.discourse.org/t/how-to-resolve-pups-exec-errors-during-discourse-bootstrap/362619/3 "2025-04-18T20:33:09Z")

</div>

Hmmm, nein, wir haben 4 GB RAM und ausreichend Festplattenspeicher (2 x 32 GB), die Gesamtumgebung ist identisch mit der anderen Docker-Maschine, auf der die Builds ohne Probleme laufen.

MEM-Status:

`root@docker3a:/var/discourse# free -h`  
` gesamt benutzt frei gemns. Puffer/Cache verfügbar`  
`Speicher: 3,8Gi 819Mi 1,4Gi 22Mi 1,9Gi 3,0Gi `  
`Swap: 974Mi 52Mi 922Mi`

---

<div class="post-metadata">

### Author: ![Ed\_S](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ed_s/32/134015_2.png) [@Ed\_S](https://meta.discourse.org/u/Ed_S)
#### Post date: [April 19, 2025, 2:40pm UTC](https://meta.discourse.org/t/how-to-resolve-pups-exec-errors-during-discourse-bootstrap/362619/4 "2025-04-19T14:40:40Z")

</div>

Any recent errors in the output of `dmesg` which might be relevant?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [April 19, 2025, 2:41pm UTC](https://meta.discourse.org/t/how-to-resolve-pups-exec-errors-during-discourse-bootstrap/362619/5 "2025-04-19T14:41:58Z")

</div>

Can you share the whole log?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [April 19, 2025, 2:42pm UTC](https://meta.discourse.org/t/how-to-resolve-pups-exec-errors-during-discourse-bootstrap/362619/6 "2025-04-19T14:42:50Z")

</div>

> [@Ed\_S](#):
>
> Best guess would be that you don’t have enough memory

That’s a weird guess, we don’t usually see OoM causing migration errors in Discourses.

---

<div class="post-metadata">

### Author: ![Thomas\_Rother](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thomas_rother/32/423597_2.png) [@Thomas\_Rother](https://meta.discourse.org/u/Thomas_Rother)
#### Post date: [April 19, 2025, 4:51pm UTC](https://meta.discourse.org/t/how-to-resolve-pups-exec-errors-during-discourse-bootstrap/362619/7 "2025-04-19T16:51:54Z")

</div>

```plaintext
x86_64 arch detected.
Ensuring launcher is up to date
Launcher is up-to-date
2.0.20250226-0128: Pulling from discourse/base
Digest: sha256:6f18aa2cd22bba0deb91d69194e577d4f96130ad555ae8ec646a8792cbfe37db
Status: Image is up to date for discourse/base:2.0.20250226-0128
docker.io/discourse/base:2.0.20250226-0128
/usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/lib/pups.rb
/usr/local/bin/pups --stdin
18:C 19 Apr 2025 16:38:41.670 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
18:C 19 Apr 2025 16:38:41.670 # Redis version=7.0.15, bits=64, commit=00000000, modified=0, pid=18, just started
18:C 19 Apr 2025 16:38:41.670 # Configuration loaded
18:M 19 Apr 2025 16:38:41.670 * monotonic clock: POSIX clock_gettime
18:M 19 Apr 2025 16:38:41.670 * Running mode=standalone, port=6379.
18:M 19 Apr 2025 16:38:41.670 # Server initialized
18:M 19 Apr 2025 16:38:41.671 * Loading RDB produced by version 7.0.15
18:M 19 Apr 2025 16:38:41.671 * RDB age 72606 seconds
18:M 19 Apr 2025 16:38:41.671 * RDB memory usage when created 0.82 Mb
18:M 19 Apr 2025 16:38:41.671 * Done loading RDB, keys loaded: 0, keys expired: 0.
18:M 19 Apr 2025 16:38:41.671 * DB loaded from disk: 0.000 seconds
18:M 19 Apr 2025 16:38:41.671 * Ready to accept connections
999:C 19 Apr 2025 16:39:59.006 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
999:C 19 Apr 2025 16:39:59.006 # Redis version=7.0.15, bits=64, commit=00000000, modified=0, pid=999, just started
999:C 19 Apr 2025 16:39:59.006 # Configuration loaded
999:M 19 Apr 2025 16:39:59.006 * monotonic clock: POSIX clock_gettime
999:M 19 Apr 2025 16:39:59.006 # Warning: Could not create server TCP listening socket *:6379: bind: Address already in use
999:M 19 Apr 2025 16:39:59.006 # Failed listening on port 6379 (TCP), aborting.
18:signal-handler (1745080813) Received SIGTERM scheduling shutdown...
18:M 19 Apr 2025 16:40:13.541 # User requested shutdown...
18:M 19 Apr 2025 16:40:13.541 * Saving the final RDB snapshot before exiting.
18:M 19 Apr 2025 16:40:13.549 * DB saved on disk
18:M 19 Apr 2025 16:40:13.549 # Redis is now ready to exit, bye bye...

FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 1002 exit 1>
Location of failure: /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in `spawn'
exec failed with the params {"cd"=>"$home", "tag"=>"migrate", "hook"=>"db_migrate", "cmd"=>["su discourse -c 'bundle exec rake db:migrate'"]}
bootstrap failed with exit code 1
**FAILED TO BOOTSTRAP** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.
48b8aa6c912bbabc42d6b9373808088f5aa9079de1e1f7360fc858891a48556b

```

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [April 19, 2025, 4:54pm UTC](https://meta.discourse.org/t/how-to-resolve-pups-exec-errors-during-discourse-bootstrap/362619/8 "2025-04-19T16:54:47Z")

</div>

If this is a web\_only container, why does it have redis on it?

Can you share your yml container definitions? And why are you even running a two container install?

---

<div class="post-metadata">

### Author: ![Thomas\_Rother](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thomas_rother/32/423597_2.png) [@Thomas\_Rother](https://meta.discourse.org/u/Thomas_Rother)
#### Post date: [April 19, 2025, 6:30pm UTC](https://meta.discourse.org/t/how-to-resolve-pups-exec-errors-during-discourse-bootstrap/362619/9 "2025-04-19T18:30:12Z")

</div>

Hey Falco  
you are right and I am stupid 😉  
I will correct that …

---

<div class="post-metadata">

### Author: ![Thomas\_Rother](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thomas_rother/32/423597_2.png) [@Thomas\_Rother](https://meta.discourse.org/u/Thomas_Rother)
#### Post date: [April 19, 2025, 9:01pm UTC](https://meta.discourse.org/t/how-to-resolve-pups-exec-errors-during-discourse-bootstrap/362619/10 "2025-04-19T21:01:53Z")

</div>

OK, I fixed the separation of web\_only and redis. Error msg now is

`FAILED `  
`-------------------- `  
`Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 981 e`  
`xit 1> `  
`Location of failure: /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in `spawn' `  
`exec failed with the params {"cd"=>"$home", "tag"=>"migrate", "hook"=>"db_migrate", "cmd"=>["su discourse -c 'bundle exec rake db:migra`  
`te'"]} `  
`bootstrap failed with exit code 1 `  
` **FAILED TO BOOTSTRAP** please scroll up and look for earlier error messages, there may be more than one. `  
`./discourse-doctor may help diagnose the problem. `  
`801049b69a89d38b1ae5c299d356fc5f8dc6a8f518b1260c2dde05e0b6081556`

But maybe its a misunderstanding / lack of knowledge on my side:

The database should be external on another lxc container which has a postgresql database. The database user and database exists, but the database is empty before the first bootstrap of web\_only. Does the script create the database itself on the remote system upon first build? Or do I first have to create the database container and then export its default scheme and the data manually to the external postgresql daemon?

# Visualization of the overall setup

 ![forum2 Setup.excalidraw](https://global.discourse-cdn.com/meta/original/4X/f/b/8/fb8c126cf8146db2da1667330d78bc3432181014.svg)

---

<div class="post-metadata">

### Author: ![Ed\_S](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ed_s/32/134015_2.png) [@Ed\_S](https://meta.discourse.org/u/Ed_S)
#### Post date: [April 20, 2025, 8:11am UTC](https://meta.discourse.org/t/how-to-resolve-pups-exec-errors-during-discourse-bootstrap/362619/11 "2025-04-20T08:11:22Z")

</div>

Thanks for the diagram. That’s quite a sophisticated setup - you’d do that if you had a good reason and knew the territory.

If you’re still seeing the following, I think that’s the indication of what’s wrong. Redis can’t open the port it needs to be listening on.

> [@Thomas\_Rother](#):
>
> ```plaintext
> 999:C 19 Apr 2025 16:39:59.006 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
> 999:C 19 Apr 2025 16:39:59.006 # Redis version=7.0.15, bits=64, commit=00000000, modified=0, pid=999, just started
> 999:C 19 Apr 2025 16:39:59.006 # Configuration loaded
> 999:M 19 Apr 2025 16:39:59.006 * monotonic clock: POSIX clock_gettime
> 999:M 19 Apr 2025 16:39:59.006 # Warning: Could not create server TCP listening socket *:6379: bind: Address already in use
> 999:M 19 Apr 2025 16:39:59.006 # Failed listening on port 6379 (TCP), aborting.
> 18:signal-handler (1745080813) Received SIGTERM scheduling shutdown...
> 
> ```

So the questions are about whether redis should be doing that, in this container, and if so, where else on the machine is another redis running. lsof might be a useful tool here.

> [@Install Discourse on Ubuntu or Debian for Development](https://meta.discourse.org/t/install-discourse-on-ubuntu-or-debian-for-development/14727/715):
>
> Is it running on the classic port number that Discourse is expecting?
> 
> try `lsof -wni | grep redis`

> [@Test installation on aarch64 - Failed to report error: Error connecting to Redis on localhost:6379](https://meta.discourse.org/t/test-installation-on-aarch64-failed-to-report-error-error-connecting-to-redis-on-localhost-6379/212763/4):
>
> Can you run `sudo lsof -i -P -n | grep LISTEN` on your host and share the output here?

---

<div class="post-metadata">

### Author: ![Thomas\_Rother](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thomas_rother/32/423597_2.png) [@Thomas\_Rother](https://meta.discourse.org/u/Thomas_Rother)
#### Post date: [April 20, 2025, 8:28am UTC](https://meta.discourse.org/t/how-to-resolve-pups-exec-errors-during-discourse-bootstrap/362619/12 "2025-04-20T08:28:01Z")

</div>

Hi @Ed_S  
thanks for the hint about the missing port. I first want to wait for the reply from Falco concerning my questions about the general setup of discourse with an external postgres database.

Yes, the setup is a bit sophisticated compared to the standard with just one app container. I run everything in a dedicated root machine with Proxmox ([https://p](https://p)[roxmox.com](http://roxmox.com)) as virtualization environment at [hetzner.de](http://hetzner.de)

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [April 21, 2025, 6:48pm UTC](https://meta.discourse.org/t/how-to-resolve-pups-exec-errors-during-discourse-bootstrap/362619/13 "2025-04-21T18:48:51Z")

</div>

You still need to share the full logs, including the part where the migration failed. My guess (and it’s a guess since you haven’t shared the error) is that you’re using the AI plugin and your database doesn’t have the add-on that is required.

---

<div class="post-metadata">

### Author: ![Thomas\_Rother](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thomas_rother/32/423597_2.png) [@Thomas\_Rother](https://meta.discourse.org/u/Thomas_Rother)
#### Post date: [April 21, 2025, 8:45pm UTC](https://meta.discourse.org/t/how-to-resolve-pups-exec-errors-during-discourse-bootstrap/362619/14 "2025-04-21T20:45:23Z")

</div>

> [@pfaffman](#):
>
> My guess (and it’s a guess since you haven’t shared the error) is that you’re using the AI plugin and your database doesn’t have the add-on that is required.

Nope, its an install without the AI plugin, although this instance shall be a playground for AI features in the future.

Enclosed is a tarball with

`./launcher bootstrap web_only >> web_only_bootstrap.log`

and the ymls for redis and web\_only, passwords are removed.

[forum2\_build.tar.gz](https://meta.discourse.org/uploads/short-url/8I8CDbS9BaRfJB8MyvYabQQPh9O.gz) (3.3 KB)

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [April 21, 2025, 10:18pm UTC](https://meta.discourse.org/t/how-to-resolve-pups-exec-errors-during-discourse-bootstrap/362619/15 "2025-04-21T22:18:33Z")

</div>

Longshot:

```plaintext
links:
  - link:
      name: redis
      alias: data

```

why isn’t it `alias: redis` ?

---

<div class="post-metadata">

### Author: ![Thomas\_Rother](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thomas_rother/32/423597_2.png) [@Thomas\_Rother](https://meta.discourse.org/u/Thomas_Rother)
#### Post date: [April 22, 2025, 4:27pm UTC](https://meta.discourse.org/t/how-to-resolve-pups-exec-errors-during-discourse-bootstrap/362619/16 "2025-04-22T16:27:21Z")

</div>

> [@RGJ](#):
>
> why isn’t it `alias: redis` ?

the file from /samples/web\_only.yml has

`# Use 'links' key to link containers together, aka use Docker --link flag. `  
`links: `  
` - link:`  
` name: data`  
` alias: data`

In my case the data container is a redis container

`CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS `  
` NAMES`  
`a27999b28a90 local_discourse/redis "/sbin/boot" 2 days ago Up 20 hours`

therefore `name: redis and alias: data`

According to the Docker docs this is a legacy feature, but its still useable, see [Legacy container links | Docker Docs](https://docs.docker.com/engine/network/links/)

I now think the better approach would be to create a standard “all in one” setup first (app.yml). And then sql dump the initial schema and data from the container into an external postgres machine. @Falco what do you think?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [April 22, 2025, 4:35pm UTC](https://meta.discourse.org/t/how-to-resolve-pups-exec-errors-during-discourse-bootstrap/362619/17 "2025-04-22T16:35:46Z")

</div>

> [@Thomas\_Rother](#):
>
> Enclosed is a tarball with
> 
> `./launcher bootstrap web_only >> web_only_bootstrap.log`

But it’s just 28 lines, so it’s missing most of them.

My new guess is that it’s not contacting your database at all, though it could be redis that it’s not talking to.

Try

```plaintext
./launcher bootstrap web_only >> web_only_bootstrap.log 2>&1

```

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [April 22, 2025, 4:52pm UTC](https://meta.discourse.org/t/how-to-resolve-pups-exec-errors-during-discourse-bootstrap/362619/18 "2025-04-22T16:52:23Z")

</div>

> [@Thomas\_Rother](#):
>
> Does the script create the database itself on the remote system upon first build? Or do I first have to create the database container and then export its default scheme and the data manually to the external postgresql daemon?

The installer will automatically create everything that is necessary as long as it’s supplied valid credentials and is able to reach the database. This is documented at [Configure Discourse to use a separate PostgreSQL server](https://meta.discourse.org/t/configure-discourse-to-use-a-separate-postgresql-server/46375)

---

<div class="post-metadata">

### Author: ![Thomas\_Rother](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thomas_rother/32/423597_2.png) [@Thomas\_Rother](https://meta.discourse.org/u/Thomas_Rother)
#### Post date: [April 22, 2025, 4:55pm UTC](https://meta.discourse.org/t/how-to-resolve-pups-exec-errors-during-discourse-bootstrap/362619/19 "2025-04-22T16:55:30Z")

</div>

[web\_only\_bootstrap2.tar.gz](https://meta.discourse.org/uploads/short-url/1cHEKpwLOxmRgjPzlRbyiEeGh3T.gz) (9.1 KB)

This one should be better 😉

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [April 22, 2025, 5:01pm UTC](https://meta.discourse.org/t/how-to-resolve-pups-exec-errors-during-discourse-bootstrap/362619/20 "2025-04-22T17:01:31Z")

</div>

Is this a new installation or one that you’re moving to a new server?

So you want to look at the log file and search for “migrate” to find the migration error.

Here’s the error:

```
PG::DuplicateObject: ERROR: type "hotlinked_media_status" already exists

```

It could be an issue with something that got migrated and then a commit got reverted. This is related, but not your solution: [Restore fails with "hotlinked\_media\_status" already exists](https://meta.discourse.org/t/restore-fails-with-hotlinked-media-status-already-exists/323795). Maybe this: [Upgrading 2.7 to 3.1 failing: "hotlinked\_media\_status" already exists - #5 by merefield](https://meta.discourse.org/t/upgrading-2-7-to-3-1-failing-hotlinked-media-status-already-exists/277313/5)

Also, you should fix this, though it’s not really hurting anything:

```
Plugin name is 'discourse-topic-voting', but plugin directory is named 'discourse-voting'

```

If you do this again, please just link the file without sticking it in a tar.

[Next page](https://meta.discourse.org/t/how-to-resolve-pups-exec-errors-during-discourse-bootstrap/362619.md?page=2)
