bradleyd / devops_for_the_desperate

The companion code for the book DevOps for the Desperate
120 stars 67 forks source link

Update line 6 : change gunicorn to gunicorn3 #14

Closed Aztek1337 closed 2 years ago

Aztek1337 commented 2 years ago

Was having an issue running this chapter, the service kept failing to start.

Looking into the errors, turns out that gunicorn was being installed, not gunicorn3

bradleyd commented 2 years ago

@Aztek1337 Thanks for opening an issue!

Can you tell me what base box you are using in Vagrant. I am using 'ubuntu/focal64' (v20220724.0.0). I was unable to reproduce or find any errors related to gunicorn3. The gunicorn package in the apt repository is actually gunicorn3--as far as I can see.

I went ahead and looked at what package it installs and found the standard gunicorn which is gunicorn3. Here are the steps I went through to verify:

vagrant@dftd:~$ dpkg -l gunicorn
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
ii  gunicorn       20.0.4-3     all          Event-based HTTP/WSGI server
vagrant@dftd:~$ apt search gunicorn
Sorting... Done
Full Text Search... Done
gunicorn/focal,now 20.0.4-3 all [installed]
  Event-based HTTP/WSGI server

gunicorn-examples/focal 20.0.4-3 all
  Event-based HTTP/WSGI server (examples)

python3-dj-static/focal 0.0.6-6 all
  Serve production static files with Django (Python 3)

python3-gunicorn/focal,now 20.0.4-3 all [installed,automatic]
  Event-based HTTP/WSGI server (Python 3 libraries)

python3-httpbin/focal 0.5.0+dfsg-3 all
  HTTP request and response service (Python 3 package)

python3-socketio/focal 4.4.0-2 all
  python3 implementation of the Socket.IO realtime client and server

vagrant@dftd:~$ apt show gunicorn
Package: gunicorn
Version: 20.0.4-3
Priority: optional
Section: universe/python
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Chris Lamb <lamby@debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 33.8 kB
Provides: httpd-wsgi3
Depends: python3-gunicorn (= 20.0.4-3), python3:any
Suggests: python3-pastedeploy, python3-setproctitle, python3-tornado
Breaks: gunicorn3 (<< 19.9.0-1)
Homepage: https://gunicorn.org/
Download-Size: 11.8 kB
APT-Manual-Installed: yes
APT-Sources: http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages
Description: Event-based HTTP/WSGI server
 Green Unicorn (gunicorn) is an HTTP/WSGI server designed to serve fast clients
 or sleepy applications. That is to say; behind a buffering front-end server
 such as nginx or lighttpd.
 .
  * Optional support for Eventlet, Tornado and Gevent to provide asynchronous
    long-polling ("Comet") connections.
  * Process management: Gunicorn reaps and restarts workers that die.
  * Easy integration with Django and Paster compatible applications (Pylons,
    TurboGears 2, etc.
  * Load balancing via pre-fork and a shared socket
  * Graceful worker process restarts
  * Upgrading without losing connections
  * Decode chunked transfers on-the-fly, allowing upload progress notifications
    or stream-based protocols over HTTP

When I do switch it to gunicorn3 I get this error during provisioning:

TASK [Install python3-flask, gunicorn3, and nginx] *****************************
fatal: [default]: FAILED! => {"changed": false, "msg": "No package matching 'gunicorn3' is available"}

Please let me know any other steps you did to see if we can flush this out 😄

Aztek1337 commented 2 years ago

@bradleyd I figured out the issue.

While trying to replicate the error, I forgot I switched to the generic/ubuntu1710 image because I am using my homelab's ESXI server as the provider; and was following some old examples of esxi and vagrant and sadly ubuntu/focal64 doesn't work with esxi being the provider.

I completely blanked that I switched the base image.

But trying with generic/ubuntu2004 it works fine when using gunicorn.

Closing this PR.

Thanks for checking

bradleyd commented 2 years ago

No worries. Thanks for responding :)