How Do You Get Presto to Start when Errors about Presto requiring an Oracle or OpenJDK JVM?

Problem scenario
Presto will not run because of an error about the JVM.

You get a message like this:
“Java version has an unknown format: 15” (from “C” below)
“Presto requires an Oracle or OpenJDK JVM (found Ubuntu)” (associated with the Java version shown in B or D below)
“Presto requires an Oracle or OpenJDK JVM (found Private Build)” (associated with the Java version in E below)
“Presto requires an Oracle or OpenJDK JVM (found IcedTea)” (associated with the Java version shown in F below)

Solution
For detailed background information,

How Do You Create Nodes for EKS That Are Accessible to Log in?

Problem scenario
You want to create EC-2 instances (nodes) for Kubernetes in AWS using EKS. You want to be able to connect to them or log into them for the sake of troubleshooting. You want to configure the Kubernetes nodes to use a .pem or .ppk file for SSHing into them. You analyzed the create node group documentation on the internet, but found a vague reference to a –remote-access flag and a ec2Sshkey pointing to a string.

How Do You Know the Syntax of the JSON for the –policy-document Flag for Adding Policies to a Role in AWS?

One of the following scenarios apply:

Problem scenario #1
You want to run a command like this:
aws iam put-role-policy –role-name contintdelete-role –policy-name DELETEPOLICY –policy-document file://adminPolicy.json

But you do not know the syntax of the adminPolicy.json.

Problem scenario #2
You are trying to use the –policy-document flag with the command “aws iam put-role-policy”. But you get this error:

An error occurred (MalformedPolicyDocument) when calling the PutRolePolicy operation: Syntax errors in policy.

How Do You Troubleshoot the Python Error “NameError: name ” is not defined”?

Problem scenario
You are trying to run a Python program with a class. You get this message:

File “foobar.py”, line 11, in
class Building(param1, param2):
NameError: name ‘param1’ is not defined

What should you do?

Solution
Use the word “object” instead of one or more parameters that you are passing in the parentheses () of the class.

How Do You Use Ansible to Have Retrievable Double Quotes ‘”‘ in a Variable?

Problem scenario
You are using Ansible, and you want a playbook to have a variable with double quotes. The double quotes are disappearing from your echo var1.stdout[:] invocations. How do you get shell/bash commands to have double quotes?

Solution
Rather than “echo” a string with double quotes, use a variable assignment. Do not use this: echo “a \”long string\” for a \”test\” “

Use something like this: coolstring=”a \”long string\” for a \”test\” ” &&

How Do You Troubleshoot the Presto Error “‘PK\003\004’: command not found”?

Problem scenario
You try to start Presto from a command line interface. But you get an error message with garbled output like this:

./presto: line 1: $’PK\003\004′: command not found
./presto: line 2: $’ܢ\327H’: command not found
./presto: line 3: syntax error near unexpected token `)’
./presto: line 3: ۢ▒H▒▒W▒META-INF/MANIFEST.MF▒P▒j!▒▒▒?▒8▒▒ɸK)’

Possible solution #1
You may have downloaded a .jar file that could be unpacked.

How Do You Troubleshoot an Error Trying to Delete a VPC, Network Interface, or Subnet ID?

One (or more) of the following problems is applicable:

Problem scenario #1
You are trying to delete an network interface in AWS. But you get an error “You are not allowed to manage ‘ela-attach’ attachments.” What should you do?

Problem scenario #2
You are trying to delete a subnet from AWS’ VPC. But you get this error:

Note that the following subnets cannot be deleted: The following subnets contain one or more network interfaces, …

How Do You Troubleshoot the Message “/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:83:in `require’: cannot load such file — foobar (LoadError)”?

Problem scenario
You are running Vagrant, Ruby or a Ruby application, but you get this error: “/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:83:in `require’: cannot load such file — foobar (LoadError)”

What should you do?

Possible Solution #1
Try to run the original command with “sudo”. If that doesn’t work, use “gem list” to verify “foobar” is installed.

For Windows users, try to run the command or application as Administrator.

How Can You Use CloudTrail for the First Time in Your AWS Account?

Problem scenario
You want to log or monitor AWS activity (e.g., AWS Management Console, AWS CLI, and/or AWS SDK actions). You do not want encryption because you are just testing it out. How do you use CloudTrail to do this?

Solution

  1. Log into AWS.
  2. Go to this link: https://console.aws.amazon.com/cloudtrail/
  3. Click “Create a trail”
  4. Enter a descriptive name for your trail.