Giter VIP home page Giter VIP logo

zookeeper-operator's People

Contributors

averma-canonical avatar carlcsaposs-canonical avatar deusebio avatar jardon avatar marcoppenheimer avatar paulomach avatar sed-i avatar taurus-forever avatar verterok avatar welpaolo avatar zmraul avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zookeeper-operator's Issues

invalid `/etc/environment` after installing 3/stable (revision 100)

Steps to reproduce

  1. juju deploy zookeeper --channel 3/stable --series jammy
  2. juju ssh zookeeper/0 "source /etc/environment || cat /etc/environment"

Expected behavior

/etc/environment is still valid after installing zookeeper.

Actual behavior

root@juju-58ccb1-7:~# cat /etc/environment
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
=
SERVER_JVMFLAGS=-Dzookeeper.requireClientAuthScheme=sasl -Dzookeeper.superUser=super -Djava.security.auth.login.config=/var/snap/charmed-zookeeper/current/etc/zookeeper/zookeeper-jaas.cfg -Djavax.net.debug=ssl:handshake:verbose:keymanager:trustmanager -Dcom.sun.management.jmxremote -javaagent:/snap/charmed-zookeeper/current/opt/zookeeper/jmx_prometheus_javaagent.jar=9998:/var/snap/charmed-zookeeper/current/etc/zookeeper/jmx_prometheus.yaml

Versions

Operating system: Ubuntu 22.04.1 LTS

Juju CLI: 2.9.44-genericlinux-amd64

Juju agent: 2.9.44

Charm revision: channel: 3/stable, revision: 100

LXD: 5.15

Error on relation broken due to accessing relation data

I got an error when the kafka -> zookeeper relation was broken. See logs below:

unit-zookeeper-0: 13:42:19 ERROR unit.zookeeper/0.juju-log zookeeper:4: Uncaught exception while in charm code:
Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-zookeeper-0/charm/./src/charm.py", line 409, in <module>
    main(ZooKeeperCharm)
  File "/var/lib/juju/agents/unit-zookeeper-0/charm/venv/ops/main.py", line 436, in main
    _emit_charm_event(charm, dispatcher.event_name)
  File "/var/lib/juju/agents/unit-zookeeper-0/charm/venv/ops/main.py", line 144, in _emit_charm_event
    event_to_emit.emit(*args, **kwargs)
  File "/var/lib/juju/agents/unit-zookeeper-0/charm/venv/ops/framework.py", line 354, in emit
    framework._emit(event)
  File "/var/lib/juju/agents/unit-zookeeper-0/charm/venv/ops/framework.py", line 830, in _emit
    self._reemit(event_path)
  File "/var/lib/juju/agents/unit-zookeeper-0/charm/venv/ops/framework.py", line 919, in _reemit
    custom_handler(event)
  File "/var/lib/juju/agents/unit-zookeeper-0/charm/src/provider.py", line 317, in _on_client_relation_broken
    self._on_client_relation_updated(event=event)
  File "/var/lib/juju/agents/unit-zookeeper-0/charm/src/provider.py", line 290, in _on_client_relation_updated
    relation_config = self.relation_config(relation=event.relation)
  File "/var/lib/juju/agents/unit-zookeeper-0/charm/src/provider.py", line 83, in relation_config
    acl = relation.data[relation.app].get("chroot-acl", "cdrwa")
  File "/var/lib/juju/agents/unit-zookeeper-0/charm/venv/ops/model.py", line 1345, in __getitem__
    raise KeyError(
KeyError: 'Cannot index relation data with "None". Are you trying to access remote app data during a relation-broken event? This is not allowed.'
unit-zookeeper-0: 13:42:20 ERROR juju.worker.uniter.operation hook "zookeeper-relation-broken" (via hook dispatching script: dispatch) failed: exit status 1

Re using storage from previous `charmed-zookeeper` installation fails

Steps to reproduce

  1. Run zookeeper with 4 units
  2. Scale down one, keeping storage
  3. Scale back up, attaching the storage from previous unit.

Expected behavior

Zookeeper charm uses the storage

Actual behavior

New unit fails to install charmed-zookeeper

unit-zookeeper-4: 14:24:42 WARNING unit.zookeeper/4.install error: cannot perform the following tasks:                                                                                                                           
unit-zookeeper-4: 14:24:42 WARNING unit.zookeeper/4.install - Copy snap "charmed-zookeeper" data (unlinkat /var/snap/charmed-zookeeper/common/var/lib/zookeeper: device or resource busy)                                        
unit-zookeeper-4: 14:24:42 WARNING unit.zookeeper/4.install - Run install hook of "charmed-zookeeper" snap if present (run hook "install":                                                                                       
unit-zookeeper-4: 14:24:42 WARNING unit.zookeeper/4.install -----                                                                                                                                                                
unit-zookeeper-4: 14:24:42 WARNING unit.zookeeper/4.install + export COMPONENT=zookeeper                                                                                                                                         
unit-zookeeper-4: 14:24:42 WARNING unit.zookeeper/4.install + COMPONENT=zookeeper                                                                                                                                                
unit-zookeeper-4: 14:24:42 WARNING unit.zookeeper/4.install + export CONF=/var/snap/charmed-zookeeper/7/etc/zookeeper                                                                                                            
unit-zookeeper-4: 14:24:42 WARNING unit.zookeeper/4.install + CONF=/var/snap/charmed-zookeeper/7/etc/zookeeper                                                                                                                   
unit-zookeeper-4: 14:24:42 WARNING unit.zookeeper/4.install + export LOGS=/var/snap/charmed-zookeeper/common/var/log/zookeeper                                                                                                   
unit-zookeeper-4: 14:24:42 WARNING unit.zookeeper/4.install + LOGS=/var/snap/charmed-zookeeper/common/var/log/zookeeper                                                                                                          
unit-zookeeper-4: 14:24:42 WARNING unit.zookeeper/4.install + export DATA=/var/snap/charmed-zookeeper/common/var/lib/zookeeper                                                                                                   
unit-zookeeper-4: 14:24:42 WARNING unit.zookeeper/4.install + DATA=/var/snap/charmed-zookeeper/common/var/lib/zookeeper                                                                                                          
unit-zookeeper-4: 14:24:42 WARNING unit.zookeeper/4.install + mkdir -p /var/snap/charmed-zookeeper/7/etc/zookeeper                                                                                                               
unit-zookeeper-4: 14:24:42 WARNING unit.zookeeper/4.install + mkdir -p /var/snap/charmed-zookeeper/common/var/log/zookeeper                                                                                                      
unit-zookeeper-4: 14:24:42 WARNING unit.zookeeper/4.install + mkdir -p /var/snap/charmed-zookeeper/common/var/lib/zookeeper                                                                                                      
unit-zookeeper-4: 14:24:42 WARNING unit.zookeeper/4.install + cp /snap/charmed-zookeeper/7/etc/zookeeper/jmx_prometheus.yaml /snap/charmed-zookeeper/7/etc/zookeeper/log4j.properties /var/snap/charmed-zookeeper/7/etc/zookeeper
unit-zookeeper-4: 14:24:42 WARNING unit.zookeeper/4.install + chmod -R 770 /var/snap/charmed-zookeeper/7/etc                                                                                                                     
unit-zookeeper-4: 14:24:42 WARNING unit.zookeeper/4.install + chmod -R 770 /var/snap/charmed-zookeeper/common/var                                                                                                                
unit-zookeeper-4: 14:24:42 WARNING unit.zookeeper/4.install chmod: changing permissions of '/var/snap/charmed-zookeeper/common/var/lib/zookeeper': Operation not permitted                                                       
unit-zookeeper-4: 14:24:42 WARNING unit.zookeeper/4.install chmod: changing permissions of '/var/snap/charmed-zookeeper/common/var/lib/zookeeper/data': Operation not permitted                                                  
unit-zookeeper-4: 14:24:42 WARNING unit.zookeeper/4.install chmod: changing permissions of '/var/snap/charmed-zookeeper/common/var/lib/zookeeper/data/myid': Operation not permitted                                             
unit-zookeeper-4: 14:24:42 WARNING unit.zookeeper/4.install chmod: changing permissions of '/var/snap/charmed-zookeeper/common/var/lib/zookeeper/data/version-2': Operation not permitted                                        
unit-zookeeper-4: 14:24:42 WARNING unit.zookeeper/4.install chmod: changing permissions of '/var/snap/charmed-zookeeper/common/var/lib/zookeeper/data/version-2/snapshot.0': Operation not permitted                             
unit-zookeeper-4: 14:24:42 WARNING unit.zookeeper/4.install chmod: changing permissions of '/var/snap/charmed-zookeeper/common/var/lib/zookeeper/data/version-2/acceptedEpoch': Operation not permitted                          
unit-zookeeper-4: 14:24:42 WARNING unit.zookeeper/4.install chmod: changing permissions of '/var/snap/charmed-zookeeper/common/var/lib/zookeeper/data/version-2/currentEpoch': Operation not permitted 
unit-zookeeper-4: 14:24:42 WARNING unit.zookeeper/4.install chmod: changing permissions of '/var/snap/charmed-zookeeper/common/var/lib/zookeeper/data-log': Operation not permitted                    
unit-zookeeper-4: 14:24:42 WARNING unit.zookeeper/4.install chmod: changing permissions of '/var/snap/charmed-zookeeper/common/var/lib/zookeeper/data-log/version-2': Operation not permitted         
unit-zookeeper-4: 14:24:42 WARNING unit.zookeeper/4.install chmod: changing permissions of '/var/snap/charmed-zookeeper/common/var/lib/zookeeper/data-log/version-2/log.100000001': Operation not permitted                      
unit-zookeeper-4: 14:24:42 WARNING unit.zookeeper/4.install chmod: changing permissions of '/var/snap/charmed-zookeeper/common/var/lib/zookeeper/data-log/version-2/log.200000001': Operation not permitted
unit-zookeeper-4: 14:24:42 WARNING unit.zookeeper/4.install -----)                                                                                                                                         
unit-zookeeper-4: 14:24:42 ERROR unit.zookeeper/4.juju-log Snap: 'charmed-zookeeper'; command ['snap', 'install', 'charmed-zookeeper', '--revision="7"'] failed with output = ''                          
. . . # cut some logs

unit-zookeeper-4: 14:24:49 INFO unit.zookeeper/4.juju-log Running legacy hooks/start.                                                                                                                                
unit-zookeeper-4: 14:24:56 INFO unit.zookeeper/4.juju-log cluster:0: zookeeper/4 initializing...                                                                                                                     
unit-zookeeper-4: 14:24:56 ERROR unit.zookeeper/4.juju-log cluster:0: Could not ['snap', 'start', 'charmed-zookeeper.daemon'] for snap [charmed-zookeeper]: error: snap "charmed-zookeeper" has no service "daemon"  
Traceback (most recent call last):                                                                                
  File "/var/lib/juju/agents/unit-zookeeper-4/charm/lib/charms/operator_libs_linux/v1/snap.py", line 309, in _snap_daemons                                                                                           
    return subprocess.run(_cmd, universal_newlines=True, check=True, capture_output=True)                                                                                                                            
  File "/usr/lib/python3.10/subprocess.py", line 526, in run                                                      
    raise CalledProcessError(retcode, process.args,                                                               
subprocess.CalledProcessError: Command '['snap', 'start', 'charmed-zookeeper.daemon']' returned non-zero exit status 1.                                                                                              

During handling of the above exception, another exception occurred:                                                                                                                                                  

Traceback (most recent call last):                                                                                
  File "/var/lib/juju/agents/unit-zookeeper-4/charm/src/snap.py", line 60, in start_snap_service                                                                                                                     
    self.zookeeper.start(services=[self.SNAP_SERVICE])                                                            
  File "/var/lib/juju/agents/unit-zookeeper-4/charm/lib/charms/operator_libs_linux/v1/snap.py", line 347, in start
    self._snap_daemons(args, services)                                                                            
  File "/var/lib/juju/agents/unit-zookeeper-4/charm/lib/charms/operator_libs_linux/v1/snap.py", line 311, in _snap_daemons                                                                                           
    raise SnapError("Could not {} for snap [{}]: {}".format(_cmd, self._name, e.stderr))                                                                                                                             
charms.operator_libs_linux.v1.snap.SnapError: Could not ['snap', 'start', 'charmed-zookeeper.daemon'] for snap [charmed-zookeeper]: error: snap "charmed-zookeeper" has no service "daemon"                          

unit-zookeeper-4: 14:24:56 INFO unit.zookeeper/4.juju-log cluster:0: zookeeper/4 started                                                                                                                             
unit-zookeeper-4: 14:25:14 INFO unit.zookeeper/4.juju-log restart:1: zookeeper/4 restarting...                                                                                                                       
unit-zookeeper-4: 14:25:14 ERROR unit.zookeeper/4.juju-log restart:1: Could not ['snap', 'restart', 'charmed-zookeeper.daemon'] for snap [charmed-zookeeper]: error: snap "charmed-zookeeper" has no service "daemon"
Traceback (most recent call last):                                                                                
  File "/var/lib/juju/agents/unit-zookeeper-4/charm/lib/charms/operator_libs_linux/v1/snap.py", line 309, in _snap_daemons                                                                                           
    return subprocess.run(_cmd, universal_newlines=True, check=True, capture_output=True)                                                                                                                            
  File "/usr/lib/python3.10/subprocess.py", line 526, in run                                                      
    raise CalledProcessError(retcode, process.args,                                                               
subprocess.CalledProcessError: Command '['snap', 'restart', 'charmed-zookeeper.daemon']' returned non-zero exit status 1.                                                                                            

During handling of the above exception, another exception occurred:                                                                                                                                                  

Traceback (most recent call last):                                                                                
  File "/var/lib/juju/agents/unit-zookeeper-4/charm/src/snap.py", line 86, in restart_snap_service                                                                                                                   
    self.zookeeper.restart(services=[self.SNAP_SERVICE])                                                          
  File "/var/lib/juju/agents/unit-zookeeper-4/charm/lib/charms/operator_libs_linux/v1/snap.py", line 424, in restart                                                                                                 
    self._snap_daemons(args, services)                                                                            
  File "/var/lib/juju/agents/unit-zookeeper-4/charm/lib/charms/operator_libs_linux/v1/snap.py", line 311, in _snap_daemons                                                                                           
    raise SnapError("Could not {} for snap [{}]: {}".format(_cmd, self._name, e.stderr))                                                                                                                             
charms.operator_libs_linux.v1.snap.SnapError: Could not ['snap', 'restart', 'charmed-zookeeper.daemon'] for snap [charmed-zookeeper]: error: snap "charmed-zookeeper" has no service "daemon"                        


Install hook fails

Steps to reproduce

juju deploy zookeeper --channel 3/edge

Expected behavior

No error on deploy.

Actual behavior

zk_fail

Versions

dylan@protostar:~/repos/juju-dev-machine$ jhack utils print-env
                           juju info v0.1                           
┌──────────────┬───────────────────────────────────────────────────┐
│ jhack        │ 0.3.18.3                                          │
│ python       │ 3.10.6 (/home/dylan/repos/jhack/venv/bin/python3) │
│ juju-* snaps │  juju │ 3.2.0 - 23190 (latest/stable)             │
│ microk8s     │ MicroK8s v1.27.2 revision 5372                    │
│ lxd          │ 5.0.2                                             │
│ multipass    │ Not Installed.                                    │
│ multipassd   │ Not Installed.                                    │
│ os           │ Ubuntu 22.04.2 LTS                                │
│ kernel       │ Linux 5.15.0-75-generic x86_64                    │
└──────────────┴───────────────────────────────────────────────────┘

Log output

Juju debug log:

application-zookeeper: 12:52:53 INFO juju.worker.caasoperator.uniter.zookeeper/1 awaiting error resolution for "install" hook
application-zookeeper: 12:52:53 WARNING unit.zookeeper/1.install Traceback (most recent call last):
application-zookeeper: 12:52:53 WARNING unit.zookeeper/1.install   File "./src/charm.py", line 14, in <module>
application-zookeeper: 12:52:53 WARNING unit.zookeeper/1.install     from config import ZooKeeperConfig
application-zookeeper: 12:52:53 WARNING unit.zookeeper/1.install   File "/var/lib/juju/agents/unit-zookeeper-1/charm/src/config.py", line 11, in <module>
application-zookeeper: 12:52:53 WARNING unit.zookeeper/1.install     from utils import safe_get_file, safe_write_to_file, update_env
application-zookeeper: 12:52:53 WARNING unit.zookeeper/1.install   File "/var/lib/juju/agents/unit-zookeeper-1/charm/src/utils.py", line 72, in <module>
application-zookeeper: 12:52:53 WARNING unit.zookeeper/1.install     def map_env(env: list[str]) -> dict[str, str]:
application-zookeeper: 12:52:53 WARNING unit.zookeeper/1.install TypeError: 'type' object is not subscriptable
application-zookeeper: 12:52:54 ERROR juju.worker.caasoperator.uniter.zookeeper/1.operation hook "install" (via hook dispatching script: dispatch) failed: exit status 1

Install hook fails for `openjdk-17-jre-headless`

Steps to reproduce

Deploy this bundle:

---
name: hw-test

applications:
  ubuntu:
    charm: ubuntu
    scale: 2
    channel: edge
  zk:
    charm: zookeeper
    scale: 2
    channel: edge
  agent:
    charm: grafana-agent
    scale: 0
    channel: edge
  hw-health:
    charm: hw-health
    scale: 0
    channel: edge

relations:
  - [agent, ubuntu]
  - [agent, zk]
  - [hw-health, zk]
  - [hw-health, ubuntu]
  - [agent:juju-info, hw-health:juju-info]

Expected behavior

Green juju status.

Actual behavior

Reds here and there.

Versions

Operating system: Ubuntu 22.04.1 LTS

Juju CLI: 3.2.0-genericlinux-amd64

Juju agent: 3.2.0

Charm revision: 3/edge 101

LXD: 5.0.2

Log output

unit-zk-0: 13:59:24.257 DEBUG unit.zk/0.juju-log Emitting Juju event install.
unit-zk-0: 13:59:25.177 DEBUG unit.zk/0.juju-log package 'openjdk-17-jre-headless' is not currently installed or has the wrong architecture.
unit-zk-0: 13:59:25.245 ERROR unit.zk/0.juju-log Uncaught exception while in charm code:
Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-zk-0/charm/./src/charm.py", line 444, in <module>
    main(ZooKeeperCharm)
  File "/var/lib/juju/agents/unit-zk-0/charm/venv/ops/main.py", line 441, in main
    _emit_charm_event(charm, dispatcher.event_name)
  File "/var/lib/juju/agents/unit-zk-0/charm/venv/ops/main.py", line 149, in _emit_charm_event
    event_to_emit.emit(*args, **kwargs)
  File "/var/lib/juju/agents/unit-zk-0/charm/venv/ops/framework.py", line 354, in emit
    framework._emit(event)
  File "/var/lib/juju/agents/unit-zk-0/charm/venv/ops/framework.py", line 830, in _emit
    self._reemit(event_path)
  File "/var/lib/juju/agents/unit-zk-0/charm/venv/ops/framework.py", line 919, in _reemit
    custom_handler(event)
  File "/var/lib/juju/agents/unit-zk-0/charm/./src/charm.py", line 117, in _on_install
    install = self.snap.install()
  File "/var/lib/juju/agents/unit-zk-0/charm/src/snap.py", line 38, in install
    apt.add_package(["snapd", "openjdk-17-jre-headless"])
  File "/var/lib/juju/agents/unit-zk-0/charm/lib/charms/operator_libs_linux/v0/apt.py", line 761, in add_package
    pkg, success = _add(p, version, arch)
  File "/var/lib/juju/agents/unit-zk-0/charm/lib/charms/operator_libs_linux/v0/apt.py", line 802, in _add
    pkg.ensure(state=PackageState.Present)
  File "/var/lib/juju/agents/unit-zk-0/charm/lib/charms/operator_libs_linux/v0/apt.py", line 289, in ensure
    self._add()
  File "/var/lib/juju/agents/unit-zk-0/charm/lib/charms/operator_libs_linux/v0/apt.py", line 261, in _add
    self._apt(
  File "/var/lib/juju/agents/unit-zk-0/charm/lib/charms/operator_libs_linux/v0/apt.py", line 255, in _apt
    raise PackageError(
charms.operator_libs_linux.v0.apt.PackageError: Could not install package(s) [['openjdk-17-jre-headless=17.0.7+7~us1-0ubuntu1~22.04.2']]: None
unit-zk-0: 13:59:25.472 ERROR juju.worker.uniter.operation hook "install" (via hook dispatching script: dispatch) failed: exit status 1

Additional context

Model  Controller  Cloud/Region         Version  SLA          Timestamp
hw     lxd         localhost/localhost  3.2.0    unsupported  14:03:18-04:00

App        Version  Status   Scale  Charm          Channel  Rev  Exposed  Message
agent               unknown      0  grafana-agent  edge       9  no       
hw-health           unknown      0  hw-health      edge      31  no       
ubuntu              waiting    0/2  ubuntu         edge      24  no       waiting for machine
zk                  error      1/2  zookeeper      3/edge   101  no       hook failed: "install"

Unit      Workload  Agent       Machine  Public address  Ports  Message
ubuntu/0  waiting   allocating  0        10.30.254.15           waiting for machine
ubuntu/1  waiting   allocating  1                               waiting for machine
zk/0*     error     idle        2        10.30.254.79           hook failed: "install"
zk/1      waiting   allocating  3        10.30.254.16           waiting for machine

Machine  State    Address       Inst id        Base          AZ  Message
0        pending  10.30.254.15  juju-8f5f5b-0  [email protected]      Running
1        down                   pending        [email protected]      Failed creating instance from image: Unpack failed: Failed to run: unsquashfs -f -d /var/snap/lxd/common/lxd/storage-...
2        started  10.30.254.79  juju-8f5f5b-2  [email protected]      Running
3        down     10.30.254.16  juju-8f5f5b-3  [email protected]      Running

Relation provider    Requirer                Interface              Type         Message
agent:peers          agent:peers             grafana_agent_replica  peer         joining  
hw-health:juju-info  agent:juju-info         juju-info              subordinate  joining  
ubuntu:juju-info     agent:juju-info         juju-info              subordinate  joining  
ubuntu:juju-info     hw-health:general-info  juju-info              subordinate  joining  
zk:cluster           zk:cluster              cluster                peer         joining  
zk:cos-agent         agent:cos-agent         cos_agent              subordinate  joining  
zk:juju-info         hw-health:general-info  juju-info              subordinate  joining  
zk:restart           zk:restart              rolling_op             peer         joining  

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.