Skip to content
Init is coming / May 19 - 23
Back

[SOLVED]SocketTimeoutException:

  • 0
  • Users
  • Accounts
  • Android
asapsonter
18 Apr, 2023, 09:22

I am running it locally with docker on my PC

TL;DR
User had a SocketTimeoutException error while trying to connect to an IP address. They were using the wrong endpoint format (`http://192.168.6.134:300/v1`) and should have included the scheme. User also needed to check if their phone was on the same network as their PC and if they could browse the same URL on their phone. They should have called `client.setEndpoint()` on their Client instance and corrected any errors. The user also mentioned a docker problem, firewall problem, or antivirus problem as possible causes.
darShan
18 Apr, 2023, 09:22

You need to use your local IP then 🙂

asapsonter
18 Apr, 2023, 09:23

that is why i can access the console with this http://localhost:300/

asapsonter
18 Apr, 2023, 09:23

ok

asapsonter
18 Apr, 2023, 09:24

I will try this as my end point now, http://192.168.1.[*]:300/v1 right?

darShan
18 Apr, 2023, 09:25

Yess, but do check your complete IP though, I just used [*] for explanation.

asapsonter
18 Apr, 2023, 09:25

sure

asapsonter
18 Apr, 2023, 11:25

it didn't work, i still get the same error

darShan
18 Apr, 2023, 12:59

can you post the complete error, ip, port and the endpoint used in the android project?

asapsonter
19 Apr, 2023, 00:40

sure

asapsonter
19 Apr, 2023, 00:54

error

TypeScript
asapsonter
19 Apr, 2023, 00:55

appwriteEndpoint="192.1*8.6.*:300/v1" endpoint

asapsonter
19 Apr, 2023, 00:58

port

TypeScript
    ports:
      - 300:80
      - 444:443
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - appwrite-config:/storage/config:ro
      - appwrite-certificates:/storage/certificates:ro
    depends_on:
      - appwrite
    networks:
      - gateway
      - appwrite
asapsonter
19 Apr, 2023, 01:18
asapsonter
19 Apr, 2023, 01:18

@darShan

Drake
19 Apr, 2023, 01:32

this specific error is occurring because you never called client.setEndpoint() on your Client instance

asapsonter
19 Apr, 2023, 03:17

I corrected that.

asapsonter
19 Apr, 2023, 03:19

but now I am having the first error from few days ago. java.net.SocketTimeoutException: failed to connect to /192.1*8.6.** (port 300) from /192.1*8.6.1*4 (port 57562) after 10000ms

asapsonter
19 Apr, 2023, 03:19

@Steven

Drake
19 Apr, 2023, 03:41
  1. Did you include the scheme as part of the endpoint (http://192.168.6.134:300/v1)?
  2. Can you browse to the same URL on your PC?
  3. Is your phone on the same network as your PC?
  4. Can you browse the same URL on your phone?
asapsonter
19 Apr, 2023, 03:51

anwering Q1. Yes I did. this format http://192.168.6.134:300/v1)

Q2, No, unless i use localhost:300. I am unable to browse with this http://192.168.6.134:300/v1 Q3. No but i tried connecting them on the same network as well, but i got the same error. Q4. I will try that now

Drake
19 Apr, 2023, 03:56

If the IP address doesn't even work on your PC, there's no way it will work from a different device.

You might have a docker problem, firewall problem, or antivirus problem

asapsonter
19 Apr, 2023, 09:20

Thanks. I worked my way around it.

asapsonter
19 Apr, 2023, 09:21

I had to enter my IP address as the localhost instead of the default while pulling Appwrite image

asapsonter
19 Apr, 2023, 09:22

[SOLVED]SocketTimeoutException:

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more