SUSE CaaS Platform/Troubleshooting

From MicroFocusInternationalWiki
Revision as of 07:44, 27 February 2018 by A jaeger (Talk | contribs)

Jump to: navigation, search

Quick Links

Docker Troubleshooting

Each docker container has a "log" function where you can review the system logs for that container.

Example 1

If I have a mysql container running, this is what it would look like if I reviewed logs:

jsevans@lab:~> docker logs clever_kalam

error: database is uninitialized and password option is not specified 

In the example, you can see that this container failed to start because a root password was never set.

CaaS Platform has several containers that run in the admin node

jse-velum:~ # docker ps
CONTAINER ID        IMAGE                COMMAND                  CREATED             STATUS              PORTS               NAMES
07ce66a2fb0d        2e581ae1971b         "bash /usr/local/bin/"   2 hours ago         Up 2 hours                              k8s_haproxy_haproxy-
713107d66b64        sles12/pause:1.0.0   "/usr/share/suse-dock"   2 hours ago         Up 2 hours                              k8s_POD_haproxy-
90371851a838        0ae495fb075d         " salt-m"   3 hours ago         Up 3 hours                              k8s_salt-master_velum-public-
66a569fe4bb0        82023d5e30f1         " bundle"   3 hours ago         Up 3 hours                              k8s_velum-event-processor_velum-public-
111ebdbc8d89        1b49b518ec09         "/usr/local/bin/entry"   3 hours ago         Up 2 hours                              k8s_openldap_velum-public-
0128b51867fe        82023d5e30f1         " bin/in"   3 hours ago         Up 2 hours                              k8s_velum-dashboard_velum-public-
fb62bc923356        3dbd223dcfac         ""         3 hours ago         Up 3 hours                              k8s_salt-minion-ca_velum-public-
f328d25e963d        23b3d88e6f1a         "salt-api"               3 hours ago         Up 3 hours                              k8s_salt-api_velum-public-
8f795c149af7        82023d5e30f1         " bundle"   3 hours ago         Up 3 hours                              k8s_velum-autoyast_velum-public-
f409e46f8938        1732313eb42f         " /usr/l"   3 hours ago         Up 3 hours                              k8s_velum-mariadb_velum-private-
341a7eba9003        sles12/pause:1.0.0   "/usr/share/suse-dock"   3 hours ago         Up 3 hours                              k8s_POD_velum-public-
6a26fbdeba6c        sles12/pause:1.0.0   "/usr/share/suse-dock"   3 hours ago         Up 3 hours                              k8s_POD_velum-private-

For each of these, you can run the log command against the CONTAINER ID or use the following bash shortcut to see the current system logs for that container:

Example 2

This is how to see the logs from the salt-master

docker logs `docker ps | grep salt-master | awk '{print $1}` -f

   - master.pem
   - admin
   - ca
   - 86c31b34f5694c0f968f7ac4b09ad9fd
   - fc02599431da43b0bef03aa0343efe35


You can add access to salt by adding the following aliases to /root/.bashrc (you will need to create this file). Then logout and log back in to use them. Using SALT directly is good for troubleshooting, but should generally not be used unless you are very familiar with SALT.

alias salt='docker exec `docker ps -q --filter name=salt-master` salt'
alias salt-key='docker exec `docker ps -q --filter name=salt-master` salt-key'

Example 3

Check salt keys:

jse-velum:~ # docker exec `docker ps -q --filter name=salt-master` salt-key -L
Accepted Keys:
Denied Keys:
Unaccepted Keys:
Rejected Keys:

Example 4

Check IP addresses:

jse-velum:~ # docker exec `docker ps -q --filter name=salt-master` salt '*' grains.get ipv4


The following files are added specifically for CaaS Platform:

velum-files.txt velum-migrations.txt velum-minions.yml velum-routes.txt velum-salt-events.yml velum-salt-pillars.yml kubernetes.txt

The problem with these logs is that they are in yaml format and not easy to troubleshoot. Rather than grepping as we normally would, a better strategy would be to grep for context.

Example 5:

grep -C3 fail velum-salt-events.yml 

 fun: grains.get
 id: 0d07bd4cd7e54a4880423fc42f025b88
- fun_args:
 - tx_update_failed
 jid: '20180214102215466369'
 retcode: 0

The -C3 flag will get 3 lines before and after the line that matches so you can get a better idea of what is happening that than just getting a single line that won't tell you anything about what the error is actually about.


If a bootstrap fails, we are not given any direct output about why it fails. We have a couple of new tools now:

First, we can manually kick off another bootstrap and record the output to bootstrap.log.

docker exec -it $(docker ps | grep salt-master | awk '{print $1}') salt-run -l debug state.orchestrate orch.kubernetes | tee bootstrap.log

The CaaS Platform team says, "This is unsupported and may cause issues further down the line but you can run." so we don't want to do this unless this is a recurring issue that the customer can't get past. In CaaS Platform 3, this will be an option built into Velum though I don't know if it will be logged.

Secondly, if this is recurring, we can put put the salt-master into debug mode after installing the admin node and before installing other nodes.

vim /etc/caasp/salt-master-custom.conf (on admin node)

and add

# Custom Configurations for Salt-Master

log_level: debug

You can then restart the salt-master container with:

docker stop `docker ps | grep salt-master | awk '{print $1}`

CaaSP will automatically restart the container with debugging turned on.

The logs that the salt-master produces are in json format. Before starting the bootstrap, run "script" and then run the command on Example 2. Once the bootstrap is failed, do CTRL-C and then exit. The output that was just on your screen from the log command will be in a file called "typescript".

From the dev team:

During bootstrap, thousands of "things" are done and sequenced across the set of cluster machines - and the set of things is constantly changing - any list would be out of date pretty quickly.

Generally speaking, finding what specific salt step has failed is not *all that difficult* by looking at the velm-salt-events.yaml file in the admin node's supportconfig dump.

The process looks like this:

  • Open velm-salt-events.yaml in an editor
  • Search for "result: False"
    • If the match you find says something like "Failed as prerequisite bar failed" (I don't have the exact wording handy) - then trace "up" the chain of failures logs to the "bar" failure
    • Repeat until you see a failure where the message is not simply a prerequisite failing, and you have found the real failure event.
  • The failure event will, more often than not, have a reasonably descriptive name. The name will indicate which area failed and needs investigation - e.g. if the name includes "etcd", start checking etcd

logs on each node etc.