opensearch & opensearch-dashboard not work

Bug #2020152 reported by Tony Kim
26
This bug affects 5 people
Affects Status Importance Assigned to Milestone
kolla-ansible
Fix Released
Medium
Michal Nasiadka
Antelope
Fix Released
Medium
Michal Nasiadka
Yoga
Fix Released
Undecided
Unassigned
Zed
Fix Released
Undecided
Unassigned

Bug Description

Perhaps the opensearch and opensearch-dashboard services are not running normally.
(openstack zed & kolla-ansible version 15.1.0)

- opensearch-dashboard : FATAL Error: Unable to write OpenSearch Dashboards UUID file, please check the uuid.server configuration value in opensearch_dashboards.yml and ensure OpenSearch Dashboards has sufficient permissions to read / write to this file. Error was: EACCES

- opensearch : unhealthy because the service runs with a default configuration file.

It looks like you need to change 2 files and then recofgure.

The location of the default configuration file of the opensearch service and the owner change related to the opensearch-dashboard are as follows.

first, change default dest's value from "/usr/share/opensearch/config/opensearch.yml" to "/etc/opensearch/opensearch.yml"
```
]# vim kolla-ansible/ansible/roles/opensearch/templates/opensearch.json.j2
{
    "command": "/usr/share/opensearch/bin/opensearch",
    "config_files": [
        {
            "source": "{{ container_config_directory }}/opensearch.yml",
            "dest": "/etc/opensearch/opensearch.yml", #<---- here
            "owner": "opensearch",
            "perm": "0600"
        }
    ],
    "permissions": [
        {
            "path": "/var/lib/opensearch",
            "owner": "opensearch:opensearch",
            "recurse": true
        },
        {
            "path": "/var/log/kolla/opensearch",
            "owner": "opensearch:opensearch",
            "recurse": true
        }
    ]
}
```

second, add some config to change ownership
```
]# vim kolla-ansible/ansible/roles/opensearch/templates/opensearch-dashboards.json.j2
{
    "command": "/usr/share/opensearch-dashboards/bin/opensearch-dashboards --config /etc/opensearch/opensearch_dashboards.yml",
    "config_files": [
        {
            "source": "{{ container_config_directory }}/opensearch_dashboards.yml",
            "dest": "/etc/opensearch/opensearch_dashboards.yml",
            "owner": "opensearch",
            "perm": "0640"
        }
    ],
    "permissions": [
        { #<-- here
            "path": "/usr/share/opensearch-dashboards", #<-- here
            "owner": "opensearch:opensearch", #<-- here
            "recurse": true #<-- here
        }, #<-- here
        {
            "path": "/var/log/kolla/opensearch",
            "owner": "opensearch:opensearch",
            "recurse": true
        },
        {
            "path": "/usr/share/opensearch/dashboards/optimize/bundles",
            "owner": "opensearch:opensearch",
            "recurse": true
        }
    ]
}
```

Tony Kim (hee4004)
description: updated
description: updated
Tony Kim (hee4004)
description: updated
Revision history for this message
Sven Kieske (s-kieske) wrote :
Changed in kolla-ansible:
status: New → Confirmed
Changed in kolla-ansible:
status: Confirmed → Triaged
importance: Undecided → Medium
summary: - opensearch & opensearch-bashboard not work
+ opensearch & opensearch-dashboard not work
Revision history for this message
Michal Nasiadka (mnasiadka) wrote :

So, I see multiple things we need to change:
1. OpenSearch config file path - that's obvious
2. OpenSearch-Dashboards rpm/deb packages now create an opensearch-dashboards user - so let's move to that

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla-ansible (master)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla-ansible (master)

Reviewed: https://review.opendev.org/c/openstack/kolla-ansible/+/884649
Committed: https://opendev.org/openstack/kolla-ansible/commit/5aaab8dc20f01666046cdefdbcc7ca95ca31e898
Submitter: "Zuul (22348)"
Branch: master

commit 5aaab8dc20f01666046cdefdbcc7ca95ca31e898
Author: Mathias Fechner <email address hidden>
Date: Tue May 30 07:50:29 2023 +0200

    opensearch-dashboard: fix permissions

    Fix permissions for opensearch-dashboard data directory.

    Closes-bug: #2020152

    Change-Id: Ie4cec7649d89df5b8bb306563da2c62ea0cdd2c0
    Signed-off-by: Mathias Fechner <email address hidden>

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla-ansible (stable/2023.1)

Fix proposed to branch: stable/2023.1
Review: https://review.opendev.org/c/openstack/kolla-ansible/+/886473

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla-ansible (stable/zed)

Fix proposed to branch: stable/zed
Review: https://review.opendev.org/c/openstack/kolla-ansible/+/886474

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla-ansible (stable/zed)

Reviewed: https://review.opendev.org/c/openstack/kolla-ansible/+/886474
Committed: https://opendev.org/openstack/kolla-ansible/commit/073a2f7d1627e5635e2fdd7257827e4b34c3dae1
Submitter: "Zuul (22348)"
Branch: stable/zed

commit 073a2f7d1627e5635e2fdd7257827e4b34c3dae1
Author: Mathias Fechner <email address hidden>
Date: Tue May 30 07:50:29 2023 +0200

    opensearch-dashboard: fix permissions

    Fix permissions for opensearch-dashboard data directory.

    Closes-bug: #2020152

    Change-Id: Ie4cec7649d89df5b8bb306563da2c62ea0cdd2c0
    Signed-off-by: Mathias Fechner <email address hidden>
    (cherry picked from commit 5aaab8dc20f01666046cdefdbcc7ca95ca31e898)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla-ansible (stable/2023.1)

Reviewed: https://review.opendev.org/c/openstack/kolla-ansible/+/886473
Committed: https://opendev.org/openstack/kolla-ansible/commit/a3bbf3399bcff4e0089e189b2988c01da280650f
Submitter: "Zuul (22348)"
Branch: stable/2023.1

commit a3bbf3399bcff4e0089e189b2988c01da280650f
Author: Mathias Fechner <email address hidden>
Date: Tue May 30 07:50:29 2023 +0200

    opensearch-dashboard: fix permissions

    Fix permissions for opensearch-dashboard data directory.

    Closes-bug: #2020152

    Change-Id: Ie4cec7649d89df5b8bb306563da2c62ea0cdd2c0
    Signed-off-by: Mathias Fechner <email address hidden>
    (cherry picked from commit 5aaab8dc20f01666046cdefdbcc7ca95ca31e898)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/kolla-ansible 16.1.0

This issue was fixed in the openstack/kolla-ansible 16.1.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/kolla-ansible 15.2.0

This issue was fixed in the openstack/kolla-ansible 15.2.0 release.

Revision history for this message
Christophe Aubry (caubry) wrote :

There's still an issue, owner for the dashboard must be opensearch-dashboards not opensearch

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla-ansible (stable/yoga)

Fix proposed to branch: stable/yoga
Review: https://review.opendev.org/c/openstack/kolla-ansible/+/893249

Revision history for this message
Michal Nasiadka (mnasiadka) wrote :

Christophe, in which release are you observing that problem?

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla-ansible (stable/yoga)

Reviewed: https://review.opendev.org/c/openstack/kolla-ansible/+/893249
Committed: https://opendev.org/openstack/kolla-ansible/commit/3b17c915a1cde1609116515371114af870d9d750
Submitter: "Zuul (22348)"
Branch: stable/yoga

commit 3b17c915a1cde1609116515371114af870d9d750
Author: Mathias Fechner <email address hidden>
Date: Tue May 30 07:50:29 2023 +0200

    opensearch-dashboard: fix permissions

    Fix permissions for opensearch-dashboard data directory.

    Closes-bug: #2020152

    Change-Id: Ie4cec7649d89df5b8bb306563da2c62ea0cdd2c0
    Signed-off-by: Mathias Fechner <email address hidden>
    (cherry picked from commit 5aaab8dc20f01666046cdefdbcc7ca95ca31e898)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/kolla-ansible 14.10.0

This issue was fixed in the openstack/kolla-ansible 14.10.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/kolla-ansible 17.0.0.0rc1

This issue was fixed in the openstack/kolla-ansible 17.0.0.0rc1 release candidate.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.