Solution
The Lemmy server appears to have a database limit of 255 characters [2]; however, individual instances appear to put their own limits on username length though the frontend [3] and/or the API [4.1][4.2].
Original Post
If you know, please also provide relevant documentation.
UPDATE (2025-02-02T06:06Z): I did some brute-force testing, and, at least for sh.itjust.works, it seems that the maximum username length is 50, and the maximum password length is 60 [1].
References
- “Sign Up”. sh.itjust.works. Lemmy. Accessed: 2025-02-02T08:49Z. https://sh.itjust.works/signup.
- When creating an account on sh.itjust.works, the sign-up form will throw this error if the provided password is greater than 60 characters in length.
- @TootSweet@lemmy.world To: [“[SOLVED] What is the maximum username length for a Lemmy account?”. “Kalcifer” @Kalcifer@sh.itjust.works. “Lemmy Support” !lemmy_support@lemmy.ml. sh.itjust.works. Lemmy. Published: 2025-02-03T00:54:51Z. https://sh.itjust.works/post/32085936.]. Published: 2025-02-02T05:57:26Z. Accessed: 2025-02-03T00:44Z. https://sh.itjust.works/post/32085936/16442382.
- They pointed to code on GitHub for the Lemmy server which outlines the length of the username data in the SQL database.
- “[SOLVED] What is the maximum username length for a Lemmy account?”. “Kalcifer” @Kalcifer@sh.itjust.works. “Lemmy Support” !lemmy_support@lemmy.ml. sh.itjust.works. Lemmy. Published: 2025-02-03T00:54:51Z. Accessed: 2025-02-03T00:46Z. https://sh.itjust.works/post/32085936.
- §“Original Post”. ¶2.
[…] I did some brute-force testing, and, at least for sh.itjust.works, it seems that the maximum username length is 50 […]
- The maximum username length for sh.itjust.works was found to be 50 characters by brute-force testing the length limit.
- §“Original Post”. ¶2.
- “Andrew” @andrew_s@piefed.social To [“[SOLVED] What is the maximum username length for a Lemmy account?”. “Kalcifer” @Kalcifer@sh.itjust.works. “Lemmy Support” !lemmy_support@lemmy.ml. sh.itjust.works. Lemmy. Published: 2025-02-03T00:54:51Z. https://sh.itjust.works/post/32085936.] Published: 2025-02-02T19:57:49Z. Accessed: 2025-02-03T00:59Z. https://sh.itjust.works/post/32085936/16453656.
-
curl -L http://lemmy.world/api/v3/site | jq -r .site_view.local_site.actor_name_max_length
(26)- The maximum username length for Lemmy.world was found to be 26 characters via an API request.
-
curl -L http://sh.itjust.works/api/v3/site | jq -r .site_view.local_site.actor_name_max_length
(50)- The maximum username length for sh.itjust.works was found to be 50 characters via an API request.
-
I’m not used to this level of rigour to be honest. You’ve accepted your own unscientific prodding of one particular instance as an answer, and one link to a years-old migration as a answer, but I give you reproducible command-line instructions, which match up with your own findings, and it’s apparently not good enough.
Anyway, as that migration shows, Lemmy distinguishes between ‘name’ for username, and ‘display_name’ for the display name. A better link for this is arguably https://github.com/LemmyNet/lemmy/blob/main/crates/db_schema/src/schema.rs#L735 but whatever. It’s these fields that are relevant to Lemmy’s API, not the terminology that ActivityPub uses. A client might reasonably want to know the limit for a username (as provided in the Site response), because it’s this that’s used for Signup and Login. Display name is set elsewhere, once that’s done, so it doesn’t make sense for
actor_name_max_length
to refer to this.Within ActivityPub, the distinction between username and display name is ‘preferredUsername’ and ‘name’, but AP also uses ‘name’ for a bunch of other things (including but not limited to what becomes a post title, a choice in a poll, or the alt-text for an image). There’s some overlap with how Lemmy’s API refers to stuff (e.g. a post title is a post name), but it not a 1:1 match.
I hope this is enough. I don’t even use Lemmy, so - in my opinion - you’re asking the wrong question to the wrong person. What you should be asking, is - “How come when I post a question to Lemmy’s support community, on the instance owned by Lemmy devs, it looks like they just ignore it?”. You shouldn’t have to be relying on guesswork by amateurs, irrespective of how many ‘references’ they can quote.
I think you are misunderstanding how I am using references. They are only being used to point to the origin of a bit of knowledge. Their existence does not guarantee any level of accuracy.
I think the way you were using references started to wind me up. It gave some academic veneer to a format that usually more conversational. They’re just links to what some people reckon, but dressed up with ‘accessed’ and ‘published’ in a footnote format that in other other contexts would suggest a level of credibility that they don’t have. Either something is solved or it isn’t, but it shouldn’t be marked ‘solved’ with links to answers of questionable accuracy.
This is a fair point, I think. Do you propose an alternative word? At what point would you say that it is justified to use “solved”? I used “solved” because, for my purposes, the question is answered (I know now that SJW has a max username length of 50, which is the only information that I personally needed).
I don’t know. I’m still hung up about this ‘references’ thing, I think. It reads like you intend for your post to be an objective resource for others to use, but then fall back to it being good enough for your subjective purpose when questioned about it.
It feels like wanting to have your cake and eat it - a authoritative-looking post that isn’t authoritative.
I have no reason to expect any obligatory answer from anybody. IMO, it would be very entitled of me, or anyone else, to expect otherwise.
Is it? Maybe. If I was using software, and asked a question that the developers of it could easily answer, and they didn’t, I might think about using something else. It certainly would’ve helped though, if you’d got an answer from someone you were more ready to believe.
I don’t know you, so how would I know what your level of expertise is regarding Lemmy? You are the one that commented on my post…
I think you can be an outsider to a particular system, and still be able to provide valuable information about it. Enough to be able to satisfy your own curiosity, and hopefully someone else’s too. I can imagine a version of this post where you asked what the max username length was, I gave you a means to find out, and we both went on our way. So you can be ‘right person’ to comment on a post, but the ‘wrong person’ when it turns out that your answer isn’t going to be fully accepted without digging into someone else’s source code. As for who the right person is in that case, there’s some overlap with your comment about ‘entitlement’, so I’ll continue there.
I completely agree! It is also illogical to argue otherwise — sort of an appeal to authority, imo.
For clarity, I wasn’t claiming that you were incorrect due to your self-professed insufficient level of expertise. I was simply responding to your argument that “it’s silly to ask you for advice because you don’t use Lemmy” by arguing that your premise is unjustified — your argument is valid; however, I don’t think that it’s sound. I interpret your logic as follows:
This is a valid argument, as it follows by modus ponens; however, it is unsound, as the premise is not epistemologically justified, as I cannot know, pior to you telling me, what your experience is with Lemmy. Hence why I said:
That was never my argument. I think you know this.
Being reluctant to answer any more questions about a topic doesn’t mean I was wrong to provide an initial answer. It just means my bandwidth has been exceeded. If Lemmy was a project I was invested in, and I didn’t think your second follow-up question was disingenuous, then it would’ve been different, but as things were, I resented being given homework about it.
Did you perhaps not see that I cited your comment’s findings as a source for the solution…? Or is it that you can’t believe that I would dare to exhibit any amount of skepticism of your claim?
I saw your edit, yeah. I’m not some precious person who thinks no-one should dare question their claims. To my mind, though, what I said wasn’t a claim. A claim would be if I’d said “lemmy.world is 26, sh.itjustworks is 50” with no further info. Instead, I gave command-line instructions for you to run yourself, so you could get the answers for those instances (and any other instances) from Lemmy’s backend itself. If I wasn’t reasonably sure that the backend was giving you the numbers you were looking for, I wouldn’t have mentioned it.
I wasn’t reacting to being questioned, though, I was reacting to being singled-out for being questioned. You marked this as “Solved” based - also - on a test from you, and an answer from TootSweet, but it didn’t look like to me that you ever questioned whether those answers deserved a follow-up. Neither of those, in my opinion, are really good enough, but I’ll say why in the answers to your individual comments about them.
Eh, this is becoming rather pedantic, imo. I’m not sure what point you are trying to make.
I made one arsey comment, and you replied to it 9 times. It was only ever going to get pedantic. It’s too late to complain about it now.
Then what is it about me using your comment as a source makes you think that I viewed your response as “not good enough”?
Nothing. It wasn’t about the edit.
I’ve said elsewhere that I thought your second follow-up question was disingenuous, so I’ll expand on that here. That’s the thing that annoyed me. Not because I think no-one should question me, or because no-one should inquire further, but because the more questions you want to ask about a particular thing, the more informed those questions need to be. Otherwise it just gets tedious, explaining why irrelevant things are irrelevant. User display names aren’t relevant to an API’s ‘/site’ response; ActivityPub isn’t relevant at all, and ‘name’ is such a generic, widely-used word, that reaching for it as evidence that I might be confused is such a stretch, I don’t know why you’d go for it. It made me question your motive, given that the likelihood of you being correct - after fishing a word out from something you don’t seem that experienced with - is so low. It stops reading as a well-intentioned question, and starts reading as scepticism for scepticism’s sake.
I’m not sure what you are referring by “migration”. Could you clarify?
TootSweet’s link was to a migration. A migration is used to upgrade a database’s schema - changing the limit on username length from whatever it was, to 255. As it happens, it’s still 255 now, but an upgrade from 3 years ago isn’t a good source for that, because as they themselves said, there could very well have been been upgrades since, that further changed the limit.
What exactly do you think is unscientific about it?
I used ‘unscientific’ because it would be a pain in the arse for someone else to reproduce, it only applies to one instance, it’s a test on someone else’s in-production system that you have no control over, and the error that returns isn’t necessarily from the backend. It looks more like a Form Validation error (i.e. from the frontend). It’s perfectly possible to create a frontend that puts it’s own limits on username length, and there’s some that no doubt already exist, so a brute-force test of those limits isn’t telling you anything reliable about what Lemmy’s internal limits are.