Initial Deploy Hook being terminated?

I use initialDeployHook: ... to populate my DB with seed data.

My script looks something like this:

#!/usr/bin/env bash

pg_restore --clean \
  --if-exists \
  --no-acl \
  --no-owner \
  -n public \
  -d "$DATABASE_URL" "$(ls priv/static/db_dump/*.dump | tail)"

My initial deploy hook is marked as failed after around 1 minute even though there are not errors mentioned in the log. Is there a way to retrieve some debug information?

I have a suspicion that this started to happen on friday? I did no changes and it was working at least with a lot higher success rate before that. Any idea?

Thanks a lot.

Hi @stefan.luptak, can you let me know which service is experiencing this error?

For example srv-c46i6a9g7hp3hf2t6n10. Some reason, why considered that deploy hook as failed would be super useful. The problem is probably on my side, but I have no idea what exactly. Thanks. :slight_smile:

Hi Stefan,

I am still trying to track down a reason that your initialDeployHook isn’t working, for some reason we don’t have logs that show it failing. Has it happened with any other services?

Hi @tyler try srv-c49tui4objd9tjerqg1g please. That one is still alive.

Thanks for that @stefan.luptak, I was able to find an error that indicated that the command ran out of memory. We run that script in the same container as the service which is currently limited at 512mb. Can you try increasing the size of the plan to see if that resolves the issue?

1 Like

OK, that helped. It would be really useful to display the failure reason in the web UI. I was struggling with this for quite some time.

The obvious fix is to change the plan to a higher one, but it’s quite a waste of resources (and money on our side) to use the more expensive one just because of the initial deploy hook.

Do you have any idea for a long term solution?

Thanks a lot. :slight_smile:

Hi @tyler do you have some new information about this problem please?

Hi @stefan.luptak, for now the after first deploy script is still going to be run on the same container as your application so it will still be limited by the memory constraints of that service. One thing I missed mentioning is that you can change the plan for preview environments Preview Environments | Render · Cloud Hosting for Developers and that will allow you to keep your base service at a cheaper tier.

1 Like