Network Error On user creation
Hey,
so i'm getting "network error" when i try to create a user.
The DB is up and running ( as far as i can tell ) and the env varibles have been copied.
running this on a alma9 minimal install, ( headless ) and connecting with a remote computer.
I also ran the wasp db studio and it seems to connect just fine.. Not sure what i'm doing wrong really. And honestly this is all kinda confusing as I am a network admin by trade not a dev 😄
Thank you!
24 Replies
Hi @Cookies. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Based on the information in the knowledge sources, a "Network Error" when trying to create a user in a Wasp app is often related to connectivity issues between the client and server, or between the server and the database. Here are some steps and checks that have helped others resolve similar issues:
1. Check Server Logs: Even if the database appears to be running and
wasp db studio
connects, it's important to check your server terminal for any errors when you attempt the user creation. Sometimes errors are only visible in the server logs, not in the client or browser console. If you see any errors there, they can provide more specific clues about what's wrong Template Signup Network Error – Answers Part 1.
2. Environment Variables: Double-check that your environment variables are set correctly. For example, ensure that your .env.server
and .env.client
files have the correct URLs, especially if you are running the client and server on different hosts or ports. If you are accessing the app remotely, make sure the URLs are not set to localhost
but to the actual accessible address Template Signup Network Error – Answers Part 2.
3. Port Accessibility: Make sure the server port (usually 3001) is open and accessible from your remote computer. If you are running headless on Alma9, check your firewall settings to ensure the port is not blocked.
4. Database Connection: Even if wasp db studio
works, ensure that the database is continuously running and accessible. If you are using Docker for your database, the container must remain running while you use the app. Stopping the container will break the connection Realworld app returning Network Error – Comments Part 1.
5. Client-Server Communication: A "Network Error" can also mean the client cannot reach the server. If you are running the client on a different machine, make sure the server's address is reachable from the client, and that CORS settings are not blocking the request Template Signup Network Error – Answers Part 3.
6. Restart Everything: Sometimes, simply restarting the server and client after updating environment variables or configuration files can resolve the issue.
If after these checks you are still seeing the error, please provide:
- The exact error message from the browser console and/or server logs.
- Your .env.server
and .env.client
(with sensitive info redacted).
- How you are running the client and server (same machine, different machines, etc.).
This will help narrow down the issue further. Let me know if you need more specific guidance!
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Cookies, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?@kapa.ai
Server are client are on different machines
Firewall is fully disabled
.env.server and .env.client are the sample files
Let me check the knowledge base for you again. One moment! :books:
----------------------
Thank you for clarifying that your server and client are on different machines, the firewall is disabled, and you are using the sample
After updating the environment files, restart both the server and client processes to ensure the new settings are loaded. 3. Why this matters:
If you leave the sample values (which use
.env.server
and .env.client
files.
Based on the knowledge sources, using the sample environment files without modification is likely the cause of your "Network Error." The sample files are set up for local development, where both client and server run on the same machine (typically using localhost
). When running on different machines, you must update these environment variables to reflect the actual network addresses.
Key steps to resolve this:
1. Update .env.server and .env.client:
- In .env.server
, set WASP_WEB_CLIENT_URL
to the URL where your client (frontend) is accessible.
- In .env.client
, set REACT_APP_API_URL
to the URL where your server (backend) is accessible.
- Do not use localhost
in these variables unless both client and server are on the same machine. Use the actual IP address or hostname of the server/client as seen from the other machine.
Example for .env.client
(if your server is at 192.168.1.10:3001):
Example for .env.server
(if your client is at 192.168.1.20:3000):
2. Restart Both Server and Client:After updating the environment files, restart both the server and client processes to ensure the new settings are loaded. 3. Why this matters:
If you leave the sample values (which use
localhost
), the client will try to reach the server at localhost:3001
, which means "itself"—not your actual server machine. This results in a network error because the server isn't running on the client's machine.
This approach is confirmed by community troubleshooting for similar issues, where updating the environment variables to use the correct network addresses resolved the "Network Error" when running Wasp apps across different machines Template Signup Network Error – Answers Part 2.
If you update your environment files as described and still encounter issues, please share the updated values (with sensitive info redacted) and any new error messages you see.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Cookies, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?@kapa.ai done, but still giving the same error
Let me check the knowledge base for you again. One moment! :books:
----------------------
If you have updated your
Look for any specific error messages in your browser's developer console (Network tab) and in the server terminal. These messages can provide more details about what is failing—whether it's a CORS issue, a connection timeout, or something else. Community members have resolved similar issues by sharing these logs for further troubleshooting Template Signup Network Error – Answers Part 1. 2. CORS Issues:
If the client and server are on different origins (different IPs or ports), CORS (Cross-Origin Resource Sharing) might be blocking requests. The knowledge sources mention CORS as a common cause of network errors in this setup. If you see CORS errors in the browser console, you may need to adjust your server's CORS settings Template Signup Network Error – Answers Part 3. 3. Verify Server Accessibility:
From the client machine, try to access the server's API endpoint directly in the browser (e.g.,
Ensure there are no typos and that the variables are correctly set. For example,
After any change to environment variables, both the server and client must be restarted for changes to take effect. If you have tried all of the above and are still experiencing the issue, please provide: - The exact error message from the browser console and/or server logs. - The values (with sensitive info redacted) from your
.env.server
and .env.client
files with the correct network addresses and restarted both the server and client, but are still seeing a "Network Error," here are the next steps based on the knowledge sources:
1. Check Browser Console and Server Logs:Look for any specific error messages in your browser's developer console (Network tab) and in the server terminal. These messages can provide more details about what is failing—whether it's a CORS issue, a connection timeout, or something else. Community members have resolved similar issues by sharing these logs for further troubleshooting Template Signup Network Error – Answers Part 1. 2. CORS Issues:
If the client and server are on different origins (different IPs or ports), CORS (Cross-Origin Resource Sharing) might be blocking requests. The knowledge sources mention CORS as a common cause of network errors in this setup. If you see CORS errors in the browser console, you may need to adjust your server's CORS settings Template Signup Network Error – Answers Part 3. 3. Verify Server Accessibility:
From the client machine, try to access the server's API endpoint directly in the browser (e.g.,
<http://<server-ip>:3001/auth/me
>). If you cannot reach it, there may be a networking or configuration issue outside of Wasp.
4. Double-Check Environment Variables:Ensure there are no typos and that the variables are correctly set. For example,
REACT_APP_API_URL
in .env.client
should match the actual server address, and WASP_WEB_CLIENT_URL
in .env.server
should match the client address.
5. Restart Everything:After any change to environment variables, both the server and client must be restarted for changes to take effect. If you have tried all of the above and are still experiencing the issue, please provide: - The exact error message from the browser console and/or server logs. - The values (with sensitive info redacted) from your
.env.server
and .env.client
.
- Confirmation that you can access the server endpoint from the client machine.
This information will help further diagnose the problem. The knowledge sources do not provide a more specific solution without these details.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Cookies, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?it seems like it's still trying to go to localhost:3001 but i've changed hte settings and restarted the server, is tehre anywhere else this could be saved
okay iv'e gone though and tried it again, it seems to work.
Now i want to add a domain with a reverse proxy.. how do i do that without breaking it as it's currently using the internal IP addresses
@kapa.ai
Let me check the knowledge base for you again. One moment! :books:
Wohooo @Cookies, you just became a Waspeteer level 1!
----------------------
To add a domain with a reverse proxy (such as Nginx or Caddy) in front of your Wasp app, you need to update your environment variables to use your new domain instead of the internal IP addresses. This ensures that CORS and other settings work correctly.
Steps:
1. Set Up Your Reverse Proxy:
Configure your reverse proxy to forward requests to your Wasp server and client. For example, Nginx can proxy requests to your internal IPs and ports. 2. Update Environment Variables:
- On the server, set
See: Accessing the configuration
See: Deployment with reverse proxy 3. Restart Your Server and Client:
After updating the environment variables, restart both processes so the new settings take effect. 4. CORS Configuration:
If you have custom CORS middleware, ensure it allows your new domain(s). You can do this by referencing
You must update your environment variables to use your public domain(s) and restart your services. This will prevent CORS and API issues when moving from internal IPs to a reverse proxy and custom domain. If you need a sample Nginx or Caddy config, let me know! ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @Cookies, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
Configure your reverse proxy to forward requests to your Wasp server and client. For example, Nginx can proxy requests to your internal IPs and ports. 2. Update Environment Variables:
- On the server, set
WASP_WEB_CLIENT_URL
to your client’s public domain (e.g., <https://yourdomain.com
>).
- On the client, set REACT_APP_API_URL
to your server’s public domain (e.g., <https://api.yourdomain.com
> or the appropriate subdomain/path).
This is necessary so that Wasp configures CORS and API URLs correctly for your new public-facing domains, not the internal IPs.See: Accessing the configuration
See: Deployment with reverse proxy 3. Restart Your Server and Client:
After updating the environment variables, restart both processes so the new settings take effect. 4. CORS Configuration:
If you have custom CORS middleware, ensure it allows your new domain(s). You can do this by referencing
config.frontendUrl
in your middleware setup, which will now reflect your public domain Configuring Middleware.
Summary:You must update your environment variables to use your public domain(s) and restart your services. This will prevent CORS and API issues when moving from internal IPs to a reverse proxy and custom domain. If you need a sample Nginx or Caddy config, let me know! ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @Cookies, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
it says i need to add something to server.allowedHosts what do i enter there @kapa.ai
Let me check the knowledge base for you again. One moment! :books:
----------------------
I'm sorry, but the knowledge sources provided do not contain any information about a server.allowedHosts setting or how to configure it in Wasp. There are references to configuring CORS and allowed origins, as well as setting up domains and environment variables for client/server communication, but nothing specifically about server.allowedHosts.
If you have documentation or a source that mentions server.allowedHosts, please share it, or let me know if you need guidance on CORS or domain configuration, which are covered in the sources Accessing the configuration and Configuring Middleware.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Cookies, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?
@kapa.ai okay i've changed teh settings to use the domain name, but now it's still saying it's trying to connect ot the old IP address.
is there a way to flush the old address and use te new url
Let me check the knowledge base for you again. One moment! :books:
----------------------
If your Wasp app is still trying to connect to the old IP address after you updated your environment variables to use the new domain, you likely need to restart both the server and the client for the changes to take effect. Wasp reads environment variables at startup, so any changes require a restart of the relevant processes.
Additionally, make sure you have updated the correct environment variables:
- In
.env.client
, set REACT_APP_API_URL
to your new server URL.
- In .env.server
, set WASP_WEB_CLIENT_URL
to your new client URL.
After making these changes, restart both the server and the client. This should flush the old address and use the new URL as configured. If you are still seeing the old address being used, double-check that there are no typos and that you are editing the correct files. Also, ensure your browser is not caching any old configuration—try a hard refresh or clear your browser cache if needed.
The knowledge sources confirm that environment variable changes require a restart to take effect, and that these variables control the URLs used for client-server communication in Wasp apps Accessing the configuration Template Signup Network Error – Answers Part 2.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Cookies, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?okay, i've even changed it to 10.10.10.10 to see if the ip will update and it's stuck on the original IP address. How do i flush that @kapa.ai
Let me check the knowledge base for you again. One moment! :books:
----------------------
If your Wasp app is still using the original IP address after you have updated your environment variables and restarted both the server and client, the most likely cause is that the client build is still using the old environment variable values. In Wasp, environment variables for the client are embedded at build time, not at runtime.
To flush the old address and ensure the new URL is used:
1. Stop both the server and client processes.
2. Rebuild the client:
Run the build process again so that the new environment variables are embedded into the client bundle. For example: or, if you are deploying manually, follow the steps for rebuilding the client as described in the deployment docs. 3. Restart the server and client:
After rebuilding, start both processes again. This process ensures that the new environment variable values are picked up and the old IP address is no longer used by the client. This is confirmed in the documentation, which states that in production, environment variables are embedded during the build, and you must rebuild the app after changing them for the changes to take effect Accessing the configuration. If you are still seeing the old IP after following these steps, make sure you are not serving a cached version of the client in your browser—try a hard refresh or clear your browser cache. If you continue to have issues, please provide details about your deployment process and any relevant logs. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @Cookies, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
Run the build process again so that the new environment variables are embedded into the client bundle. For example: or, if you are deploying manually, follow the steps for rebuilding the client as described in the deployment docs. 3. Restart the server and client:
After rebuilding, start both processes again. This process ensures that the new environment variable values are picked up and the old IP address is no longer used by the client. This is confirmed in the documentation, which states that in production, environment variables are embedded during the build, and you must rebuild the app after changing them for the changes to take effect Accessing the configuration. If you are still seeing the old IP after following these steps, make sure you are not serving a cached version of the client in your browser—try a hard refresh or clear your browser cache. If you continue to have issues, please provide details about your deployment process and any relevant logs. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @Cookies, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
how do you do a hard refresh in firefox
@kapa.ai
Let me check the knowledge base for you again. One moment! :books:
Sorry @Cookies, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?
@kapa.ai how do you do a hard frefresh in firefox
Let me check the knowledge base for you again. One moment! :books:
----------------------
I'm sorry, but the knowledge sources do not contain information about how to perform a hard refresh in Firefox or browser-specific actions. My expertise is focused on Wasp and related development topics. If you have any questions about Wasp, feel free to ask!
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Cookies, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?
@kapa.ai okay it's all working! but how do i set myself as an admin now on the site?
Let me check the knowledge base for you again. One moment! :books:
----------------------
To set yourself as an admin in your Wasp app, you have a couple of options based on the knowledge sources:
1. Directly in the Database:
After signing up with your user account, you can use Prisma Studio to edit your user record and set the
Some templates (like open-saas) allow you to specify admin emails via an environment variable (e.g.,
After signing up with your user account, you can use Prisma Studio to edit your user record and set the
isAdmin
field to true
. Here’s how:
- Run wasp db studio
in your project directory to open Prisma Studio.
- Find your user in the User
table.
- Set the isAdmin
field to true
and save the change.
This approach is commonly used for local development and testing, as described in community discussions Discord support thread: Unable to access the Dashboard as an admin user > Original post Part 2.
2. Using Environment Variables (if supported by your app):Some templates (like open-saas) allow you to specify admin emails via an environment variable (e.g.,
ADMIN_EMAILS
). If your app supports this, add your email to the ADMIN_EMAILS
variable in your .env.server
file before signing up. When you register with that email, your user will automatically be set as admin Discord support thread: Unable to access the Dashboard as an admin user > Original post Part 1.
If you’re just testing locally, editing the user directly in Prisma Studio is the quickest way. If you need more details or run into issues, let me know!
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Cookies, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?@kapa.ai you can mark this as solved now.. I think i'm going Thanks
Let me check the knowledge base for you again. One moment! :books:
----------------------
Great to hear everything is working for you now! I'll mark this as solved. If you have any more questions about Wasp in the future, feel free to ask. Thanks for reaching out!
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Cookies, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?
Hey @Cookies, only seeing this now.
I see Kappa helped you, that's nice to see! It has been known to hallucinate from time to time
Anything else I can help you with?
And honestly this is all kinda confusing as I am a network admin by trade not a devWell you're doing better than a lot of devs we get questions from 😄 Also, the confusing stuff is maybe on us, not on you. Share what confused you if you can remember and we'll see if we can improve it. Thanks for trying out Wasp!