# Mastodon error 422 Mastodon::HostValidationError Trying to Connect to PeerTube Instance on the same server

**URL:** https://forum.yunohost.org/t/mastodon-error-422-mastodon-hostvalidationerror-trying-to-connect-to-peertube-instance-on-the-same-server/31537
**Category:** Support apps
**Tags:** mastodon, peertube, english
**Created:** [October 20, 2024, 2:31am UTC](https://forum.yunohost.org/t/mastodon-error-422-mastodon-hostvalidationerror-trying-to-connect-to-peertube-instance-on-the-same-server/31537 "2024-10-20T02:31:15Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![boxingpreacher](https://forum.yunohost.org/user_avatar/forum.yunohost.org/boxingpreacher/32/10699_2.png) [@boxingpreacher](https://forum.yunohost.org/u/boxingpreacher)
#### Post date: [October 20, 2024, 2:31am UTC](https://forum.yunohost.org/t/mastodon-error-422-mastodon-hostvalidationerror-trying-to-connect-to-peertube-instance-on-the-same-server/31537/1 "2024-10-20T02:31:15Z")

</div>

### I have searched the forum for similar issues

on

### This category is for issues regarding specific apps, _NOT_ general issues with YunoHost.

on

### This form is written in English 🇬🇧 but feel free to write in French 🇫🇷 if you’re more comfortable!

on

### What type of hardware are you using

Old laptop or computer

### What YunoHost version are you running

11.2.31

### What app is this about

Mastodon

### Describe your issue

Using Mastodon, I am trying to follow my account on PeerTube. Both, of course, are on the same server. But Mastodon returns the error:

422 Mastodon::HostValidationError

I tried the solution posted in [Trouble following WriteFreely blog from Mastodon instance on same server](https://forum.yunohost.org/t/trouble-following-writefreely-blog-from-mastodon-instance-on-same-server/28372) and added the following string to my /var/www/mastodon/live/.env.production:

`ALLOWED_PRIVATE_ADDRESSES=xx.xx.xx.xx`

Where the x’s are my actual ip address, of course. That didn’t change anything for me; I received the same 422 error.

### Share relevant logs or error messages

Mastodon error 422 Mastodon::HostValidationError

---

<div class="post-metadata">

### Author: ![ericg](https://forum.yunohost.org/user_avatar/forum.yunohost.org/ericg/32/1543_2.png) [@ericg](https://forum.yunohost.org/u/ericg)
#### Post date: [October 20, 2024, 6:41am UTC](https://forum.yunohost.org/t/mastodon-error-422-mastodon-hostvalidationerror-trying-to-connect-to-peertube-instance-on-the-same-server/31537/2 "2024-10-20T06:41:21Z")

</div>

Just to be sure, did you restart Mastodon services?

---

<div class="post-metadata">

### Author: ![boxingpreacher](https://forum.yunohost.org/user_avatar/forum.yunohost.org/boxingpreacher/32/10699_2.png) [@boxingpreacher](https://forum.yunohost.org/u/boxingpreacher)
#### Post date: [October 20, 2024, 8:45pm UTC](https://forum.yunohost.org/t/mastodon-error-422-mastodon-hostvalidationerror-trying-to-connect-to-peertube-instance-on-the-same-server/31537/3 "2024-10-20T20:45:35Z")

</div>

I hadn’t, because I’m kind of new to all of this. So I looked up how to do that, and I did the following:

- `systemctl start mastodon-sidekiq.service`
- `systemctl start mastodon-streaming.service`
- 

```
systemctl start mastodon-web.service

```

… with hopeful anticipation. But sadly, same result. ☹

---

<div class="post-metadata">

### Author: ![ericg](https://forum.yunohost.org/user_avatar/forum.yunohost.org/ericg/32/1543_2.png) [@ericg](https://forum.yunohost.org/u/ericg)
#### Post date: [October 20, 2024, 9:24pm UTC](https://forum.yunohost.org/t/mastodon-error-422-mastodon-hostvalidationerror-trying-to-connect-to-peertube-instance-on-the-same-server/31537/4 "2024-10-20T21:24:02Z")

</div>

for your information you can also use the webadmin to restart services : Tools → services → Mastodon → Restart

---

<div class="post-metadata">

### Author: ![boxingpreacher](https://forum.yunohost.org/user_avatar/forum.yunohost.org/boxingpreacher/32/10699_2.png) [@boxingpreacher](https://forum.yunohost.org/u/boxingpreacher)
#### Post date: [October 20, 2024, 10:02pm UTC](https://forum.yunohost.org/t/mastodon-error-422-mastodon-hostvalidationerror-trying-to-connect-to-peertube-instance-on-the-same-server/31537/5 "2024-10-20T22:02:34Z")

</div>

lol… I can’t believe I missed that! But I’m newish, so thank you for that. Still the same results though.

---

<div class="post-metadata">

### Author: ![boxingpreacher](https://forum.yunohost.org/user_avatar/forum.yunohost.org/boxingpreacher/32/10699_2.png) [@boxingpreacher](https://forum.yunohost.org/u/boxingpreacher)
#### Post date: [October 21, 2024, 4:04am UTC](https://forum.yunohost.org/t/mastodon-error-422-mastodon-hostvalidationerror-trying-to-connect-to-peertube-instance-on-the-same-server/31537/6 "2024-10-21T04:04:02Z")

</div>

Okay, adding back 127.0.0.1 and THEN restarting services did the trick. I’m learning! Thanks for the pointer!

So, to summarize, /var/www/mastodon/live/.env.production needs the following line added, where xx.xx.xx.xx is your actual IP address:

`ALLOWED_PRIVATE_ADDRESSES=xx.xx.xx.xx,127.0.0.1`

Then restart all three mastodon services in Tools → services → Mastodon → Restart

---

<div class="post-metadata">

### Author: ![system](https://forum.yunohost.org/uploads/default/original/2X/f/f59fe8e3ee6b100b4f574d30d6e30479c68b89f0.png) [@system](https://forum.yunohost.org/u/system)
#### Post date: [November 5, 2024, 4:04am UTC](https://forum.yunohost.org/t/mastodon-error-422-mastodon-hostvalidationerror-trying-to-connect-to-peertube-instance-on-the-same-server/31537/7 "2024-11-05T04:04:06Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
