# Installation: Failed to connect error on running 'sleep 20 && curl http://localhost:4000/api/v1/instance'

**URL:** <https://meta.akkoma.dev/t/installation-failed-to-connect-error-on-running-sleep-20-curl-http-localhost-4000-api-v1-instance/209>\
**Category:** Support\
**Created:** [4 December 2022 19:47 UTC](https://meta.akkoma.dev/t/installation-failed-to-connect-error-on-running-sleep-20-curl-http-localhost-4000-api-v1-instance/209 "2022-12-04T19:47:03Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deus](https://meta.akkoma.dev/letter_avatar_proxy/v4/letter/d/b77776/32.png) [@Deus](https://meta.akkoma.dev/u/Deus)\
**Post date:** [4 December 2022 19:47 UTC](https://meta.akkoma.dev/t/installation-failed-to-connect-error-on-running-sleep-20-curl-http-localhost-4000-api-v1-instance/209/1 "2022-12-04T19:47:03Z")

</div>

Running the OTP installation method (link below) and on the step where it says, `# Wait for about 20 seconds and query the instance endpoint, if it shows your uri, name and email correctly, you are configured correctly`.

I ran the said step:

`sleep 20 && curl http://localhost:4000/api/v1/instance`

But the output is:

`curl: (7) Failed to connect to localhost port 4000: Connection refused`

What am I doing wrong here? I’m running these commands as root and the Ubuntu flavor is amd64.

Installation link: [Installing on Linux using OTP releases - Akkoma Documentation](https://docs.akkoma.dev/stable/installation/otp_en/)

---

<div class="post-metadata">

**Author:** ![snott](https://meta.akkoma.dev/user_avatar/meta.akkoma.dev/snott/32/86_2.png) [@snott](https://meta.akkoma.dev/u/snott)\
**Post date:** [4 December 2022 20:40 UTC](https://meta.akkoma.dev/t/installation-failed-to-connect-error-on-running-sleep-20-curl-http-localhost-4000-api-v1-instance/209/2 "2022-12-04T20:40:47Z")

</div>

You’ve messed up a prior step in that case. This step just tests it all works.

I nuked and paved first time I tried as I messed something up, which is why I wrote my guide; it was more so I could follow along than others, but I figured others might benefit also.

---

<div class="post-metadata">

**Author:** ![FloatingGhost](https://meta.akkoma.dev/letter_avatar_proxy/v4/letter/f/d07c76/32.png) [@FloatingGhost](https://meta.akkoma.dev/u/FloatingGhost)\
**Post date:** [5 December 2022 00:28 UTC](https://meta.akkoma.dev/t/installation-failed-to-connect-error-on-running-sleep-20-curl-http-localhost-4000-api-v1-instance/209/3 "2022-12-05T00:28:31Z")

</div>

need more info here - when you boot the instance, does it start?

there should be logs

---

<div class="post-metadata">

**Author:** ![Deus](https://meta.akkoma.dev/letter_avatar_proxy/v4/letter/d/b77776/32.png) [@Deus](https://meta.akkoma.dev/u/Deus)\
**Post date:** [5 December 2022 01:37 UTC](https://meta.akkoma.dev/t/installation-failed-to-connect-error-on-running-sleep-20-curl-http-localhost-4000-api-v1-instance/209/4 "2022-12-05T01:37:39Z")

</div>

@snott Could you share the link for your guide please?  
EDIT: I see you’ve written one for Debian. Would it be the same for Ubuntu?

@FloatingGhost I get the Welcome to nginx screen. How do I view the logs? I can share here. I ask because I’m following the steps of the official guide so might be helpful for others in future.

---

<div class="post-metadata">

**Author:** ![Deus](https://meta.akkoma.dev/letter_avatar_proxy/v4/letter/d/b77776/32.png) [@Deus](https://meta.akkoma.dev/u/Deus)\
**Post date:** [5 December 2022 02:33 UTC](https://meta.akkoma.dev/t/installation-failed-to-connect-error-on-running-sleep-20-curl-http-localhost-4000-api-v1-instance/209/5 "2022-12-05T02:33:06Z")

</div>

I tried @snott installation guide. Same error after running `sleep 20 && curl http://localhost:4000/api/v1/instance`

Sharing this additional info - there are two errors messages that I get in RED color when I run the following commands.

```auto

Success. You can now start the database server using:
    pg_ctlcluster 12 main start
Ver Cluster Port Status Owner Data directory Log file
12 main 5432 down postgres /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log

```

In the above,  
`12 main 5432 down postgres /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log`  
is in RED color.

When I run `adduser --system --shell /bin/false --home /opt/akkoma akkoma`

I get the following.

```auto
Adding system user `akkoma' (UID 114) ...
Adding new user `akkoma' (UID 114) with group `nogroup' ...
Creating home directory `/opt/akkoma' ...

```

Here `akkoma' (UID 114) with group` is in RED color (some kind of warning).

These are the only warning I get. Other than that the files extractions go fine.

Apart from that, I accepted the defaults or a Yes to each of the following.

```auto
What domain will your instance use? (e.g pleroma.soykaf.com) [] xxx.tld
What is the name of your instance? (e.g. The Corndog Emporium) [xxx.co] xxxx
What is your admin email address? [] xxxx@gmail.com
What email address do you want to use for sending email notifications? [xxxx@gmail.com] info@xxx.co
Do you want search engines to index your site? (y/n) [y] y
Do you want to store the configuration in the database (allows controlling it from admin-fe)? (y/n) [n] y
What is the hostname of your database? [localhost]
What is the name of your database? [akkoma]
What is the user used to connect to your database? [akkoma]
What is the password used to connect to your database? [autogenerated]
Would you like to use RUM indices? [n] y
What port will the app listen to (leave it if you are using the default setup with nginx)? [4000]
What ip will the app listen to (leave it if you are using the default setup with nginx)? [127.0.0.1]
What directory should media uploads go in (when using the local uploader)? [/var/lib/akkoma/uploads]
What directory should custom public files be read from (custom emojis, frontend bundle overrides, robots.txt, etc.)? [/var/lib/akkoma/static]
Do you want to strip location (GPS) data from uploaded images? This requires exiftool, it was detected as installed. (y/n) [y] y
Do you want to anonymize the filenames of uploads? (y/n) [n] y
Do you want to deduplicate uploaded files? (y/n) [n] y

```

---

<div class="post-metadata">

**Author:** ![FloatingGhost](https://meta.akkoma.dev/letter_avatar_proxy/v4/letter/f/d07c76/32.png) [@FloatingGhost](https://meta.akkoma.dev/u/FloatingGhost)\
**Post date:** [5 December 2022 02:38 UTC](https://meta.akkoma.dev/t/installation-failed-to-connect-error-on-running-sleep-20-curl-http-localhost-4000-api-v1-instance/209/6 "2022-12-05T02:38:58Z")

</div>

none of the above is when you start the server

run

```auto
su akkoma -s $SHELL -lc "./bin/pleroma start

```

---

<div class="post-metadata">

**Author:** ![Deus](https://meta.akkoma.dev/letter_avatar_proxy/v4/letter/d/b77776/32.png) [@Deus](https://meta.akkoma.dev/u/Deus)\
**Post date:** [5 December 2022 02:43 UTC](https://meta.akkoma.dev/t/installation-failed-to-connect-error-on-running-sleep-20-curl-http-localhost-4000-api-v1-instance/209/7 "2022-12-05T02:43:42Z")

</div>

Should your command have a closing double quote? Like:

`su akkoma -s $SHELL -lc "./bin/pleroma start"`?  
I did that and I got the following dump.

```auto
02:42:16.923 [notice] :alarm_handler: {:set, {:system_memory_high_watermark, []}}

02:42:17.460 [error] Use `RUM` index is enabled, but were not applied migrations for it.
If you want to start Pleroma anyway, set
config :pleroma, :database, rum_enabled: false
Otherwise apply the following migrations:
`mix ecto.migrate --migrations-path priv/repo/optional_migrations/rum_indexing/`

02:42:17.461 [notice] Application pleroma exited: exited in: Pleroma.Application.start(:normal, [])
    ** (EXIT) an exception was raised:
        ** (Pleroma.ApplicationRequirements.VerifyError) Unapplied RUM Migrations detected
            (pleroma 3.4.0-0-gf91b89673) lib/pleroma/application_requirements.ex:32: Pleroma.ApplicationRequirements.handle_result/1
            (pleroma 3.4.0-0-gf91b89673) lib/pleroma/application.ex:55: Pleroma.Application.start/2
            (kernel 8.3.2.1) application_master.erl:293: :application_master.start_it_old/4
[os_mon] memory supervisor port (memsup): Erlang has closed

02:42:17.474 [notice] :alarm_handler: {:clear, :system_memory_high_watermark}
[os_mon] cpu supervisor port (cpu_sup): Erlang has closed
{"Kernel pid terminated",application_controller,"{application_start_failure,pleroma,{bad_return,{{'Elixir.Pleroma.Application',start,[normal,[]]},{'EXIT',{#{' __exception__' => true,' __struct__' => 'Elixir.Pleroma.ApplicationRequirements.VerifyError',message => <<\"Unapplied RUM Migrations detected\">>},[{'Elixir.Pleroma.ApplicationRequirements',handle_result,1,[{file,\"lib/pleroma/application_requirements.ex\"},{line,32}]},{'Elixir.Pleroma.Application',start,2,[{file,\"lib/pleroma/application.ex\"},{line,55}]},{application_master,start_it_old,4,[{file,\"application_master.erl\"},{line,293}]}]}}}}}"}
Kernel pid terminated (application_controller) ({application_start_failure,pleroma,{bad_return,{{'Elixir.Pleroma.Application',start,[normal,[]]},{'EXIT',{#{' __exception__' => true,' __struct__' => 'Elixir.Pleroma.ApplicationRequirements.VerifyError',message => <<"Unapplied RUM Migrations detected">>},[{'Elixir.Pleroma.ApplicationRequirements',handle_result,1,[{file,"lib/pleroma/application_requirements.ex"},{line,32}]},{'Elixir.Pleroma.Application',start,2,[{file,"lib/pleroma/application.ex"},{line,55}]},{application_master,start_it_old,4,[{file,"application_master.erl"},{line,293}]}]}}}}})

Crash dump is being written to: erl_crash.dump...done

```

---

<div class="post-metadata">

**Author:** ![snott](https://meta.akkoma.dev/user_avatar/meta.akkoma.dev/snott/32/86_2.png) [@snott](https://meta.akkoma.dev/u/snott)\
**Post date:** [5 December 2022 02:49 UTC](https://meta.akkoma.dev/t/installation-failed-to-connect-error-on-running-sleep-20-curl-http-localhost-4000-api-v1-instance/209/8 "2022-12-05T02:49:17Z")

</div>

If you followed my guide you would not have rum indices, so should have selected n for that question.

---

<div class="post-metadata">

**Author:** ![Deus](https://meta.akkoma.dev/letter_avatar_proxy/v4/letter/d/b77776/32.png) [@Deus](https://meta.akkoma.dev/u/Deus)\
**Post date:** [5 December 2022 02:50 UTC](https://meta.akkoma.dev/t/installation-failed-to-connect-error-on-running-sleep-20-curl-http-localhost-4000-api-v1-instance/209/9 "2022-12-05T02:50:29Z")

</div>

I was thinking the same. Thought it’d be cool to have the ‘search’ functionality. It was causing me a lot of problems anyhow.

Let me whip up a new droplet and try with `No` to the following?  
`Would you like to use RUM indices? [n] `

My DigitalOcean droplet has the following configuration BTW.

> 2 GB Memory / 1 AMD vCPU / 50 GB Disk / - Ubuntu 20.04 (LTS) x64

---

<div class="post-metadata">

**Author:** ![FloatingGhost](https://meta.akkoma.dev/letter_avatar_proxy/v4/letter/f/d07c76/32.png) [@FloatingGhost](https://meta.akkoma.dev/u/FloatingGhost)\
**Post date:** [5 December 2022 02:55 UTC](https://meta.akkoma.dev/t/installation-failed-to-connect-error-on-running-sleep-20-curl-http-localhost-4000-api-v1-instance/209/10 "2022-12-05T02:55:52Z")

</div>

or you could follow the error message’s instruction and just change the setting in config 🥴

---

<div class="post-metadata">

**Author:** ![Deus](https://meta.akkoma.dev/letter_avatar_proxy/v4/letter/d/b77776/32.png) [@Deus](https://meta.akkoma.dev/u/Deus)\
**Post date:** [5 December 2022 02:58 UTC](https://meta.akkoma.dev/t/installation-failed-to-connect-error-on-running-sleep-20-curl-http-localhost-4000-api-v1-instance/209/11 "2022-12-05T02:58:34Z")

</div>

Also @snott Why have the following in the installation guide? It has always caused me problems if we’re going to say No to Rum indices anyway? Just a thought that crossed my mind - confusing for users as well.

```auto
apt install postgresql-11-rum

```

@FloatingGhost I would love to do that. But the steps? Nevertheless, have rebuilt my droplet, will get back. 🙂

---

<div class="post-metadata">

**Author:** ![Deus](https://meta.akkoma.dev/letter_avatar_proxy/v4/letter/d/b77776/32.png) [@Deus](https://meta.akkoma.dev/u/Deus)\
**Post date:** [5 December 2022 03:53 UTC](https://meta.akkoma.dev/t/installation-failed-to-connect-error-on-running-sleep-20-curl-http-localhost-4000-api-v1-instance/209/12 "2022-12-05T03:53:52Z")

</div>

@snott Installation successful! Sharing some notes (in case someone lands here) and suggestions.

After running `su akkoma -s $SHELL -lc "./bin/pleroma_ctl instance gen --output /etc/akkoma/config.exs --output-psql /tmp/setup_db.psql"`, I entered `n` for the following.

`Would you like to use RUM indices? [n] n`

Again, after running `su akkoma -s $SHELL -lc "./bin/pleroma_ctl instance gen --output /etc/akkoma/config.exs --output-psql /tmp/setup_db.psql"`

I also got the following message in RED color. I ignored this.

`!!! Config path is not declared! Please ensure it exists and that AKKOMA_CONFIG_PATH and/or PLEROMA_CONFIG_PATH is unset or points to an existing file`

**Suggestion** : After running `su akkoma -s $SHELL -lc "./bin/pleroma daemon"` would be nice to have a ‘new line’ before `root` (for presentation) 🙂 Notice `root@ms-in:~#` in the below code.

> {“approval\_required”:false,“avatar\_upload\_limit”:2000000,“background\_image”:“[redacted.co&nbsp;-&nbsp;Informationen zum Thema redacted.](https://redacted.co/images/city.jpg%22,%22background_upload_limit%22:4000000,%22banner_upload_limit%22:4000000,%22description%22:%22Akkoma:) The cooler fediverse [server",“description\_limit”:5000,“email”:"info@redacted.com](mailto:server%22,%22description_limit%22:5000,%22email%22:%22info@redacted.com)”,“languages”:[“en”],“max\_toot\_chars”:5000,“pleroma”:{“metadata”:{“account\_activation\_required”:false,“features”:[“pleroma\_api”,“akkoma\_api”,“mastodon\_api”,“mastodon\_api\_streaming”,“polls”,“v2\_suggestions”,“pleroma\_explicit\_addressing”,“shareable\_emoji\_packs”,“multifetch”,“pleroma:api/v1/notifications:include\_types\_filter”,“editing”,“relay”,“pleroma\_emoji\_reactions”,“exposable\_reactions”,“profile\_directory”,“custom\_emoji\_reactions”,“pleroma:get:main/ostatus”],“federation”:{“enabled”:true,“exclusions”:false,“mrf\_hashtag”:{“federated\_timeline\_removal”:,“reject”:,“sensitive”:[“nsfw”]},“mrf\_object\_age”:{“actions”:[“delist”,“strip\_followers”],“threshold”:604800},“mrf\_policies”:[“ObjectAgePolicy”,“TagPolicy”,“HashtagPolicy”,“InlineQuotePolicy”],“quarantined\_instances”:,“quarantined\_instances\_info”:{“quarantined\_instances”:{}}},“fields\_limits”:{“max\_fields”:10,“max\_remote\_fields”:20,“name\_length”:512,“value\_length”:2048},“post\_formats”:[“text/plain”,“text/html”,“text/markdown”,“text/bbcode”,“text/x.misskeymarkdown”],“privileged\_staff”:false},“stats”:{“mau”:0},“vapid\_public\_key”:“BJ\_I-ZKrhy81oDvzeJGiOsjmK-3JipFpnUwipoYwK1Y5gaKhCkDNxhjDjNGDuD9uC1eFHGXYlfY8uqQKULZYsCk”},“poll\_limits”:{“max\_expiration”:31536000,“max\_option\_chars”:200,“max\_options”:20,“min\_expiration”:0},“registrations”:true,“stats”:{“domain\_count”:0,“status\_count”:0,“user\_count”:0},“thumbnail”:“[redacted.co&nbsp;-&nbsp;Informationen zum Thema redacted.](https://redacted.co/instance/thumbnail.jpeg%22,%22title%22:%22some) title”,“upload\_limit”:16000000,“uri”:“[https://redacted.co](https://redacted.co)”,“urls”:{“streaming\_api”:“wss://redacted.co”},“version”:“2.7.2 (compatible; Akkoma 3.4.0-0-gf91b89673)”}root@ms-in:~#

@FloatingGhost

1. What’s the difference between the following? Same result, right?  
**Your guide** : `certbot certonly --standalone --preferred-challenges http -d yourinstance.tld`  
**Other guides** : `certbot certonly --email <your@emailaddress> -d <yourdomain> --standalone`

2. In the `Add email capability` section of your guide, would be nice to have a sample example. Sendinblue has been the easiest to understand IMHO.

3. If there’s a way to ‘bulk’ subscribe relays, would be great to have it in the `Adding relays` section.

Thank you both very much. I’m loving it here!

---

<div class="post-metadata">

**Author:** ![snott](https://meta.akkoma.dev/user_avatar/meta.akkoma.dev/snott/32/86_2.png) [@snott](https://meta.akkoma.dev/u/snott)\
**Post date:** [5 December 2022 04:46 UTC](https://meta.akkoma.dev/t/installation-failed-to-connect-error-on-running-sleep-20-curl-http-localhost-4000-api-v1-instance/209/13 "2022-12-05T04:46:24Z")

</div>

I could be blind, but pretty sure I left that out of my guide deliberately - I will add a note and link to official documentation at that point.

My guide is a “I don’t know what I am doing but this worked” type deal. As I learn I will update it. Glad you got it going!

---

<div class="post-metadata">

**Author:** ![Deus](https://meta.akkoma.dev/letter_avatar_proxy/v4/letter/d/b77776/32.png) [@Deus](https://meta.akkoma.dev/u/Deus)\
**Post date:** [5 December 2022 04:56 UTC](https://meta.akkoma.dev/t/installation-failed-to-connect-error-on-running-sleep-20-curl-http-localhost-4000-api-v1-instance/209/14 "2022-12-05T04:56:24Z")

</div>

> I left that out of my guide deliberately

I understand where you’re coming from @snott

As someone who earns his living writing technical documentation, I’ll humbly suggest to put it all down. Perhaps as a running note.  
We have this motto: “If it’s not documented, it does not exist”. So might as well dump all the messages and the troubleshooting steps, if any. As in, ‘what to do when a message is displayed? Ignore or do something?’ 🙂
