Giter Club home page Giter Club logo

Comments (25)

tsmethurst avatar tsmethurst commented on June 12, 2024 1

Looked through the logic a bit, following the stack trace in the panic. It looks like the panic is occurring because account.Locked is nil instead of a pointer to either true or false. This doesn't make a lot of sense, because we should always fall back to setting that.

Could you possibly share which account is triggering this issue? I can't replicate it with the account https://catodon.social/users/9ms2ccihepv4shhy (admin of catodon.social); searching for that account works just fine from my GtS instance.

from gotosocial.

tsmethurst avatar tsmethurst commented on June 12, 2024 1

Just to update on this, someone else saw the same bug (see issue linked above). Try as I might, I couldn't replicate it on the testrig, but I have added a workaround (see PR linked above).

from gotosocial.

tsmethurst avatar tsmethurst commented on June 12, 2024 1

Ah thank you, that's very helpful! It looks like you're getting a zero account passed around at some point. Interesting! Thank you for the logs :) Will take another look at this.

from gotosocial.

CDN18 avatar CDN18 commented on June 12, 2024 1
SELECT * FROM public.accounts WHERE domain IS NULL AND username = "admin";

This query yields no results.

from gotosocial.

tsmethurst avatar tsmethurst commented on June 12, 2024 1

If you feel like helping me out again, could you kindly do the following:

SELECT * FROM accounts WHERE id = '01HMPADDYNZYGV6AQCVD7S691X';

I believe that's the database ID of the catodon.social user in your database. I'm extremely curious what on earth is actually stored for that account.

from gotosocial.

tsmethurst avatar tsmethurst commented on June 12, 2024 1

(That should be the last piece of the puzzle by the way, whether it turns something up or not. The rest of the fix will be me or kim stepping through the code line by line and seeing where it's going wrong.)

from gotosocial.

tsmethurst avatar tsmethurst commented on June 12, 2024 1

I did some heavy debugging yesterday, and managed to figure out what's happening in another thread: #2527

So my expectation is that this is a similar issue, and that Catodon instance is returning a 4xx code in response to your requests, which GtS doesn't handle gracefully at this point. As with that other issue, I think the fix is to implement better fallback behavior when an instance returns a 4xx code. I'm working on that on a branch now :)

from gotosocial.

tsmethurst avatar tsmethurst commented on June 12, 2024 1

Mm, well I'm relieved it's the same bug as the honk federation issue. With the fix in place it looks like things are working as intended, you're now getting the failed call logged and getting a 200 back from the search with no results, which is fine. Aside from that there's nothing we can do if they're returning 403, so I will close this.

from gotosocial.

CDN18 avatar CDN18 commented on June 12, 2024 1

Understand, thanks very much for your diligent work in resolving this anyway 😆 Should I come across a solution finally, I'll be sure to give an update here for future reference.

Update: Try to search from the Catodon side for any account of gts side first. Then they can federate like a charm!

from gotosocial.

tsmethurst avatar tsmethurst commented on June 12, 2024

Thanks, will take a look soon.

from gotosocial.

CDN18 avatar CDN18 commented on June 12, 2024

Certainly. The account I tried to search for is @[email protected].

I tried open the url https://catodon.social/users/9ms2ccihepv4shhy and got the same error. I switched the log level to debug but got no more info.

from gotosocial.

tsmethurst avatar tsmethurst commented on June 12, 2024

Hmm, I can look up @[email protected] without any problems as well. Tried it on an instance using sqlite, and one using postgres, and both were OK.

I also looked up the ActivityPub representation of https://catodon.social/users/9ms2ccihepv4shhy and it looks fine, nothing really out of the ordinary. They use a few null fields where omitted fields would probably be better, but we account for that. So I'm not really sure what the issue is, hmm

from gotosocial.

CDN18 avatar CDN18 commented on June 12, 2024

Thanks for the update! I've updated my instance to b2cacd6 and the behavior has changed a bit:

  1. When search for an account (e.g. [email protected]) that was never searched before, The client will throw an error.
  2. The second time it will return an empty account, with default avatar and default join date, and the returned account will always be locked.
gotosocial  | timestamp="21/01/2024 10:52:54.649" func=httpclient.(*Client).DoSigned level=INFO method=GET url=https://catodon.social/.well-known/webfinger?resource=acct%3Aadmin%40catodon.social requestID=rzjtcawd04000mk1k9vg pubKeyID=https://<my_gts_url>/users/<my_username>/main-key msg="performing request"
gotosocial  | timestamp="21/01/2024 10:52:54.719" func=httpclient.(*Client).DoSigned level=INFO method=GET url=https://catodon.social/users/9ms2ccihepv4shhy requestID=rzjtcawd04000mk1k9vg pubKeyID=https://<my_gts_url>/users/<my_username>/main-key msg="performing request"
gotosocial  | timestamp="21/01/2024 10:52:54.786" func=server.glob..func1.Logger.func13.1 level=INFO latency="2.87056ms" userAgent="Firefish/23.12-alpha.3 (https://catodon.social)" method=GET statusCode=200 path=/users/cdn/main-key clientIP=128.140.97.170 pubKeyID=https://catodon.social/users/9mse2oi2deom9503#main-key requestID=fzkacawd04000q5a7k0g msg="OK: wrote 560B"
gotosocial  | timestamp="21/01/2024 10:52:54.797" func=server.glob..func1.Logger.func13.1 level=INFO latency="198.10388ms" userAgent="***" method=GET statusCode=200 path=/api/v2/search clientIP=0.0.0.0 requestID=rzjtcawd04000mk1k9vg msg="OK: wrote 59B"
gotosocial  | timestamp="21/01/2024 10:53:16.239" func=typeutils.(*Converter).AccountToAPIAccountPublic.func1 level=WARN requestID=8wxaeawd04001bdy22p0 msg="locked ptr was nil, using default true"
gotosocial  | timestamp="21/01/2024 10:53:16.239" func=typeutils.(*Converter).AccountToAPIAccountPublic.func1 level=WARN requestID=8wxaeawd04001bdy22p0 msg="discoverable ptr was nil, using default false"
gotosocial  | timestamp="21/01/2024 10:53:16.239" func=typeutils.(*Converter).AccountToAPIAccountPublic.func1 level=WARN requestID=8wxaeawd04001bdy22p0 msg="bot ptr was nil, using default false"
gotosocial  | timestamp="21/01/2024 10:53:16.239" func=typeutils.(*Converter).AccountToAPIAccountPublic.func1 level=WARN requestID=8wxaeawd04001bdy22p0 msg="enableRSS ptr was nil, using default false"
gotosocial  | timestamp="21/01/2024 10:53:16.239" func=server.glob..func1.Logger.func13.1 level=INFO latency="7.9246ms" userAgent="***" method=GET statusCode=200 path=/api/v2/search clientIP=0.0.0.0 requestID=8wxaeawd04001bdy22p0 msg="OK: wrote 329B"
gotosocial  | timestamp="21/01/2024 10:53:16.444" func=server.glob..func1.Logger.func13.1 level=INFO latency="7.59208ms" userAgent="***" method=GET statusCode=200 path=/api/v1/accounts/relationships clientIP=0.0.0.0 requestID=2gxteawd04000k90gzag msg="OK: wrote 174B"
gotosocial  | timestamp="21/01/2024 10:53:16.652" func=server.glob..func1.Logger.func13.1 level=INFO latency="4.16376ms" userAgent="***" method=GET statusCode=200 path=/api/v1/accounts/01HMNTDSEE55HT0VEV8659WQ30/statuses clientIP=0.0.0.0 requestID=x0xteawd040015n192c0 msg="OK: wrote 26B"
gotosocial  | timestamp="21/01/2024 10:53:16.658" func=server.glob..func1.Logger.func13.1 level=INFO latency="4.1352ms" userAgent="***" method=GET statusCode=200 path=/api/v1/accounts/01HMNTDSEE55HT0VEV8659WQ30/statuses clientIP=0.0.0.0 requestID=xrxteawd04001b07rc5g msg="OK: wrote 26B"
  1. I tried sending a follow request, it get's displayed as pending but the catodon.social account doesn't recieve the follow request (nor the follower state changed on the catodon side), error level log occurs.
gotosocial  | timestamp="21/01/2024 10:24:47.788" func=workers.(*Processor).ProcessFromClientAPI level=INFO activityType=Create objectType=Follow fromAccount=cdn requestID=mmm8tawd040010zd7wy0 msg="processing from client API"
gotosocial  | timestamp="21/01/2024 10:24:47.789" func=server.glob..func1.Logger.func13.1 level=INFO latency="7.98628ms" userAgent="***" method=POST statusCode=200 path=/api/v1/accounts/01HMNRNVREJ7XXH3N6GCYMW745/follow clientIP=*.*.*.* requestID=mmm8tawd040010zd7wy0 msg="OK: wrote 178B"
gotosocial  | timestamp="21/01/2024 10:24:47.789" func=federation.(*federatingActor).Send level=INFO requestID=mmm8tawd040010zd7wy0 msg="send activity Follow via outbox https://<my_gts_url>/users/<my_username>/outbox"
gotosocial  | timestamp="21/01/2024 10:24:47.800" func=workers.(*clientAPI).CreateFollowReq level=ERROR requestID=mmm8tawd040010zd7wy0 msg="error federating follow request: Follow: error sending activity *typefollow.ActivityStreamsFollow via outbox https://<my_gts_url>/users/<my_username>/outbox: func1: error delivering to : invalid http request: empty url host"
gotosocial  | timestamp="21/01/2024 10:24:51.502" func=server.glob..func1.Logger.func13.1 level=INFO latency="3.66168ms" userAgent="***" method=GET statusCode=200 path=/api/v1/accounts/relationships clientIP=*.*.*.* requestID=58vrtawd040001fnnkpg msg="OK: wrote 180B"

from gotosocial.

tsmethurst avatar tsmethurst commented on June 12, 2024

If you restart your instance and look up the same account again, does the behavior change? Or is it the same?

from gotosocial.

CDN18 avatar CDN18 commented on June 12, 2024

If you restart your instance and look up the same account again, does the behavior change? Or is it the same?

It does not change. I tried looking up the database according to #2527 and found no account in table accounts with domain catodon.social

Below is my query:

SELECT * FROM public.accounts WHERE domain = "catodon.social";

from gotosocial.

tsmethurst avatar tsmethurst commented on June 12, 2024

Alright thanks! Could you please try the following:

SELECT * FROM public.accounts WHERE domain IS NULL AND username = "admin";

And let me know if there are any results?

from gotosocial.

tsmethurst avatar tsmethurst commented on June 12, 2024

Alright, thank you! One final thing, could you try:

SELECT * FROM public.accounts WHERE domain = "" AND username = "admin";

from gotosocial.

CDN18 avatar CDN18 commented on June 12, 2024
SELECT * FROM public.accounts WHERE domain = "" AND username = "admin";

Certainly! This query also yields no result.

from gotosocial.

tsmethurst avatar tsmethurst commented on June 12, 2024

Okay, I think we have to get a bit nuts here. Could you do me a favor and set your GTS_LOG_LEVEL to trace, restart your instance, try the query again, and paste all the logs that it generates at the time you do the search? It will generate a whole LOT of database query logs which I should be able to use to help debug this. You can help narrow down the logs by grepping on the request id of the /search response.

from gotosocial.

CDN18 avatar CDN18 commented on June 12, 2024

Okay! I've changed the log level, re-searched @[email protected] (by viewing the profile directly) for 2 times and initiated a follow request.

Here's the complete log: https://pastebin.mozilla.org/ce1qqWxU
And the db query gets the same result (which is zero row).

from gotosocial.

tsmethurst avatar tsmethurst commented on June 12, 2024

Thank you very much!

from gotosocial.

CDN18 avatar CDN18 commented on June 12, 2024

No problem! I went through the above process again as my instance got restarted because of auto-update.

The log shows that I'm querying 01HMQBAG5HH7WTZZSM3JKBFNFM's statuses, so I changed the ID in the query:

SELECT * FROM accounts WHERE id = '01HMPADDYNZYGV6AQCVD7S691X';

This query also yields no result. Seems that the account was never stored in the database ...?

p.s: Nor did I get any result if I don't change the id.

from gotosocial.

daenney avatar daenney commented on June 12, 2024

With #2563 merged, I think that resolves this one?

from gotosocial.

CDN18 avatar CDN18 commented on June 12, 2024

Partly, after upgrading to e3052e8 the zero account was never returned. Now it returns 403 Forbidden on request of an account:

gotosocial  | timestamp="27/01/2024 13:44:45.932" func=httpclient.(*Client).DoSigned level=INFO method=GET url=https://catodon.social/.well-known/webfinger?resource=acct%3Aadmin%40catodon.social requestID=a5j2mjwd04001h3qe1ng pubKeyID=https://<my_gts_url>/users/<my_gts_username>/main-key msg="performing request"
gotosocial  | timestamp="27/01/2024 13:44:45.994" func=httpclient.(*Client).DoSigned level=INFO method=GET url=https://catodon.social/users/9ms2ccihepv4shhy requestID=a5j2mjwd04001h3qe1ng pubKeyID=https://<my_gts_url>/users/<my_gts_username>/main-key msg="performing request"
gotosocial  | timestamp="27/01/2024 13:44:46.071" func=server.glob..func1.Logger.func13.1 level=INFO latency="3.00056ms" userAgent="Firefish/23.12-alpha.3 (https://catodon.social)" method=GET statusCode=200 path=/users/<my_gts_username>/main-key clientIP=128.140.97.170 pubKeyID=https://catodon.social/users/9mse2oi2deom9503#main-key requestID=yhj2mjwd04000vh987r0 msg="OK: wrote 560B"
gotosocial  | timestamp="27/01/2024 13:44:46.080" func=gtsmodel.(*Account).IsNew level=INFO requestID=a5j2mjwd04001h3qe1ng msg="enrichAccount: error dereferencing https://catodon.social/users/9ms2ccihepv4shhy: Dereference: GET request to https://catodon.social/users/9ms2ccihepv4shhy failed: status=\"403 Forbidden\" body=\"Forbidden\""
gotosocial  | timestamp="27/01/2024 13:44:46.080" func=server.glob..func1.Logger.func13.1 level=INFO latency="175.2886ms" userAgent="***" method=GET statusCode=200 path=/api/v2/search clientIP=*.*.*.* requestID=a5j2mjwd04001h3qe1ng msg="OK: wrote 59B"

Maybe my instance was blocked on their side...? I have never interacted with any catodon account before...

from gotosocial.

tsmethurst avatar tsmethurst commented on June 12, 2024

You're welcome! ❤️

from gotosocial.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.