drevops / vortex

🌀 Drupal project template
https://vortex.drevops.com
GNU General Public License v3.0
83 stars 19 forks source link

doctor.sh failing for Pygmy checks #1095

Closed gargsuchi closed 8 months ago

gargsuchi commented 1 year ago

pygmy status output for me on Mac is:

pygmy status                                
[*] Dnsmasq: Running as docker container amazeeio-dnsmasq
[*] Haproxy: Running as docker container amazeeio-haproxy
[*] Network: Exists as name amazeeio-network
[*] Network: Haproxy amazeeio-haproxy connected to amazeeio-network
[*] Mailhog: Running as docker container mailhog.docker.amazee.io
[*] Resolv is properly configured
[*] ssh-agent: Running as docker container amazeeio-ssh-agent, loaded keys:
3072 SHA256:bbgCswszVunKEAa3kBASBftcj6mW6Aqgg0SvGEtB8dE suchi@Suchis-MacBook-Pro.local (RSA)

doctor.sh has this code:

pygmy_services=()
    pygmy_services+=("amazeeio-ssh-agent")
    pygmy_services+=("amazeeio-mailhog")
    pygmy_services+=("amazeeio-haproxy")
    pygmy_services+=("amazeeio-dnsmasq")

    for pygmy_service in "${pygmy_services[@]}"; do
      if ! echo "${pygmy_status}" | grep -q "${pygmy_service}: Running"; then
        fail "Pygmy service ${pygmy_service} is not running. Run 'pygmy up' or 'pygmy restart' to fix."
        exit 1
      fi

As you can see, the if condition will not be satisfied as the output says Dnsmasq: Running and not amazeeio-dnsmasq: Running

Locally, I have changed code to this - which works

pygmy_services=()
    pygmy_services+=("amazeeio-ssh-agent")
    pygmy_services+=("mailhog")
    pygmy_services+=("amazeeio-haproxy")
    pygmy_services+=("amazeeio-dnsmasq")

    for pygmy_service in "${pygmy_services[@]}"; do
      if ! echo "${pygmy_status}" | grep  "${pygmy_service}" | grep "Running"; then
AlexSkrypnyk commented 1 year ago

@gargsuchi

thank you for reporting this

could you please paste the output of ‘ahoy doctor info’ here

thank you

gargsuchi commented 1 year ago

Hi @AlexSkrypnyk

System information report

OPERATING SYSTEM
ProductName:        macOS
ProductVersion:     14.1.1
BuildVersion:       23B81

DOCKER
Path to binary: /usr/local/bin/docker
Docker version 24.0.6, build ed223bc
Client:
 Version:    24.0.6
 Context:    desktop-linux
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.11.2-desktop.4
    Path:     /Users/suchi/.docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.21.0-desktop.1
    Path:     /Users/suchi/.docker/cli-plugins/docker-compose
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.0
    Path:     /Users/suchi/.docker/cli-plugins/docker-dev
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.20
    Path:     /Users/suchi/.docker/cli-plugins/docker-extension
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v0.1.0-beta.7
    Path:     /Users/suchi/.docker/cli-plugins/docker-init
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     /Users/suchi/.docker/cli-plugins/docker-sbom
  scan: Docker Scan (Docker Inc.)
    Version:  v0.26.0
    Path:     /Users/suchi/.docker/cli-plugins/docker-scan
  scout: Command line tool for Docker Scout (Docker Inc.)
    Version:  0.24.1
    Path:     /Users/suchi/.docker/cli-plugins/docker-scout

Server:
 Containers: 29
  Running: 28
  Paused: 0
  Stopped: 1
 Images: 332
 Server Version: 24.0.6
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 8165feabfdfe38c65b599c4993d227328c231fca
 runc version: v1.1.8-0-g82f18fe
 init version: de40ad0
 Security Options:
  seccomp
   Profile: unconfined
  cgroupns
 Kernel Version: 6.3.13-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 19.55GiB
 Name: docker-desktop
 ID: 05fe65ab-39ed-4af4-97a6-86dbdadce8c0
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5555
  127.0.0.0/8
 Live Restore Enabled: false

DOCKER COMPOSE V2
Docker Compose version v2.21.0-desktop.1

DOCKER-COMPOSE V1
Path to binary: /usr/local/bin/docker-compose
Docker Compose version v2.21.0-desktop.1

PYGMY
Path to binary: /Users/suchi/.gem/bin/pygmy
Pygmy - Version: 0.9.11

AHOY
Path to binary: /usr/local/bin/ahoy
2.0.0
AlexSkrypnyk commented 11 months ago

@gargsuchi I have cross-checked the output of the latest version on Pygmy (https://github.com/pygmystack/pygmy) 0.11.0 and it matches the current expected output in doctor.sh.

I've noticed that you are using an old Ruby version of Pygmy - could you please try installing a Go version of Pygmy from https://github.com/pygmystack/pygmy. Ruby version is no longer supported.

thank you

AlexSkrypnyk commented 10 months ago

Pygmy is in the process of implementing an output format that would allow to integrate it better into scripts. https://github.com/pygmystack/pygmy/pull/506

AlexSkrypnyk commented 8 months ago

I'm going to close this one as the root cause was found an, looks like, resolved. Please feel free to re-open.