Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Inability to Connect to Mojang's API #6

Open
Pheotis opened this issue Aug 15, 2019 · 4 comments
Open

Error: Inability to Connect to Mojang's API #6

Pheotis opened this issue Aug 15, 2019 · 4 comments
Labels
bug Something isn't working

Comments

@Pheotis
Copy link

Pheotis commented Aug 15, 2019

Outline of Issue

Attempted Usage

Using the plugin, it is not currently possible for me to register new users using TOTP through the /register TOTP command.

Result of Attempted Usage

On my current installation, 100% of the time, attempting to preform such a registration will result in an error explaining that the plugin could not "load player data from Mojang".
This error message suggests that I may have hit the API's rate limit.
image

Attempts at Troubleshooting the Issue

Rate Limit Consideration

I have confirmed that the rate limit is not the issue:

  • This issue still occurs when 2fa+ is the only plugin operating on the server
  • This issue still occurs when that server is the only program operating on the dedicated box
  • I am able to pull information manually from the database without any problems using
    curl https://api.mojang.com/users/profiles/minecraft/InteriorCamping

Response time consideration

Previously, pulling data from the API took an abnormal amount of time on my box.
image

  • This caused issues with aspects of several plugins, including the skull feature of EssentialsX (usage of which would cause a five second server freeze).
  • After investigating this response time, I have determined that this issue was caused by a mistake in the configuration of my firewall.
    • After correcting that mistake, EssentialsX's skull function appears now functions as intended.
    • After correcting that mistake, 2fa+'s TOTP function is still unable to pull info from the API.

image

Additional Information

The server is running Paper 641 (1.13.2) on Waterfall 290 on Ubuntu Server 18.04 LTS

Conclusion

  • As this issue is not being caused by the rate limit, and as other plugins (EssX) appear to be able to pull information from the API, I was wondering if this might be a plugin-specific issue.
  • As a work-a-round, I was wondering if it would be possible to add the ability to manually pass UUIDs to the plugin through command usage such as 2fa register TOTP <UUID>.
@egg82 egg82 added the bug Something isn't working label Aug 16, 2019
@egg82
Copy link
Owner

egg82 commented Aug 16, 2019

I would definitely recommend switching from CraftBukkit/Spigot to Paper if you haven't: https://whypaper.emc.gs - this will fix your current issue at least.

I'll take another look at the (admittedly old) code running that particular lookup and see if I can optimize it or see what's going on. Thanks for the report!

@Pheotis
Copy link
Author

Pheotis commented Aug 17, 2019

Thanks!

This problem resulted from running the register command on a paper 641 instance connected to a waterfall network comprised of other paper instances and a single test spigot 1.8 instance.

I will try again with the outdated spigot instance disabled to see if it changes anything.

@egg82
Copy link
Owner

egg82 commented Aug 17, 2019

I must have skipped over the Paper 641 (1.13.2) somehow; this version of Paper SHOULD have the PlayerProfile API, I believe. In this case, it would be strange if it were still trying to use the BukkitPlayerInfo (rather than the PaperPlayerInfo) class. I'll have to take another look.

@Pheotis
Copy link
Author

Pheotis commented Sep 5, 2019

Thank you for looking in to it; sorry for my late response.

After two tests, I have concluded that this issue occurs exclusively in instances where one of the servers connected to the proxy (and/or the db?) is running a seriously outdated version (in this case, paper 443 (1.8.8)).

If it is possible to fix backwards compatibility for paper 443 (1.8.8), that would also be much appreciated -- I know that it is an absolutely terrible idea in general to use 1.8 versions but for my particular project, I have a relatively strong reason to use it for a singular instance).

Test 1
For the first test, I disabled all other servers connected to the proxy -- which represented all servers connected to 2fa+'s db -- and tested a single instance running 2fa+ 2.4.17 on paper 645 (1.13.2). During this test, I had no difficulties connecting to Mojang's API.

Note that I was still was unable to register new totp players using the plugin due to issue #5 .

Test 2
For the next test, I disabled all other servers connected to the proxy -- which represented all servers connected to 2fa+'s db -- and tested a single instance running 2fa+ 2.4.17 on paper 443 (1.8.8).
During this test, I received the error regarding connections to Mojang's db.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants