PretendoNetwork / account

Pretendo account server
GNU Affero General Public License v3.0
53 stars 22 forks source link

Account creation sometimes fails, usually on mobile #41

Open shutterbug2000 opened 1 year ago

gitlimes commented 1 year ago

The exact error appears to be Username contains invalid characters

Gandalf1783 commented 1 year ago

My account creation on Nintendo 3DS XL fails too. Error-Code is 022-2402. I got the message in the privacy policy about the christmas-beta and my nintendo used the pretendo servers. (Confirmed via looking up DNS-Lookups & TCP/TLS connections of 3DS through Wireshark)

Is this the same error? If not, I would open a new issue.

jonbarrow commented 1 year ago

That error is thrown when trying to register on the website using a username with invalid characters. The following regex is used to check the username: /^[\w\-\.]*$/gm

This does sometimes fail with valid usernames however and only at random times. I have no idea why this is at the moment. I have seen a username fail once and then work again after trying again

Gandalf1783 commented 1 year ago

Could this be due to different Unicode Versions or ASCII being used as the charset?

jonbarrow commented 1 year ago

The only thing I was able to figure out is it seems to happen most often when using the tab key to navigate the menu

Thesola10 commented 1 year ago

incidentally, I'm getting 022-2571 on a regular 3DS when trying to log into my PNID created through the website. Any idea why that could be?

Williammal21 commented 4 months ago

It's the same thing happens to my 3DS.

BlackSealSix commented 4 months ago

Same problem here.

Squaduck commented 1 month ago

Same problem here on 3ds. Are you still using that regex btw? it can match a zero-length string when you use a '*', so you should use a '+' instead.

Gandalf1783 commented 1 month ago

I haven't tried it since, but I could in the coming days, If i remember it...

Beethoven-n commented 1 month ago

this is such a weird issue. you get an error code 022-2402 until you set your system's locale to spanish and then it just works

Gandalf1783 commented 1 month ago

Can you try to MITM your 3ds and try to decrypt the request? I have the feeling that there is some issue in regards to the string format, maybe some other locale setting results in special characters? Maybe some Unicode-related bug?

EDIT: I had a account server setup previously, could we get one of those up and running and check the output and add some debugging messages, including the name? Otherwise I think we'll have to do some regex debugging.

Squaduck commented 1 month ago

I'll try to get some packet captures later. The pretendo packet capture tool thing should work, right? Worst case, I can set up some jank, but I think it'd be encrypted. I'll also see if I could set up a server to get some logs.

I have no clue how this project works, but I don't think the regex would be an issue. There's already a minimum amount of characters, so the regex shouldn't need to work about that. Though it shouldn't hurt to try changing it.

UPDATE: Got packet capture working via hotspot. Now I'm going to try to make a local server.

Gandalf1783 commented 1 month ago

I think it should work with the pretendo method.

I specifically said thats its a good idea to debug the regex since some seem to be able to create an account without issues.

This would imply that if the regex is working, some of the hundred DS Systems firmware would work correctly (aka. actually register), and a handful of the DS Systems would misbehave and get this error back.

On the other hand, it seems to be too rare of an issue that it actually is the regex.

Squaduck commented 1 month ago

I think it should work with the pretendo method.

I tried HokakuCTR and it just crashed.

I've got a local server set up and (hopefully) working, but I've got no idea how to make my 3DS connect to it. Any advice would be greatly appreciated since it sounds like you've done this before

I had a account server setup previously

Gandalf1783 commented 1 month ago

Ideally you have a domain or domain server setup yourself.

Pihole or some local router overrides should do the trick.

For a local all services on one machine, you need a reverse proxy. I used Apache2. Generate SSLKeys, and setup the different subdomains of the servers (I am unsure which are needed, I think nasc.nintendowifi.com and others) to the respective applications. As in nasc. would e.g. be redirected to port 8726 or whatever the pretendo application is using.

As soon as you have this, all requests directed towards a certain domain on port 80 or 443 should be redirected to the proper service/server with the correct port.

If you have a custom domain and/or cannot override the nintendo.com domains, you need your local dns server to respond to (e.g.) nasc.owndomain.com and you then need to compile a custom version of the 3ds patch application, where you insert your own custom domains instead of the ones provided by pretendo.

I am away for the next 3-4 days, if you need further help feel free to comment. Last time I had a local pretendo setup was over 1,5 years ago. It might be that many aspects have changed, but I can definitely take a look at running these myself and help you with debugging :)

KEEGUNATOR2 commented 1 week ago

For anyone stumbling across this recently looking for help with the 022-2402 error code when creating an account, setting your systems language to Spanish works for a lot of people, including myself. I tried twice to create an account on my 3DS XL, both times giving me error code 022-2402, but when I switched my console language to spanish and input the exact same info, it worked flawlessly. (Your able to change it back to english right after account creation, don't worry)