Setting up Mozilla Hub isn’t always smooth sailing, especially when you’re working on different servers and the origin Hubs repo keeps updating. These changes can lead to all sorts of unexpected errors, and not all of them are easy to diagnose.
Of course, the issues I ran into might not be the same ones you’ll face. Still, I figured it’s worth sharing the configuration problems with Mozilla Hub and how I solved them. If it saves you some time and head-scratching, then it’s worth it. Let’s get into it.
1. How to fix 502 server communication error in hubs admin:
Ok, let’s try to solve this.
The problem is an API call to this route
/api/ita/admin-info
and other with slash ita /ita
if we check where is the code in the reticulum which handles that open the router.ex ita API call the RetWeb.Plugs.ItaProxy if you in vs code you can command+click / ctrl+click to find the function that is called.
scope "/api/postgrest" do
pipe_through([:secure_headers, :auth_required, :admin_required, :proxy_api])
forward("/", RetWeb.Plugs.PostgrestProxy)
end
What is port 3000?
Thanks to the contributor who gave me a clue about the port 3000
it’s a PostgREST
Make sure Postgres is running on port 3000
2. How to Spoke Assets Thumbnail not Showing on Production
First, go to the spoke directory and then edit /src/api/Api.js Find the scaledThumbnailUrlFor function into this file and change it with code below:
export const scaledThumbnailUrlFor = (url, width, height) => {
// if (configs.RETICULUM_SERVER.includes("hubs.local") && url.includes("hubs.local")) {
// return url;
// }
if (configs.RETICULUM_SERVER) {
return url;
}
return `https://${configs.THUMBNAIL_SERVER}/thumbnail/${farsparkEncodeUrl(url)}?w=${width}&h=${height}`;
};
3. How to Upload Assets Too Large on Spoke Production
It because nginx. Open up the nginx configuration file
sudo nano /etc/nginx/nginx.conf
Add this client_max_body_size to the http section
http {
####################################
## Increase uploading size on server
####################################
client_max_body_size 100M;
}
Verify the nginx configuration with the below command
sudo nginx -t
You will see the following output with the above command:
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
Then restart nginx
sudo systemctl restart nginx
4. How to fix the Error while running reticulum on an iMac with the command “iex -S mix phx.server”
When I am running “iex -S mix phx.server” administrator terminal and getting the error
== Compilation error in file lib/ret/schema.ex ==
** (CompileError) lib/ret/schema.ex:39: call to local macro is_struct/1 conflicts with imported Kernel.is_struct/1, please rename the local macro or remove the conflicting import
(elixir 1.14.2) expanding macro: Kernel.and/2
lib/ret/schema.ex:39: Ret.Schema.is_schema/1
(elixir 1.14.2) expanding macro: Kernel.and/2
lib/ret/schema.ex:40: Ret.Schema.is_schema/1
(elixir 1.14.2) expanding macro: Kernel.Utils.defguard/2
lib/ret/schema.ex: Ret.Schema.is_schema/1
Solution:
This issue occurs when you have not loaded the elixir while compiling the code.
First, run the below command in the terminal
echo $PATH
Then you will find that ~/.asdf/shims folder is missing from global paths. You need to add it to the path file. First, edit the /etc/paths file from the etc folder on Mac. On Windows, you need to set environment variables from the settings.
Add ~/.asdf/shims at the top of the path file in the etc folder. But we need to add the full path of the home directory instead of the ~ operator. In my case, I have added
/Users/mymac/.asdf/shims
Then close the terminal and open it again. Now, try again the command “iex -S mix phx.server” to run reticulum.
5. What happens when (Plug.Conn.NotSentError) a response was neither set nor sent from the connection
I have faced this error many times. Then I checked and found that this problem comes when you have added host and assets_host. So I have connected both separately and then restarted the reticulum, and the problem is fixed.
Please check the reticulum Config file below: File: /config/dev.exs
host = "hubs.local"
cors_proxy_host = "hubs-proxy.local"
assets_host = "hubs-assets.local"
link_host = "hubs-link.local"
6. I am not able to load any Scenes, Avatars, or Projects in the hubs admin dashboard
When I am trying to access any menu from the admin dashboard, it redirects me to the login page with the “No Permission” error.
Then I checked and found that I missed the “@” operator before the jwt-secret value. After adding this, the hub’s admin dashboard is working fine.
Please check the reticulum.conf file below:
# reticulum.conf
db-uri = "postgres://postgres:postgres@localhost:5432/ret_dev"
db-schema = "ret0_admin"
db-anon-role = "postgres_anonymous"
jwt-secret = "@/absolute_path_to_your_file/reticulum-jwk.json"
jwt-aud = "ret_perms"
role-claim-key = ".postgrest_role"
The Bottom Lines
Finally, you’ve understood different errors as well as solutions related to the origin Hubs repo. But if you’re still struggling to figure out hub usage errors or facing a configuration problem with Mozilla Hub, don’t hesitate to give us a call. Our experts can provide you with ultimate solutions for origin Hub errors and guide you through the entire process to properly set up Mozilla Hub so you can avoid these issues going forward.
To get instant help and guidance, reach out today. Don’t let hub usage errors disrupt your workflow; let us help you fix them.
