How Do You Troubleshoot the GCP BigQuery Error ‘Table name “foobar” missing dataset while no default dataset is set in the request’?

Problem scenario
You run a BigQuery query. But you get a pop-up message that says 'Table name "mockdata" missing dataset while no default dataset is set in the request.'

What should you do?

Solution
Did you specify a dataset (or database name) before foobar?

For example, if your dataset is called "cool", your BigQuery query should refer to "foobar" as "cool.foobar". Here is an example of a working query:

select * from cool.foobar;

How Do You Troubleshoot ‘Exception in thread “main” java.lang.NullPointerException org.apache.hadoop.mapreduce.tools.CLI.displayJobList’?

Problem scenario
When you run hadoop commands, you get an error like this:

Exception in thread "main" java.lang.NullPointerException
at org.apache.hadoop.mapreduce.tools.CLI.displayJobList(CLI.java:784)
at org.apache.hadoop.mapreduce.tools.CLI.displayJobList(CLI.java:769)
at org.apache.hadoop.mapreduce.tools.CLI.listAllJobs(CLI.java:697)
at org.apache.hadoop.mapreduce.tools.CLI.run(CLI.java:428)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:90)
at org.apache.hadoop.mapred.JobClient.main(JobClient.java:1277)

What should you do?

Solution
Find the mapred-site.xml file. Make sure it has these stanzas (within the configuration and /configuration tags):

<property>
  <name>mapreduce.framework.name</name>
  <value>yarn</value>
</property>

<property>
 <name>yarn.app.mapreduce.am.env</name>
 <value>HADOOP_MAPRED_HOME=$HADOOP_HOME</value>
</property>
<property>
 <name>mapreduce.map.env</name>
 <value>HADOOP_MAPRED_HOME=$HADOOP_HOME</value>
</property>
<property>
 <name>mapreduce.reduce.env</name>
 <value>HADOOP_MAPRED_HOME=$HADOOP_HOME</value>
</property>

Now try the hadoop command again.

What Does AI Stand For in addrinfo?

Problem scenario
You see several variables that start with "ai_". What does the "a" and "i" stand for?

Solution
The "a" stands for "address" and the "i" stands for "info".

The man page for getaddrinfo says "The getaddrinfo() function is defined for protocol-independent nodename-to-address translation." taken from http://www.nsc.ru/cgi-bin/www/unix_help/unix-man?getaddrinfo.

Therefore ai_flags, ai_family, ai_scoktype, ai_protocol, ai_addrlen, ai_canonname, ai_addr, ai_next, ai_numerichost, ai_passive are member values of the addrinfo struct.

This excerpt was taken from (http://www.nsc.ru/cgi-bin/www/unix_help/unix-man?getaddrinfo):

struct addrinfo {
	  int	  ai_flags;	/* AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST */
	  int	  ai_family;	/* PF_xxx */
	  int	  ai_socktype;	/* SOCK_xxx */
	  int	  ai_protocol;	/* 0 or IPPROTO_xxx for IPv4 and IPv6 */
	  size_t  ai_addrlen;	/* length of ai_addr */
	  char	 *ai_canonname; /* canonical name for nodename */
	  struct sockaddr  *ai_addr; /* binary address */
	  struct addrinfo  *ai_next;
};

Why Is There an Apparent Difference Between “docker run” and the Series of Two Commands “docker create” And “docker start”?

Problem scenario
When you run "docker run", the container has a port that is exposed and the web application works properly.  When you use "docker create" then "docker start", the service is not exposed properly. You believe that "docker run" the same as a series of two steps, first "docker create" then "docker start".  

Why does a Docker container started with a single "docker run" command work to expose it web service over a TCP port but not work when a "docker create" and "docker start" commands are serially issued?

Solution
"docker run" is the equivalent of two commands run in seriatim.  These commands are  "docker create" and then "docker start".  The "docker create" command needs an image ID parameter.  The "docker start" command needs a container ID parameter.

If you find a difference between "docker run" and the "docker create" with a subsequent "docker start" command, the difference is probably related to an option or flag.  Specifically you may be using a flag or option with the "docker run" command that you are not employing when you use the "docker create" command.  

If your "docker run" command had a "-P" flag in it, the "docker create" command should also have a "-P" flag.

Here is an example of a "docker run" command that would start a web service based on a properly created image:

docker run -d -P <image ID>

For creating a container, use this:

docker create -it -P <image ID>

You can then use "docker start" with the container created in the command above.  It should have the proper port mapping you were using with your "docker run" command.

In conclusion there should be no difference between using "docker run" or the combination of "docker create" and then "docker start".  An apparent difference is probably attributable to an optional flag that you used with "docker run" but not the other two.

Is It OK to Delete /lib64/libk5crypto.so.3 from a Linux Server?

Problem scenario
You want to rebuild libk5crypto.so.3. Can you delete this file?

Solution
No. Once you delete it, sudo commands will stop working. You will not be able to log into the server via SSH either if the file is moved from the /lib64/ directory.

To learn more about the file and an rpm package that provides it, go here: https://centos.pkgs.org/8/centos-baseos-x86_64/krb5-libs-1.17-18.el8.i686.rpm.html

How Do You Run a Bolt Command from a Linux Server to a Windows Server?

Problem scenario
You want to run a PowerShell script or run an interactive command on a Windows server. You have Puppet Bolt installed on a Linux server. You do not need to use SSL. What do you do?

Solution
Run a command like this (but substitute x.x.x.x with the IP address of the Windows server, jdoe with the username and coolpassword with jdoe's password):

bolt command run "Get-Process" --Targets winrm://x.x.x.x --no-ssl --user jdoe --password coolpassword

To run a script called "cool.ps1", create a Powershell script on your Linux server named cool.ps1. Then run this command:

bolt script run cool.ps1 --Targets winrm://x.x.x.x --no-ssl --user jdoe --password coolpassword

How Do You Troubleshoot Kubernetes when the Pods Are Not Working Correctly?

Problem scenario
You deployment Kubernetes. You used "kubectl create" to deploy some pods. Pods are not getting IP addresses and the status is Pending. What do you do?

Solution

  1. Run a command like this (but replace "foobar" with the namespace of the Kubernetes pods you are trying to troubleshoot):
kubectl get all -n foobar
  1. The above command should list relevant deployment names or pod names. Now you can construct this command (but replace "foobar" with the namespace name and "abcd1234" with the name of the pod or deployment):
kubectl -n foobar describe pod abcd1234

The above command's results should help. If you see "Warning FailedScheduling 34s (x5 over 6m18s) default-scheduler no nodes available to schedule pods", see this posting.

  1. Verify your nodes are healthy with this command: kubectl get nodes

How Do You Get a footer.php File to Have a Change Apply in WordPress?

Problem scenario
You clicked "Update file" after you made changes to a .php file in WordPress (via the Theme Editor). You have refreshed the web page, but the changes have not taken effect. What should you do?

Possible Solution #1
Can you update the theme? If the theme has an update waiting, getting it updated can fix this problem.

Possible Solution #2
Clear the history of your web browser.

Possible Solution #3
Wait for some time. The problem may go away.

How Do You Write a Palindrome Tester Function in Python?

Problem scenario
You want to write a palindrome tester function in Python without the :: operator in the code (that reverses the order of the list). What do you do?

Solution

def palindrome_tester(s):
  s = s.lower()
  x = len(s) // 2
  for i in range(x):
    if s[i] == s[-(i+1)]:
      pass
    else:
      return False
  return True

var_string = "mmnMM"

if (palindrome_tester(var_string)):
  print(var_string + " is a palindrome!")
else:
  print(var_string + " is NOT a palindrome!")