gunicorn.socket failed to listen on sockets












0















I'm a little confused with what the exact error I'm experiencing is. I've installed gunicorn and I'm following the instructions here with the slight difference that the service is called myapp.service / myapp.socket: http://docs.gunicorn.org/en/stable/deploy.html#systemd



My confusion lies with the myapp.socket file. If I create a file like so:



/etc/systemd/system/myapp.socket



[Unit]
Description=Myapps gunicorn socket

[Socket]
ListenStream=/run/myapp/socket

[Install]
WantedBy=sockets.target


and create the tmpfiles.d entry like so:



/etc/tmpfiles.d/myapp.conf:



d /run/myapp 0755 myappuser myappuser -


which has worked and the directory exists:



drwxr-xr-x.  2 myappuser myappuser   40 Feb  5 08:21 myapp


When I run sudo systemctl start myapp.socket as the documentation suggests I get the error:



systemd[1]: myapp.socket failed to listen on sockets: No such file or directory
systemd[1]: Failed to listen on Myapp gunicorn socket.


Is this a permissions issue? Or is this error actually suggesting there's an issue with my myapp.service file (which I haven't included because I'm not sure if it's even relevant yet)? if so is there any way to follow the error to see exactly what directory or file it's complaining about?



And if it's the case that it's looking for the socket file that hasn't been created by the myapp.service file yet because myapp.service is not yet running, why do the gunicorn docs suggest doing it in this order?



EDIT to clarify the appuser is not the same user that I am invoking sudo systemctl start myapp.socket from but my understanding is that shouldn't matter










share|improve this question





























    0















    I'm a little confused with what the exact error I'm experiencing is. I've installed gunicorn and I'm following the instructions here with the slight difference that the service is called myapp.service / myapp.socket: http://docs.gunicorn.org/en/stable/deploy.html#systemd



    My confusion lies with the myapp.socket file. If I create a file like so:



    /etc/systemd/system/myapp.socket



    [Unit]
    Description=Myapps gunicorn socket

    [Socket]
    ListenStream=/run/myapp/socket

    [Install]
    WantedBy=sockets.target


    and create the tmpfiles.d entry like so:



    /etc/tmpfiles.d/myapp.conf:



    d /run/myapp 0755 myappuser myappuser -


    which has worked and the directory exists:



    drwxr-xr-x.  2 myappuser myappuser   40 Feb  5 08:21 myapp


    When I run sudo systemctl start myapp.socket as the documentation suggests I get the error:



    systemd[1]: myapp.socket failed to listen on sockets: No such file or directory
    systemd[1]: Failed to listen on Myapp gunicorn socket.


    Is this a permissions issue? Or is this error actually suggesting there's an issue with my myapp.service file (which I haven't included because I'm not sure if it's even relevant yet)? if so is there any way to follow the error to see exactly what directory or file it's complaining about?



    And if it's the case that it's looking for the socket file that hasn't been created by the myapp.service file yet because myapp.service is not yet running, why do the gunicorn docs suggest doing it in this order?



    EDIT to clarify the appuser is not the same user that I am invoking sudo systemctl start myapp.socket from but my understanding is that shouldn't matter










    share|improve this question



























      0












      0








      0








      I'm a little confused with what the exact error I'm experiencing is. I've installed gunicorn and I'm following the instructions here with the slight difference that the service is called myapp.service / myapp.socket: http://docs.gunicorn.org/en/stable/deploy.html#systemd



      My confusion lies with the myapp.socket file. If I create a file like so:



      /etc/systemd/system/myapp.socket



      [Unit]
      Description=Myapps gunicorn socket

      [Socket]
      ListenStream=/run/myapp/socket

      [Install]
      WantedBy=sockets.target


      and create the tmpfiles.d entry like so:



      /etc/tmpfiles.d/myapp.conf:



      d /run/myapp 0755 myappuser myappuser -


      which has worked and the directory exists:



      drwxr-xr-x.  2 myappuser myappuser   40 Feb  5 08:21 myapp


      When I run sudo systemctl start myapp.socket as the documentation suggests I get the error:



      systemd[1]: myapp.socket failed to listen on sockets: No such file or directory
      systemd[1]: Failed to listen on Myapp gunicorn socket.


      Is this a permissions issue? Or is this error actually suggesting there's an issue with my myapp.service file (which I haven't included because I'm not sure if it's even relevant yet)? if so is there any way to follow the error to see exactly what directory or file it's complaining about?



      And if it's the case that it's looking for the socket file that hasn't been created by the myapp.service file yet because myapp.service is not yet running, why do the gunicorn docs suggest doing it in this order?



      EDIT to clarify the appuser is not the same user that I am invoking sudo systemctl start myapp.socket from but my understanding is that shouldn't matter










      share|improve this question
















      I'm a little confused with what the exact error I'm experiencing is. I've installed gunicorn and I'm following the instructions here with the slight difference that the service is called myapp.service / myapp.socket: http://docs.gunicorn.org/en/stable/deploy.html#systemd



      My confusion lies with the myapp.socket file. If I create a file like so:



      /etc/systemd/system/myapp.socket



      [Unit]
      Description=Myapps gunicorn socket

      [Socket]
      ListenStream=/run/myapp/socket

      [Install]
      WantedBy=sockets.target


      and create the tmpfiles.d entry like so:



      /etc/tmpfiles.d/myapp.conf:



      d /run/myapp 0755 myappuser myappuser -


      which has worked and the directory exists:



      drwxr-xr-x.  2 myappuser myappuser   40 Feb  5 08:21 myapp


      When I run sudo systemctl start myapp.socket as the documentation suggests I get the error:



      systemd[1]: myapp.socket failed to listen on sockets: No such file or directory
      systemd[1]: Failed to listen on Myapp gunicorn socket.


      Is this a permissions issue? Or is this error actually suggesting there's an issue with my myapp.service file (which I haven't included because I'm not sure if it's even relevant yet)? if so is there any way to follow the error to see exactly what directory or file it's complaining about?



      And if it's the case that it's looking for the socket file that hasn't been created by the myapp.service file yet because myapp.service is not yet running, why do the gunicorn docs suggest doing it in this order?



      EDIT to clarify the appuser is not the same user that I am invoking sudo systemctl start myapp.socket from but my understanding is that shouldn't matter







      systemd






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Feb 5 at 9:15







      ptr

















      asked Feb 5 at 9:08









      ptrptr

      12315




      12315






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "89"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1115766%2fgunicorn-socket-failed-to-listen-on-sockets%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Ask Ubuntu!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1115766%2fgunicorn-socket-failed-to-listen-on-sockets%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Questions related to Moebius Transform of Characteristic Function of the Primes

          List of scandals in India

          Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?