How Do You Troubleshoot the Ansible Error ‘”hadoop_env” is undefined’?

Problem scenario
You try to run a playbook. But you get a message like this: ‘fatal: … “AnsibleUndefinedVariable” ‘hadoop_env’ is undefined’. What should you do?

Root cause: a variable you defined (e.g., in a playbook or role) is not getting assigned when you run the playbook.

Possible solution #1
Find the vars directory or create it.

How Do You Use the AWS CLI to View the Targets of Routes in Route Tables in a VPC?

Problem scenario
You have a VPC with route tables. You want to search the targets to find a given value. What should you do?

Solution
As of early 2020, the output of aws describe-route-tables –filters –route-table-id abcd1234 –region us-west-2 will not include the word “target”. The value of the target in the JSON output will be the ID of the given target. Targets can be Egress Only Internet Gateway,

How Do You Find the Make and Model of Your Laptop or Desktop Computer Running Windows?

Problem scenario
You are running Windows on your desktop or laptop. You want to find the make and model of the hardware. What do you do?

Solution

  1. Hold the Windows key down and tap the “r” key.
  2. In the command prompt type this: msinfo32
  3. Press enter.
  4. The hardware make will be found under the “System Summary” section in “System Summary”.

How Do You Troubleshoot the Errors “Expecting ‘,’ delimiter: line …column” or “No JSON object could be decoded”?

Problem scenario
You are trying to run a command that consumes a JSON file. You get an error such as “Expecting ‘,’ delimiter: line …column” or “No JSON object could be decoded”. What do you do?

Possible Solution #1
You may have an extra closing brace that you need to eliminate.

Possible Solution #2
Use https://jsonlint.com

How Do You Use a Python Function Decorator?

Problem scenario
You want to use a Python function decorator. What do you do?

Solution
Background: “A decorator in Python is a function that takes another function as its argument, and returns yet another function.” (According to this source.)

Procedures
Run this program:

def enhanced_multiply(paramfunc):
def contint(c,d):
print(“I am going to multiply”,c,”and”,d)
return paramfunc(c,d)
return contint # Here is where contint is elegantly & …

How Do You Install Apache Flink on Any Type of Linux?

Problem scenario
You want a script to install Apache Flink on any type of Linux (including CentOS/RHEL/Fedora, Debian/Ubuntu and SUSE). What should you do?

Solution
Prerequisites
When using Ubuntu/Debian or SUSE servers, 1 GB of RAM is sufficient. For CentOS/RHEL/Fedora, we recommend either more RAM or use virtual memory. To find a script that will create swap space,

How Do You Troubleshoot the Error “ModuleNotFoundError: No module named ‘flask'”?

Problem scenario
You are running a Python program or running a command from the Python 3 interpreter. You get this error:

Traceback (most recent call last):
File “”, line 1, in
ModuleNotFoundError: No module named ‘flask’

What should you do to use Flask with Python 3?

Solution
Prerequisite
You need to have pip3 installed.

How Do You Troubleshoot “/bin/python3.6: bad interpreter: No such file or directory”?

Problem scenario
You are trying to run a pip command. But you get “/bin/python3.7: bad interpreter: Permission denied”. What should you do about these “bad interpreter” errors in response to having run pip commands?

Solution
Use “sudo” before the pip command. It should allow you to run the pip command. You may need to be a different user or obtain sudoer rights. If you need assistance with obtaining sudoer rights,

How Do You Troubleshoot the Java Compilation Error “cannot find symbol”?

Problem scenario
You try to compile a Java program with a javac command. You get this error:

special.java:39: error: cannot find symbol
symbol: class foo
location: class bar

What should you do?

Possible solution
In some cases you need a keyword “new”, but in other cases you need to not have the keyword “new”.

Are you using the word “new” to the right of an equals sign “=”?