summaryrefslogtreecommitdiff
path: root/doc/source/admin/troubleshooting.rst
blob: e4fe5691b613bfc4533381c0ae70476c8e9698d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
===============
Troubleshooting
===============

Instance stuck in BUILD status
------------------------------

The possible reasons for this issue:

* Networking issue between message queue service(e.g. RabbitMQ) and Trove guest
  instance. When creating a Trove instance, trove-taskmanager sends a message
  to the message queue, which is expected to be received and handled by the
  trove-guestagent service which is running inside the instance. The instance
  operating status should be updated by trove-guestagent service after
  handling. Apparently, If the trove-guestagent can't connect with RabbitMQ,
  the instance status won't be updated.
* Code bug in trove-guestagent. You should be able to see some error log in
  trove-guestagent log file (by default,
  ``/var/log/trove/trove-guestagent.log``).
* If you are using the dev mode image, it's also possible that trove-guestagent
  can't connect to Trove controller host to download trove-guestagent service
  code, either because of network connectivity issue or the ssh key is missing
  or incorrect.

In either case, you need to check the trove guest agent log. There are two ways
for checking the log depending on if the message queue system is working
between trove controller and trove guest agent.

Please contact Trove team in #openstack-trove IRC channel or send email to
openstack-discuss@lists.openstack.org if help needed.

.. note::

    The Trove instance creation time varies in different environments, the
    default value of ``usage_timeout`` option (3600 seconds) may not be applied
    to all, the cloud administrator should change that based on testing so that
    the instance creation should fail in a reasonable timely manner.

Publish log to Swift
~~~~~~~~~~~~~~~~~~~~

If the trove task manager is able to talk to guest agent via message queue but
something is wrong inside the guest instance, you can easily retrieve the guest
agent log by running the CLI **as admin user**.

First, check if guest log is available:

.. code-block:: console

   $ openstack database log list $dbid
   +------------+------+----------+-----------+---------+-----------+--------+
   | Name       | Type | Status   | Published | Pending | Container | Prefix |
   +------------+------+----------+-----------+---------+-----------+--------+
   | general    | USER | Disabled |         0 |       0 | None      | None   |
   | slow_query | USER | Disabled |         0 |       0 | None      | None   |
   | error      | SYS  | Enabled  |         0 |       0 | None      | None   |
   | guest      | SYS  | Ready    |         0 |   25781 | None      | None   |
   +------------+------+----------+-----------+---------+-----------+--------+

Next, publish the guest log to object storage service(Swift):

.. code-block:: console

   $ openstack database log set $dbid guest --publish
   +-----------+-----------------------------------------------------------+
   | Field     | Value                                                     |
   +-----------+-----------------------------------------------------------+
   | container | database_logs                                             |
   | metafile  | 1be17492-d163-4b5e-b1a3-ae0ab1d98d3a/mysql-guest_metafile |
   | name      | guest                                                     |
   | pending   | 0                                                         |
   | prefix    | 1be17492-d163-4b5e-b1a3-ae0ab1d98d3a/mysql-guest/         |
   | published | 25937                                                     |
   | status    | Published                                                 |
   | type      | SYS                                                       |
   +-----------+-----------------------------------------------------------+

You can check if the log file is uploaded to Swift:

.. code-block:: console

   $ openstack object list database_logs
   +---------------------------------------------------------------------------------+
   | Name                                                                            |
   +---------------------------------------------------------------------------------+
   | 1be17492-d163-4b5e-b1a3-ae0ab1d98d3a/mysql-guest/log-2021-03-24T21:03:50.846243 |
   | 1be17492-d163-4b5e-b1a3-ae0ab1d98d3a/mysql-guest_metafile                       |
   +---------------------------------------------------------------------------------+

Now, you can download the file to your local:

.. code-block:: console

   $ openstack database log save $dbid guest --file guestagnet.log
   Log "guest" written to guestagnet.log

SSH into the instance
~~~~~~~~~~~~~~~~~~~~~

In some cases, when trove task manager is not able to talk to guest agent via
message queue, you have to ssh into the instance.

To ssh into the Trove instance, you need to make sure:

* You have the admin credentials to get the IP address of Trove instance
  management port. The management port is a Neutron port allocated from the
  management network (defined by ``management_networks`` config option). For
  example, you need to log into a Trove instance named 'test', and the
  management network name is 'trove-mgmt', you can run:

  .. code-block:: console

     $ openstack server list | grep test | grep trove-mgmt
     | 810fc014-bd9f-4464-b506-1b78f37c495e | test | ACTIVE | private=10.1.0.57; trove-mgmt=192.168.254.229 | ubuntu-xenial-mysql-5.7-dev | ds1G   |

* The TCP 22 port is allowed in the Neutron security group (defined by
  ``management_security_groups`` config option) that applied to the management
  port.
* You have the SSH private key. The Trove instance should be created using a
  Nova keypair defined by ``nova_keypair`` config option.

After log into the instance, you can check the trove-guestagent log by:

.. code-block:: console

   sudo journalctl -u guest-agent.service | less # or
   sudo vi /var/log/trove/trove-guestagent.log