Code Monkey home page Code Monkey logo

ondemandminecraft's People

Contributors

ainskeep avatar justastamosiunas avatar mwessman avatar trevor-laher avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ondemandminecraft's Issues

boto3 error when running createInstance.py

When I run createInstance.py, I'm running into this error in the request:

    SecurityGroupIds = Config.groupId)
  File "/home/anthony/.local/lib/python2.7/site-packages/boto3/resources/factory.py", line 520, in do_action
    response = action(self, *args, **kwargs)
  File "/home/anthony/.local/lib/python2.7/site-packages/boto3/resources/action.py", line 83, in __call__
    response = getattr(parent.meta.client, operation_name)(**params)
  File "/home/anthony/.local/lib/python2.7/site-packages/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/home/anthony/.local/lib/python2.7/site-packages/botocore/client.py", line 661, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (InvalidParameterValue) when calling the RunInstances operation: Value () for parameter groupId is invalid. The value cannot be empty 

my config is setup like this:

    #AWS Information
    ACCESS_KEY = '***************'
    SECRET_KEY = '***************'
    INSTANCE_ID = ''
    ec2_region = "us-east-1"
    ec2_amis = ['ami-0cfee17793b08a293']
    ec2_keypair = 'arotiroti'
    ec2_secgroups = ['minecraft']
    ec2_instancetype = 't3.micro'

    #SSH Key Path
    SSH_KEY_FILE_PATH = './arotiroti.pem'

    #Server Memory Size
    #This is default to no memory specification but can be: '-Xmx1024M -Xms1024M ' (KEEP TRAILING SPACE)
    MEMORY_ALLOCATION=''

I tried passing a security group ID through the SecurityGroupIds argument in the client.createInstances call, but got the same error.

EC2 Instance Not Shutting Down

Hey!
So I followed the readMe and setup everything. The server itself is running fine, but the autoshutdown feature is not working.

The way I have been testing auto shutdown is:

  • I start the server via the Heroku site
  • I then wait about 30-1 hour while not connecting to the server on MC
  • The EC2 is still running after an hour when no one joins.

Could this be an issue with no one joining the server? Have not tested that use case yet.

Edit does the colon at the end matter?
image

I also ran sudo crontab /home/ubuntu/crontab -u ubuntu via the web based ssh, I believe it ran successfully but no message return in the terminal

gunicorn worker failed to boot

Here the traceback

2019-06-30T19:27:21.564341+00:00 app[web.1]: During handling of the above exception, another exception occurred:
2019-06-30T19:27:21.564342+00:00 app[web.1]:
2019-06-30T19:27:21.564345+00:00 app[web.1]: Traceback (most recent call last):
2019-06-30T19:27:21.564352+00:00 app[web.1]: File "/app/.heroku/python/bin/gunicorn", line 11, in <module>
2019-06-30T19:27:21.564449+00:00 app[web.1]: sys.exit(run())
2019-06-30T19:27:21.564452+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 61, in run
2019-06-30T19:27:21.564632+00:00 app[web.1]: WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
2019-06-30T19:27:21.564636+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/base.py", line 223, in run
2019-06-30T19:27:21.564786+00:00 app[web.1]: super(Application, self).run()
2019-06-30T19:27:21.564790+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/base.py", line 72, in run
2019-06-30T19:27:21.564918+00:00 app[web.1]: Arbiter(self).run()
2019-06-30T19:27:21.564925+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 232, in run
2019-06-30T19:27:21.565110+00:00 app[web.1]: self.halt(reason=inst.reason, exit_status=inst.exit_status)
2019-06-30T19:27:21.565113+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 345, in halt
2019-06-30T19:27:21.565293+00:00 app[web.1]: self.stop()
2019-06-30T19:27:21.565297+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 393, in stop
2019-06-30T19:27:21.565540+00:00 app[web.1]: time.sleep(0.1)
2019-06-30T19:27:21.565547+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 245, in handle_chld
2019-06-30T19:27:21.565816+00:00 app[web.1]: self.reap_workers()
2019-06-30T19:27:21.565823+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 525, in reap_workers
2019-06-30T19:27:21.566277+00:00 app[web.1]: raise HaltServer(reason, self.WORKER_BOOT_ERROR)
2019-06-30T19:27:21.566292+00:00 app[web.1]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
2019-06-30T19:27:21.685142+00:00 heroku[web.1]: State changed from up to crashed
2019-06-30T19:27:21.664448+00:00 heroku[web.1]: Process exited with status 1

I solved this by changing the gunicorn version to 0.18 in requirements

createInstance can't find configuration

The reference to configuration.py (which is in the root directory) in createInstance (which is in the utilityScripts directory) is not correct so it can not find it.

Failed building wheel for cryptography

Console output:

Building wheel for cryptography (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:\python38\python.exe' 'c:\python38\lib\site-packages\pip\_vendor\pep517\_in_process.py' build_wheel 'C:\Users\Matts\AppData\Local\Temp\tmpt5haf3i6'
       cwd: C:\Users\Matts\AppData\Local\Temp\pip-install-1mq79xyt\cryptography
  Complete output (122 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.8
  creating build\lib.win-amd64-3.8\cryptography
  copying src\cryptography\exceptions.py -> build\lib.win-amd64-3.8\cryptography
  copying src\cryptography\fernet.py -> build\lib.win-amd64-3.8\cryptography
  copying src\cryptography\utils.py -> build\lib.win-amd64-3.8\cryptography
  copying src\cryptography\__about__.py -> build\lib.win-amd64-3.8\cryptography
  copying src\cryptography\__init__.py -> build\lib.win-amd64-3.8\cryptography
  creating build\lib.win-amd64-3.8\cryptography\hazmat
  copying src\cryptography\hazmat\_oid.py -> build\lib.win-amd64-3.8\cryptography\hazmat
  copying src\cryptography\hazmat\__init__.py -> build\lib.win-amd64-3.8\cryptography\hazmat
  creating build\lib.win-amd64-3.8\cryptography\x509
  copying src\cryptography\x509\base.py -> build\lib.win-amd64-3.8\cryptography\x509
  copying src\cryptography\x509\certificate_transparency.py -> build\lib.win-amd64-3.8\cryptography\x509
  copying src\cryptography\x509\extensions.py -> build\lib.win-amd64-3.8\cryptography\x509
  copying src\cryptography\x509\general_name.py -> build\lib.win-amd64-3.8\cryptography\x509
  copying src\cryptography\x509\name.py -> build\lib.win-amd64-3.8\cryptography\x509
  copying src\cryptography\x509\ocsp.py -> build\lib.win-amd64-3.8\cryptography\x509
  copying src\cryptography\x509\oid.py -> build\lib.win-amd64-3.8\cryptography\x509
  copying src\cryptography\x509\__init__.py -> build\lib.win-amd64-3.8\cryptography\x509
  creating build\lib.win-amd64-3.8\cryptography\hazmat\backends
  copying src\cryptography\hazmat\backends\interfaces.py -> build\lib.win-amd64-3.8\cryptography\hazmat\backends
  copying src\cryptography\hazmat\backends\__init__.py -> build\lib.win-amd64-3.8\cryptography\hazmat\backends
  creating build\lib.win-amd64-3.8\cryptography\hazmat\bindings
  copying src\cryptography\hazmat\bindings\__init__.py -> build\lib.win-amd64-3.8\cryptography\hazmat\bindings
  creating build\lib.win-amd64-3.8\cryptography\hazmat\primitives
  copying src\cryptography\hazmat\primitives\cmac.py -> build\lib.win-amd64-3.8\cryptography\hazmat\primitives
  copying src\cryptography\hazmat\primitives\constant_time.py -> build\lib.win-amd64-3.8\cryptography\hazmat\primitives
  copying src\cryptography\hazmat\primitives\hashes.py -> build\lib.win-amd64-3.8\cryptography\hazmat\primitives
  copying src\cryptography\hazmat\primitives\hmac.py -> build\lib.win-amd64-3.8\cryptography\hazmat\primitives
  copying src\cryptography\hazmat\primitives\keywrap.py -> build\lib.win-amd64-3.8\cryptography\hazmat\primitives
  copying src\cryptography\hazmat\primitives\mac.py -> build\lib.win-amd64-3.8\cryptography\hazmat\primitives
  copying src\cryptography\hazmat\primitives\padding.py -> build\lib.win-amd64-3.8\cryptography\hazmat\primitives
  copying src\cryptography\hazmat\primitives\__init__.py -> build\lib.win-amd64-3.8\cryptography\hazmat\primitives
  creating build\lib.win-amd64-3.8\cryptography\hazmat\backends\openssl
  copying src\cryptography\hazmat\backends\openssl\aead.py -> build\lib.win-amd64-3.8\cryptography\hazmat\backends\openssl
  copying src\cryptography\hazmat\backends\openssl\backend.py -> build\lib.win-amd64-3.8\cryptography\hazmat\backends\openssl
  copying src\cryptography\hazmat\backends\openssl\ciphers.py -> build\lib.win-amd64-3.8\cryptography\hazmat\backends\openssl
  copying src\cryptography\hazmat\backends\openssl\cmac.py -> build\lib.win-amd64-3.8\cryptography\hazmat\backends\openssl
  copying src\cryptography\hazmat\backends\openssl\decode_asn1.py -> build\lib.win-amd64-3.8\cryptography\hazmat\backends\openssl
  copying src\cryptography\hazmat\backends\openssl\dh.py -> build\lib.win-amd64-3.8\cryptography\hazmat\backends\openssl
  copying src\cryptography\hazmat\backends\openssl\dsa.py -> build\lib.win-amd64-3.8\cryptography\hazmat\backends\openssl
  copying src\cryptography\hazmat\backends\openssl\ec.py -> build\lib.win-amd64-3.8\cryptography\hazmat\backends\openssl
  copying src\cryptography\hazmat\backends\openssl\ed25519.py -> build\lib.win-amd64-3.8\cryptography\hazmat\backends\openssl
  copying src\cryptography\hazmat\backends\openssl\ed448.py -> build\lib.win-amd64-3.8\cryptography\hazmat\backends\openssl
  copying src\cryptography\hazmat\backends\openssl\encode_asn1.py -> build\lib.win-amd64-3.8\cryptography\hazmat\backends\openssl
  copying src\cryptography\hazmat\backends\openssl\hashes.py -> build\lib.win-amd64-3.8\cryptography\hazmat\backends\openssl
  copying src\cryptography\hazmat\backends\openssl\hmac.py -> build\lib.win-amd64-3.8\cryptography\hazmat\backends\openssl
  copying src\cryptography\hazmat\backends\openssl\ocsp.py -> build\lib.win-amd64-3.8\cryptography\hazmat\backends\openssl
  copying src\cryptography\hazmat\backends\openssl\rsa.py -> build\lib.win-amd64-3.8\cryptography\hazmat\backends\openssl
  copying src\cryptography\hazmat\backends\openssl\utils.py -> build\lib.win-amd64-3.8\cryptography\hazmat\backends\openssl
  copying src\cryptography\hazmat\backends\openssl\x25519.py -> build\lib.win-amd64-3.8\cryptography\hazmat\backends\openssl
  copying src\cryptography\hazmat\backends\openssl\x448.py -> build\lib.win-amd64-3.8\cryptography\hazmat\backends\openssl
  copying src\cryptography\hazmat\backends\openssl\x509.py -> build\lib.win-amd64-3.8\cryptography\hazmat\backends\openssl
  copying src\cryptography\hazmat\backends\openssl\__init__.py -> build\lib.win-amd64-3.8\cryptography\hazmat\backends\openssl
  creating build\lib.win-amd64-3.8\cryptography\hazmat\bindings\openssl
  copying src\cryptography\hazmat\bindings\openssl\binding.py -> build\lib.win-amd64-3.8\cryptography\hazmat\bindings\openssl
  copying src\cryptography\hazmat\bindings\openssl\_conditional.py -> build\lib.win-amd64-3.8\cryptography\hazmat\bindings\openssl
  copying src\cryptography\hazmat\bindings\openssl\__init__.py -> build\lib.win-amd64-3.8\cryptography\hazmat\bindings\openssl
  creating build\lib.win-amd64-3.8\cryptography\hazmat\primitives\asymmetric
  copying src\cryptography\hazmat\primitives\asymmetric\dh.py -> build\lib.win-amd64-3.8\cryptography\hazmat\primitives\asymmetric
  copying src\cryptography\hazmat\primitives\asymmetric\dsa.py -> build\lib.win-amd64-3.8\cryptography\hazmat\primitives\asymmetric
  copying src\cryptography\hazmat\primitives\asymmetric\ec.py -> build\lib.win-amd64-3.8\cryptography\hazmat\primitives\asymmetric
  copying src\cryptography\hazmat\primitives\asymmetric\ed25519.py -> build\lib.win-amd64-3.8\cryptography\hazmat\primitives\asymmetric
  copying src\cryptography\hazmat\primitives\asymmetric\ed448.py -> build\lib.win-amd64-3.8\cryptography\hazmat\primitives\asymmetric
  copying src\cryptography\hazmat\primitives\asymmetric\padding.py -> build\lib.win-amd64-3.8\cryptography\hazmat\primitives\asymmetric
  copying src\cryptography\hazmat\primitives\asymmetric\rsa.py -> build\lib.win-amd64-3.8\cryptography\hazmat\primitives\asymmetric
  copying src\cryptography\hazmat\primitives\asymmetric\utils.py -> build\lib.win-amd64-3.8\cryptography\hazmat\primitives\asymmetric
  copying src\cryptography\hazmat\primitives\asymmetric\x25519.py -> build\lib.win-amd64-3.8\cryptography\hazmat\primitives\asymmetric
  copying src\cryptography\hazmat\primitives\asymmetric\x448.py -> build\lib.win-amd64-3.8\cryptography\hazmat\primitives\asymmetric
  copying src\cryptography\hazmat\primitives\asymmetric\__init__.py -> build\lib.win-amd64-3.8\cryptography\hazmat\primitives\asymmetric
  creating build\lib.win-amd64-3.8\cryptography\hazmat\primitives\ciphers
  copying src\cryptography\hazmat\primitives\ciphers\aead.py -> build\lib.win-amd64-3.8\cryptography\hazmat\primitives\ciphers
  copying src\cryptography\hazmat\primitives\ciphers\algorithms.py -> build\lib.win-amd64-3.8\cryptography\hazmat\primitives\ciphers
  copying src\cryptography\hazmat\primitives\ciphers\base.py -> build\lib.win-amd64-3.8\cryptography\hazmat\primitives\ciphers
  copying src\cryptography\hazmat\primitives\ciphers\modes.py -> build\lib.win-amd64-3.8\cryptography\hazmat\primitives\ciphers
  copying src\cryptography\hazmat\primitives\ciphers\__init__.py -> build\lib.win-amd64-3.8\cryptography\hazmat\primitives\ciphers
  creating build\lib.win-amd64-3.8\cryptography\hazmat\primitives\kdf
  copying src\cryptography\hazmat\primitives\kdf\concatkdf.py -> build\lib.win-amd64-3.8\cryptography\hazmat\primitives\kdf
  copying src\cryptography\hazmat\primitives\kdf\hkdf.py -> build\lib.win-amd64-3.8\cryptography\hazmat\primitives\kdf
  copying src\cryptography\hazmat\primitives\kdf\kbkdf.py -> build\lib.win-amd64-3.8\cryptography\hazmat\primitives\kdf
  copying src\cryptography\hazmat\primitives\kdf\pbkdf2.py -> build\lib.win-amd64-3.8\cryptography\hazmat\primitives\kdf
  copying src\cryptography\hazmat\primitives\kdf\scrypt.py -> build\lib.win-amd64-3.8\cryptography\hazmat\primitives\kdf
  copying src\cryptography\hazmat\primitives\kdf\x963kdf.py -> build\lib.win-amd64-3.8\cryptography\hazmat\primitives\kdf
  copying src\cryptography\hazmat\primitives\kdf\__init__.py -> build\lib.win-amd64-3.8\cryptography\hazmat\primitives\kdf
  creating build\lib.win-amd64-3.8\cryptography\hazmat\primitives\serialization
  copying src\cryptography\hazmat\primitives\serialization\base.py -> build\lib.win-amd64-3.8\cryptography\hazmat\primitives\serialization
  copying src\cryptography\hazmat\primitives\serialization\pkcs12.py -> build\lib.win-amd64-3.8\cryptography\hazmat\primitives\serialization
  copying src\cryptography\hazmat\primitives\serialization\ssh.py -> build\lib.win-amd64-3.8\cryptography\hazmat\primitives\serialization
  copying src\cryptography\hazmat\primitives\serialization\__init__.py -> build\lib.win-amd64-3.8\cryptography\hazmat\primitives\serialization
  creating build\lib.win-amd64-3.8\cryptography\hazmat\primitives\twofactor
  copying src\cryptography\hazmat\primitives\twofactor\hotp.py -> build\lib.win-amd64-3.8\cryptography\hazmat\primitives\twofactor
  copying src\cryptography\hazmat\primitives\twofactor\totp.py -> build\lib.win-amd64-3.8\cryptography\hazmat\primitives\twofactor
  copying src\cryptography\hazmat\primitives\twofactor\utils.py -> build\lib.win-amd64-3.8\cryptography\hazmat\primitives\twofactor
  copying src\cryptography\hazmat\primitives\twofactor\__init__.py -> build\lib.win-amd64-3.8\cryptography\hazmat\primitives\twofactor
  running egg_info
  writing src\cryptography.egg-info\PKG-INFO
  writing dependency_links to src\cryptography.egg-info\dependency_links.txt
  writing requirements to src\cryptography.egg-info\requires.txt
  writing top-level names to src\cryptography.egg-info\top_level.txt
  reading manifest file 'src\cryptography.egg-info\SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  no previously-included directories found matching 'docs\_build'
  warning: no previously-included files matching '*' found under directory 'vectors'
  writing manifest file 'src\cryptography.egg-info\SOURCES.txt'
  running build_ext
  generating cffi module 'build\\temp.win-amd64-3.8\\Release\\_padding.c'
  creating build\temp.win-amd64-3.8
  creating build\temp.win-amd64-3.8\Release
  generating cffi module 'build\\temp.win-amd64-3.8\\Release\\_constant_time.c'
  generating cffi module 'build\\temp.win-amd64-3.8\\Release\\_openssl.c'
  building '_openssl' extension
  creating build\temp.win-amd64-3.8\Release\build
  creating build\temp.win-amd64-3.8\Release\build\temp.win-amd64-3.8
  creating build\temp.win-amd64-3.8\Release\build\temp.win-amd64-3.8\Release
  C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\python38\include -Ic:\python38\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" /Tcbuild\temp.win-amd64-3.8\Release\_openssl.c /Fobuild\temp.win-amd64-3.8\Release\build\temp.win-amd64-3.8\Release\_openssl.obj
  _openssl.c
  build\temp.win-amd64-3.8\Release\_openssl.c(546): fatal error C1083: Cannot open include file: 'openssl/opensslv.h': No such file or directory
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
  ----------------------------------------
  ERROR: Failed building wheel for cryptography
Failed to build cryptography
ERROR: Could not build wheels for cryptography which use PEP 517 and cannot be installed directly

autoshutdown.sh no longer works as of the Minecraft 1.16 snapshot releases

autoshutdown.sh no longer works with the Minecraft 1.16 snapshots because of a change in wording for the amount of players online. Previously, it was written as " There are X of a max X players online" and now it is written as " There are X of a max of X players online".

The fix is simple enough. You just have to edit line 4 in autoshutdown from:
PLAYERSEMPTY=" There are 0 of a max 20 players online"
to
PLAYERSEMPTY=" There are 0 of a max of 20 players online"

However, not sure how it wants to be handled for backwards compatibility with servers older than 1.16.

EC2 Instance timing out

Hey,

I successfully set this up and I can't get it to connect successfully. It says the instance is running, but it times out and if I do connect, everything is really slow. I am using t3-small

createInstance.py does not create the instance with no solution

I followed the readme to the point of where we need to run this script. However, when using the configuration file that is sent out, but firstly, we cannot use the parameter SecurityGroups as then it complains that the parameter GroupId cannot be empty.

Once I found that the we need to use SecurityGroupIds, and pass in the group Id i created, it complains that the GroupId does not exist in the VPC. Whatever.

I found the API for boto.create_instances and here they don't even use this, so I remove it. Then it complains the key pair 'minecraft' doesn't exist.

None of this is making any sense.

class Config:
    #AWS Information
    ACCESS_KEY = 'KEY'
    SECRET_KEY = 'KEY'
    INSTANCE_ID = ''
    ec2_region = "us-east-1"
    ec2_amis = ['ami-0bfb5f753b6c2d30b']
    ec2_keypair = 'minecraft'
    ec2_secgroups = ['minecraft']
    ec2_secgroupIds = ['sg-088271948d27773c1']
    ec2_instancetype = 't3.small'

    #SSH Key Path
    SSH_KEY_FILE_PATH = './minecraft.pem'

    #Server Memory Size
    #This is default to no memory specification but can be: '-Xmx1024M -Xms1024M ' (KEEP TRAILING SPACE)
    MEMORY_ALLOCATION='-Xmx1024M -Xms1024M ' 

Key pairs
image

Security Groups
image

Instance not stopping

autoshutdown.sh is not stopping my aws instance. Any ideas about how can i troubleshoot this problem?

upgraded server.jar - server wont launch on boot

Hello,

I just upgraded the minecraft server.jar to 1.15.1 and on reboot/clean-boot server.jar is not running. I think it could be a permissions issue - can you confirm the correct permissions for server.jar?

I used wget as ubuntu to download server.jar and mv to overwrite the existing server.jar. Ownership was then ubuntu:ubuntu. Rebooted to no avail. Chown to root:root like other files in~/., rebooted to no avail, chmod +x to server.jar (prob not necessary), reboot to no avail.

From the server.py I can the heroku app is sshing in and starting server.ar with sudo java -jar server.jar nogui (with mem args). Calling 'sudo java -jar server.jar nogui' from the cmd line the server starts correctly and I can then connect from minecraft on my laptop. I see that in server.py if prints error info on in the heroku logs I can see COMMAND EXECUTED. Minecraft was launching previous to this as I logged out of the old from the older server.jar immediately before trying to upgrade.

error when running createInstance.py

I am going to be honest, I don't think that I have spun up an ec2 instance on my personal AWS account since they started pushing ec2 instances into VPCs by default. So this is most likely a me issue.

When i run the createInstance.py script i end up running into an error from boto3:

$ python utilityScripts/createInstance.py
Traceback (most recent call last):
  File "utilityScripts/createInstance.py", line 21, in <module>
    SecurityGroups = Config.ec2_secgroups)
  File "/usr/local/lib/python2.7/site-packages/boto3/resources/factory.py", line 520, in do_action
    response = action(self, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/boto3/resources/action.py", line 83, in __call__
    response = getattr(parent.meta.client, operation_name)(**params)
  File "/usr/local/lib/python2.7/site-packages/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/usr/local/lib/python2.7/site-packages/botocore/client.py", line 661, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (VPCResourceNotSpecified) when calling the RunInstances operation: The specified instance type can only be used in a VPC. A subnet ID or network interface ID is required to carry out the request.

Config is as follows:

class Config:
    #AWS Information
    ACCESS_KEY = 'XXXXXXXX'
    SECRET_KEY = 'SOMEMOREXXXXs'
    INSTANCE_ID = ''
    ec2_region = "us-east-1"
    ec2_amis = ['ami-0b2f2d7c5173e3a44']
    ec2_keypair = 'minecraft'
    ec2_secgroups = ['minecraft']
    ec2_instancetype = 't3.small'

    #SSH Key Path
    SSH_KEY_FILE_PATH = './minecraft_ec2.pem'

    #Server Memory Size
    #This is default to no memory specification but can be: '-Xmx1024M -Xms1024M ' (KEEP TRAILING SPACE)
    MEMORY_ALLOCATION=''

    # heroku server password
    SERVER_PASSWORD='SUPERSECRET'

I tried a new different models from other ec2 instance types with the same results which led me to ec2-classic vs VPC as being the likely culprit. When i tried to spin up an ec2 instance in the AWS console I couldn't select ec2-classic, even though my account had the relevant account attributes:

Screen Shot 2019-07-04 at 12 53 57 PM

I am going to dig into the aws ec2-classic vs VPC and bota3 docs later when my kids aren't begging me to play minecraft with them :) I will update this issue with anything i turn up: default VPC/subnet settings, ec2-classic config etc.

In the mean time if anyone has already run through this ... please let me know :)

Website crash on startup: Exception in worker process

I'm building / installing from an Ubuntu 18.04 instance in AWS. After deploying the Heroku site, I get an application error at the site page. I have attached Heroku logs of the error.

I have deployed Minecraft to a non-default VPC, so I had to set the SG and Subnet IDs in the configuration.py.

Heroku Error.txt

autoshutdown.sh bad interpreter

File transfered by filezilla from Windows

bash: ./autoshutdown.sh: /bin/sh^M: bad interpreter: No such file or directory

From StackOverflow

I've run sed -i -e 's/\r$//' autoshutdown.sh and that worked

Missing SERVER_PASSWORD Variable

Is says that:

_In configuration.py of the root directory, set the SERVER_PASSWORD variable to the password of your choosing.

SERVER_PASSWORD='YourPasswordHere'_

but I dont see this variable in the configuration.py, any advice? creating my own variable doesn't work for me either

Console, server not running?

Hi,
I apologize, I'm a little new to this. I followed the instructions on the readme, but when I try to connect to the server on my client, I don't see a connection. Is there any way to see the console as the server starts up to make sure it is working properly?
Thanks!
Scott

EDIT: I found an error log, looks like an out of memory error? Still would be useful to see the console.

Heroku

After doing the "git push heroku master" step

I check on my heroku site and nothing shows up. Checked the heroku logs and I'm seeing the below error.


2020-04-14T03:45:23.289789+00:00 app[web.1]: data = self._read_private_key_file("RSA", filename, password)
2020-04-14T03:45:23.289790+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/paramiko/pkey.py", line 278, in _read_private_key_file
2020-04-14T03:45:23.289790+00:00 app[web.1]: with open(filename, "r") as f:
2020-04-14T03:45:23.289863+00:00 app[web.1]: FileNotFoundError: [Errno 2] No such file or directory: '/app/minecraftserver.pem'

so obviously its unable to find my pem file, but ive put it right in the root folder, next to .git and server.py and configuration.py

in my configuration.py i tried with the following names.

SSH_KEY_FILE_PATH = 'minecraftserver.pem'

SSH_KEY_FILE_PATH = './minecraftserver.pem'

the only thing that changes is i get this error instead.

FileNotFoundError: [Errno 2] No such file or directory: '/app/./minecraftserver.pem'

Thank you to anyone that helps!

Log improvements

The log output could use improvements to make monitoring the webapp easier:

  • Printing out all the instance information every time displays a lot of information not pertinent when debugging
  • It would be nice to be able to see failed password attempts. Someone somewhere is eventually going to try to brute force the server password, and while this isn't a big deal, it's nice to have records.
  • Printing is buffered by default (at least when running locally via heroku local), so we need to flush the output to see the logs (either at all, or in the correct order).

Necessity of SSH from Heroku App

Is there a reason why we don't configure the Minecraft server to boot up on instance start?

It seems there is unnecessary complexity (and security risk) with having our Heroku application SSH in and start the server.

Heroku Config and CloudFormation

This is backing off of #3

Is there still interest in moving to a CloudFormation template for infrastructure?

Additionally, I think it may make more sense (and be a bit safer) to store configuration data in Heroku Config instead of a static file. I've implemented both of these and am happy to make a PR, but it is drastically different.

ReadMe: incorrect reference

In the ReadMe under step 7 of the AWS Setup there is an error. It mentions that you need to open a command line in the utilityScripts directory but actually you need to open the command line in the root directory.

Group ID error

Hi,

I am getting the following error:

botocore.exceptions.ClientError: An error occurred (InvalidParameterValue) when calling the RunInstances operation: Value () for parameter groupId is invalid. The value cannot be empty

I don't see anywhere that a groupId is specified. Any idea where this is going sideways?

/static/js/serverStart.js missing

Hello,

Just got everything setup and it works well! One thing I notice is the server didn't start up once the instance was up. I found that serverStart.js is missing from your repo.

Is that correct or am I missing something?

Cloudformation Automation

I like this idea, but I feel like the deployment process could be vastly simplified and be made more secure by using a Cloudformation template to take care of the majority of deployment:

The deployment steps would change to:

  • Create an SSH keypair.
  • Create a Cloudformation stack, select AMI / Instance Type / Keypair

The Cloudformation stack will:

  • Create an IAM role.
  • Set up the security group.
  • Create the EC2 instance in the current region.
  • Download an install script from this git repo (downloaded by EC2 launch script)

The launch script will:

  • Clone this repository.
  • Create the 'ubuntu' user.
  • Install openjdk
  • Download the latest Minecraft server .jar
  • Configure crontab, permissions etc.

The instance will use the IAM role to authenticate with Boto3 instead of hard coding your AWS credentials.

Thoughts?

crontab doesn't work: Not a regular file

when executing:

ubuntu@ip-172-31-11-59:~$ sudo crontab /home/ubuntu/crontab -u ubuntu
/home/ubuntu/crontab: Not a regular file.

how should I add the crontab?

ubuntu version: 18.04 LTS

IAM's

What policies would I need to use IAM's instead of the root access key?

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.