status-im / status-mobile

a free (libre) open source, mobile OS for Ethereum
https://status.app
Mozilla Public License 2.0
3.89k stars 985 forks source link

Discover communities is not loading for the new users #21158

Open churik opened 1 month ago

churik commented 1 month ago

Bug Report

Problem

Several days ago community directory can be opened without significant delay, currently it is in endless loading state

Expected behavior

can see communities

Actual behavior

IMAGE 2024-09-02 11:38:13

Reproduction

  1. Create new user
  2. Tap on "Discover communities"

Additional Information

image

logs from desktop:

INF 2024-09-02 11:35:06.407+02:00 history request started                    topics="mailservers-service" tid=4718066 file=service.nim:170 numBatches=1
INF 2024-09-02 11:35:09.463+02:00 mailserver not working                     topics="mailservers-service" tid=4718066 file=service.nim:165
INF 2024-09-02 11:35:09.464+02:00 removing active mailserver                 topics="mailservers-service" tid=4718066 file=service.nim:153
INF 2024-09-02 11:35:10.345+02:00 active mailserver changed                  topics="mailservers-service" tid=4718066 file=service.nim:155 node=/dns4/store-02.do-ams3.shards.test.statusim.net/tcp/30303/p2p/16Uiu2HAm9aDJPkhGxc2SFcEACTFdZ91Q5TJjp76qZEhq9iF59x7R id=store-02.do-ams3.shards.test
ACTIVE MAILSERVER CHANGED: ref 0x39bf90830 --> [nodeAddress = 0x1427c2100"/dns4/store-02.do-ams3.shards.test.statusim.net/tcp/30303/p2p/16Uiu2HAm9aDJPkhGxc2SFcEACTFdZ91Q5TJjp76qZEhq9iF59x7R",
nodeId = 0x37fc23fa0"store-02.do-ams3.shards.test"]
INF 2024-09-02 11:35:10.345+02:00 mailserver available                       topics="mailservers-service" tid=4718066 file=service.nim:160
INF 2024-09-02 11:35:10.346+02:00 history request started                    topics="mailservers-service" tid=4718066 file=service.nim:170 numBatches=1
INF 2024-09-02 11:35:44.392+02:00 history request started                    topics="mailservers-service" tid=4718066 file=service.nim:170 numBatches=1
INF 2024-09-02 11:35:51.461+02:00 mailserver not working                     topics="mailservers-service" tid=4718066 file=service.nim:165
INF 2024-09-02 11:35:51.462+02:00 removing active mailserver                 topics="mailservers-service" tid=4718066 file=service.nim:153
INF 2024-09-02 11:35:52.432+02:00 active mailserver changed                  topics="mailservers-service" tid=4718066 file=service.nim:155 node=/dns4/store-02.gc-us-central1-a.shards.test.statusim.net/tcp/30303/p2p/16Uiu2HAmJnVR7ZzFaYvciPVafUXuYGLHPzSUigqAmeNw9nJUVGeM id=store-02.gc-us-central1-a.shards.test
ACTIVE MAILSERVER CHANGED: ref 0x39c8159e0 --> [nodeAddress = 0x37fea9f60"/dns4/store-02.gc-us-central1-a.shards.test.statusim.net/tcp/30303/p2p/16Uiu2HAmJnVR7ZzFaYvciPVafUXuYGLHPzSUigqAmeNw9nJUVGeM",
nodeId = 0x39bfb1bf0"store-02.gc-us-central1-a.shards.test"]
INF 2024-09-02 11:35:52.433+02:00 mailserver available                       topics="mailservers-service" tid=4718066 file=service.nim:160
INF 2024-09-02 11:35:52.434+02:00 history request started                    topics="mailservers-service" tid=4718066 file=service.nim:170 numBatches=1
INF 2024-09-02 11:36:36.323+02:00 history request started                    topics="mailservers-service" tid=4718066 file=service.nim:170 numBatches=1
INF 2024-09-02 11:37:40.462+02:00 mailserver not working                     topics="mailservers-service" tid=4718066 file=service.nim:165
INF 2024-09-02 11:37:40.463+02:00 removing active mailserver                 topics="mailservers-service" tid=4718066 file=service.nim:153
INF 2024-09-02 11:37:41.278+02:00 active mailserver changed                  topics="mailservers-service" tid=4718066 file=service.nim:155 node=/dns4/store-01.gc-us-central1-a.shards.test.statusim.net/tcp/30303/p2p/16Uiu2HAmMELCo218hncCtTvC2Dwbej3rbyHQcR8erXNnKGei7WPZ id=store-01.gc-us-central1-a.shards.test
ACTIVE MAILSERVER CHANGED: ref 0x163ed7530 --> [nodeAddress = 0x37fbd6240"/dns4/store-01.gc-us-central1-a.shards.test.statusim.net/tcp/30303/p2p/16Uiu2HAmMELCo218hncCtTvC2Dwbej3rbyHQcR8erXNnKGei7WPZ",
nodeId = 0x39bfb18d0"store-01.gc-us-central1-a.shards.test"]
INF 2024-09-02 11:37:41.279+02:00 mailserver available                       topics="mailservers-service" tid=4718066 file=service.nim:160
INF 2024-09-02 11:37:41.280+02:00 history request started                    topics="mailservers-service" tid=4718066 file=service.nim:170 numBatches=1
Parveshdhull commented 1 month ago

related issue: https://github.com/status-im/status-desktop/issues/15326

Parveshdhull commented 4 weeks ago

optimism-goerli.infura.io: no such host

ERROR[09-18|09:20:12.266|github.com/status-im/status-go/protocol/messenger_curated_communities.go:49]                                              failed to get curated communities from contract error="optimism-goerli.infura.io.error: Post \"https://optimism-goerli.infura.io/v3/\": dial tcp: lookup optimism-goerli.infura.io: no such host"
ERROR[09-18|09:21:12.268|github.com/status-im/status-go/protocol/messenger_curated_communities.go:49]                                              failed to get curated communities from contract error="optimism-goerli.infura.io.error: Post \"https://optimism-goerli.infura.io/v3/\": dial tcp: lookup optimism-goerli.infura.io: no such host"
ERROR[09-18|09:22:12.271|github.com/status-im/status-go/protocol/messenger_curated_communities.go:49]                                              failed to get curated communities from contract error="optimism-goerli.infura.io.error: Post \"https://optimism-goerli.infura.io/v3/\": dial tcp: lookup optimism-goerli.infura.io: no such host"
Parveshdhull commented 4 weeks ago

cc @siddarthkay

Parveshdhull commented 4 weeks ago

We are hard coding optimism-goerli chainId, here when testNetworksEnabled https://github.com/status-im/status-go/blob/ff7de6884537be05c2b7d3fac3e70fe439515f2a/protocol/messenger_curated_communities.go#L94

For testing I tried other chainIds from https://github.com/status-im/status-go/blob/ff7de6884537be05c2b7d3fac3e70fe439515f2a/api/default_networks.go#L18

But, got error

not available for chainID

ERROR[09-18|10:34:39.350|github.com/status-im/status-go/protocol/messenger_curated_communities.go:49]                                        failed to get curated communities from contract error="not available for chainID"
Parveshdhull commented 4 weeks ago

On the optimism mainnet (chainID 10), giving this error

Authorization Required

ERROR[09-18|10:59:37.601|github.com/status-im/status-go/protocol/messenger_curated_communities.go:49]                                     failed to get curated communities from contract error="status-proxy-0.error: 401 Unauthorized: <html>\r\n<head><title>401 Authorization Required</title></head>\r\n<body>\r\n<center><h1>401 Authorization Required</h1></center>\r\n<hr><center>nginx/1.26.1</center>\r\n</body>\r\n</html>\r\n, status-proxy-fallback-1.error: 401 Unauthorized: <html>\r\n<head><title>401 Authorization Required</title></head>\r\n<body>\r\n<center><h1>401 Authorization Required</h1></center>\r\n<hr><center>nginx/1.26.1</center>\r\n</body>\r\n</html>\r\n, optimism-archival.rpc.grove.city.error: endpoint 3ef2018191814b7e1009b8d9 has passed its daily relay limit, optimism-mainnet.infura.io.error: 401 Unauthorized: project id required in the url\n"
Parveshdhull commented 4 weeks ago

For ref, Implementation: https://github.com/status-im/status-go/pull/2685

Parveshdhull commented 4 weeks ago

On the optimism mainnet (chainID 10), giving this error

Authorization Required

ERROR[09-18|10:59:37.601|github.com/status-im/status-go/protocol/messenger_curated_communities.go:49]                                     failed to get curated communities from contract error="status-proxy-0.error: 401 Unauthorized: <html>\r\n<head><title>401 Authorization Required</title></head>\r\n<body>\r\n<center><h1>401 Authorization Required</h1></center>\r\n<hr><center>nginx/1.26.1</center>\r\n</body>\r\n</html>\r\n, status-proxy-fallback-1.error: 401 Unauthorized: <html>\r\n<head><title>401 Authorization Required</title></head>\r\n<body>\r\n<center><h1>401 Authorization Required</h1></center>\r\n<hr><center>nginx/1.26.1</center>\r\n</body>\r\n</html>\r\n, optimism-archival.rpc.grove.city.error: endpoint 3ef2018191814b7e1009b8d9 has passed its daily relay limit, optimism-mainnet.infura.io.error: 401 Unauthorized: project id required in the url\n"

@richard-ramos Please can you take a look at the issue.

richard-ramos commented 4 weeks ago

This sounds like something for @status-im/status-go-guild I'm not familiar with the optimism integration nor the keys used for that endpoint

dlipicar commented 4 weeks ago

@Parveshdhull regarding optimism-goerli.infura.io: no such host, Goerli is dead and shouldn't be used anywhere anymore. Any such use should jump to the equivalent sepolia chain.

regarding the Authorization Required message, it seems whatever build is used isn't getting its API keys properly injected. If this is a local build, refer to https://www.notion.so/Getting-and-Configuring-API-Keys-67347f753e1444ae92c85aaee69faeb4. If this is a CI build, something went VERY wrong.

Parveshdhull commented 4 weeks ago

Thank you @dlipicar for sharing this document.

If this is a CI build, something went VERY wrong.

No, I was not using CI builds. I was testing on debug and release builds (build locally).

Parveshdhull commented 4 weeks ago

I checked logs and didn't saw any error on CI builds. So not sure why discover communities is not loading.

Parveshdhull commented 4 weeks ago

Ok, probably its just a UI bug. Added logs in release build and it seems we are getting list of curatedCommunities

Status.log:09-19 13:09:30.973 28426 28566 I ReactNativeJS:handle contract communities {:contractCommunities [0x02b5bdaf5a25fcfe2ee14c501fab1836b8de57f61621080c3d52073d16de0d98d6 0x024fa9114e8884d220111653fe9a2095e62c8d0890198ac9787d512d707e276501 0x027cdda4a01b68c275454dd39da595a568290f3d10c8cb8c7af489ed442703a8c1], :contractFeaturedCommunities [], :communities {}, :unknownCommunities [0x02b5bdaf5a25fcfe2ee14c501fab1836b8de57f61621080c3d52073d16de0d98d6 0x024fa9114e8884d220111653fe9a2095e62c8d0890198ac9787d512d707e276501 0x027cdda4a01b68c275454dd39da595a568290f3d10c8cb8c7af489ed442703a8c1]}
Parveshdhull commented 4 weeks ago

Returned response don't have :contract-featured-communities and only have unknown-communities.

igor-sirotin commented 4 weeks ago

Well, it doesn't fetch on the webapp either đŸ¤” cc @richard-ramos

image
churik commented 4 weeks ago

It is very unstable. tried this yesterday and it again loaded for 5 mins and only after several reopenings

churik commented 1 week ago

So far I see there is no capacity to look at that and there are no steps to reproduce it reliably, postponing to 2.32