Merge ~raychan96/charm-graylog:fix_temporarily_es_down into charm-graylog:master

Proposed by Chi Wai CHAN
Status: Merged
Approved by: Ramesh Sattaru
Approved revision: 2e812fdfd057e0ff1a8634d714244e857ce34752
Merged at revision: 06202c3a18baf796676ac309994f1291b3cf4e0e
Proposed branch: ~raychan96/charm-graylog:fix_temporarily_es_down
Merge into: charm-graylog:master
Diff against target: 30 lines (+5/-3)
2 files modified
src/reactive/graylog.py (+4/-2)
src/tests/functional/tests/test_graylog_charm.py (+1/-1)
Reviewer Review Type Date Requested Status
Ramesh Sattaru (community) Approve
Erhan Sunar (community) Approve
🤖 prod-jenkaas-bootstack (community) continuous-integration Approve
JamesLin Needs Fixing
Review via email: mp+437477@code.launchpad.net

Commit message

Add elasticsearch.configured state to better handle the corner case that graylog tries to configure ES when ES might be temporarily down due to internal services changed.

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Chi Wai CHAN (raychan96) wrote :

The functional test keeps failing for different reasons. The recent test failed because of apparmor is blocking the open of graylog snap:

```
kernel: [ 268.578819] audit: type=1400 audit(1676865526.269:41): apparmor="DENIED" operation="open" profile="snap.graylog.graylog" name="/proc/20073/mountinfo" pid=20073 comm="java" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
...
systemd[1]: snap.graylog.graylog.service: Failed with result 'exit-code'.
```

Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
JamesLin (jneo8) wrote :

Functional test keep failing.

review: Needs Fixing
Revision history for this message
Chi Wai CHAN (raychan96) wrote :

> Functional test keep failing.

It's failing for different reasons if you look at the previous runs (e.g graylog api failed because of unauthorized / kernel security module block the snap installation ...). I don't really think this is caused by this patch, but I maybe wrong.

Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :
review: Approve (continuous-integration)
Revision history for this message
Chi Wai CHAN (raychan96) wrote :

It finally passed the CI!

Revision history for this message
Erhan Sunar (esunar) wrote :

LGTM

review: Approve
Revision history for this message
Ramesh Sattaru (rameshcan) :
review: Approve
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 06202c3a18baf796676ac309994f1291b3cf4e0e

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/reactive/graylog.py b/src/reactive/graylog.py
2index b90d1f4..282374d 100644
3--- a/src/reactive/graylog.py
4+++ b/src/reactive/graylog.py
5@@ -778,8 +778,10 @@ def configure_elasticsearch(elasticsearch):
6 try:
7 es.disable_auto_create_index()
8 except Exception as e:
9- hookenv.log("Error configuring ES: {}".format(e))
10- raise ConnectionError
11+ hookenv.log(
12+ "Error configuring ES: {}. Will retry after update status.".format(e)
13+ )
14+ return
15
16 if not cluster:
17 conf = hookenv.config()
18diff --git a/src/tests/functional/tests/test_graylog_charm.py b/src/tests/functional/tests/test_graylog_charm.py
19index 83d58e7..1f2c8fd 100644
20--- a/src/tests/functional/tests/test_graylog_charm.py
21+++ b/src/tests/functional/tests/test_graylog_charm.py
22@@ -136,7 +136,7 @@ class CharmOperationTest(BaseGraylogTest):
23 }
24 for attempt in tenacity.Retrying(
25 wait=tenacity.wait_fixed(10), # seconds
26- stop=tenacity.stop_after_attempt(3),
27+ stop=tenacity.stop_after_attempt(70),
28 reraise=True,
29 ):
30 with attempt:

Subscribers

People subscribed via source and target branches

to all changes: