W
Wasp-langβ€’2mo ago
Killshot

"wasp start db" takes too much time.

Any solution for this? i seem to be stuck in a loop and i can't do "Wasp start" until this resolves....
No description
27 Replies
Killshot
Killshotβ€’2mo ago
Hey @miho any inputs as to what could be causing this?
miho
mihoβ€’2mo ago
This command starts a PostgreSQL db in a Docker container. And it check if port 5432 is used by other apps, but sometimes it doesn't do it reliably. 1. Do you have Docker installed? (Check with docker -v) 2. Do you have Docker running? (Check with docker info) 3. Do you have something running at port 5432? (For Linux, I found these instructions: https://www.cyberciti.biz/faq/unix-linux-check-if-port-is-in-use-command/)
Killshot
Killshotβ€’2mo ago
i did check the first two steps. But still didn't work. Here is what i did and it worked. Shut off docker and exited all terminal windows. Then restarted PC, Then first what i did was start docker and then ran cd start db and it worked now.
miho
mihoβ€’2mo ago
i did check the first two steps. But still didn't work.
What did the two steps output? If you could share what did you see, it might help others in the future. I'm glad it worked for you πŸ™Œ
Killshot
Killshotβ€’2mo ago
docker --version showed the docker version and build info same relevant info in docker info. Sorry i can't share screenshot as after i rebooted PC they are gone.
miho
mihoβ€’2mo ago
No worries! Thank you for the effort 😊
Killshot
Killshotβ€’2mo ago
any idea on how i can access the project on my local network? Even though vite gives the network link with port to access the project on local, i am not able to access it on my phone or another laptop.
Killshot
Killshotβ€’2mo ago
No description
Killshot
Killshotβ€’2mo ago
I am on same network and wifi in other laptop and phone
Killshot
Killshotβ€’2mo ago
No description
miho
mihoβ€’2mo ago
I wrote some new instruction on testing Wasp apps locally: https://github.com/wasp-lang/learning-materials/blob/main/README.md#testing-wasp-apps-on-local-network Would you mind doing all the steps and see if it's still broken?
GitHub
learning-materials/README.md at main Β· wasp-lang/learning-materials
A place to collect some useful learning materials for Wasp - wasp-lang/learning-materials
miho
mihoβ€’2mo ago
I'm curious if it might be a network related error specific your office/home setup πŸ€” Have you been able to do this with some other frameworks other than Wasp? For me the above instructions worked, for example, I was able to login with Google and create some tasks in an example TODO app.
Killshot
Killshotβ€’2mo ago
I did the steps mentioned in the Instructions and sadly no luck. I still see this only.
miho
mihoβ€’2mo ago
Let's try this simple test. Run this command in your terminal:
node -e 'require("http").createServer((req, res) => { res.writeHead(200, {"Content-Type": "text/plain"}); res.end("Hello, World!\n"); }).listen(3000, "0.0.0.0", () => console.log("Server running at http://0.0.0.0:3000/"));'
node -e 'require("http").createServer((req, res) => { res.writeHead(200, {"Content-Type": "text/plain"}); res.end("Hello, World!\n"); }).listen(3000, "0.0.0.0", () => console.log("Server running at http://0.0.0.0:3000/"));'
It starts a Node.js server on port 3000 and listens on 0.0.0.0. Try opening the <ip>:3000 on your phone.
Killshot
Killshotβ€’2mo ago
There seemed to be a syntax error with that, so in instead run a corrected version and got an error.
No description
MEE6
MEE6β€’2mo ago
Wohooo @Killshot, you just became a Waspeteer level 3!
Killshot
Killshotβ€’2mo ago
But then ran this and it worked.... PS C:\Users\krish> node -e "require('http').createServer((req, res) => { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello, World!\n'); }).listen(3000, '0.0.0.0', () => console.log('Server running at http://0.0.0.0:3000/'));" Server running at http://0.0.0.0:3000/ Shows hello world on my ip:3000
miho
mihoβ€’2mo ago
You ran that code in the Windows PowerShell, but could you run it in the Ubuntu terminal? πŸ˜„
Killshot
Killshotβ€’2mo ago
in the ubuntu terminal it was giving an error too.... let me share screenshot
Killshot
Killshotβ€’2mo ago
No description
Killshot
Killshotβ€’2mo ago
Looks like a simple "Port already in use error" After i changed the port to listen to 8000 it started working, But i can't see the same on my network. It does show in my Local Device but not on my network.
Killshot
Killshotβ€’2mo ago
No description
Killshot
Killshotβ€’2mo ago
This is the local enviroment.
Filip
Filipβ€’2mo ago
@Killshot, If you're using Windows, there's most likely a firewall rule preventing other devices from accessing the stuff you host on your PC. It's not Wasp related, as you Miho proved with hosting the simple site above You'll have to look into your local firewalll setting sto see what's up. Have you ever successfully accessed a site on the local network from a different device? Also, what happens when you host something outside WSL, in the regular Windows powershell?
Killshot
Killshotβ€’2mo ago
Yes i definitely checked this a few minutes after debugging other stuff... I did disable all my Antivirus/Firewall monitoring. Even checked the Router settings and then tried a few scripts i found on forums to make a new forwarding rule. Honestly don't know what's going wrong. But I ain't gonna give up, Will give it another go after a few minutes, I am outside right now.
Filip
Filipβ€’2mo ago
Ok, let us know how it worked out! Probably best to test and fix network problems it with a server different than Wasp, to reduce complexity. You can use what Miho suggested. I also like python -m http.server <port_number> - that will serve the current directory in the local network on the specified port
Filip
Filipβ€’2mo ago
No description