Skip to content

Bugfix/update download bedrock url

What does this MR do and why?

This commit updates the URLs used to download bedrock server. This MR is in relation to issue 488. I was unable to update my bedrock server and found that the system stalled and no errors were sent to the front end. As far as I can tell the previous download URLs associated with minecraft.azureedge.net are no longer valid. This also creates an issue with creating new bedrock servers.

I updated those hosts to www.minecraft.net/bedrockdedicatedserver and tested the new values. Adding a new bedrock server is working again in my dev environment.

Worth mentioning is that while fixing this I noticed that the logical branching for the update and create server is not exhaustive. In the Helpers.get_latest_bedrock_url method exceptions are logged, but no exception is re-raised. This means that the exception is essentially ignored after the log message and upstream code does not handle this exception. This causes the front-end to hang indefinitely with no update to the end user that something has failed. I chose not to fix this issue because there may be a perfectly good reason that this pattern is used and I am not acclimated to the codebase enough to suggest changes in exception handling as those can be quite unpredictable. If the maintainers would like, I can add those changes in.

Screenshots or screen recordings

The only useful screen shot would be the logged exception and I think simply pasting the error that was corrected is more helpful.

Exception in thread exe_update_Derpwood:
Traceback (most recent call last):
  File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.10/threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "/crafty/app/classes/shared/server.py", line 1494, in threaded_jar_update
    if downloaded:
UnboundLocalError: local variable 'downloaded' referenced before assignment

How to set up and validate locally

  1. Check out dev branch and start the server.
  2. Log in and Attempt to create a new bedrock server.
  3. Observe that the process hangs and never completes the task of installing the server.
  4. In some cases you can verify this by refreshing the page and trying to start the server. It will tell you that it cannot find the executable.
  5. Check out the bugfix/update-download-bedrock-url branch and restart the server.
  6. Attempt to create a different bedrock server.
  7. The create operation should complete and the server will start.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

  • Have you checked this doesn't interfere/conflict/duplicate someone elses work?
  • Have you fully tested your changes?
  • Have you resolved any lint issues?
  • Have you assigned a reviewer?
  • Have you applied correct labels?
Edited by Iain Powrie

Merge request reports

Loading