Trouble with deploy throw pip fabric on macOS












0















I have some problems with deployment throw pip fabric on my new MacBook. There is some issues in google, but what they recommend doesn't work ... Also same config works on High Sierra on another mac, so seems like i'm misunderstanding smth.
There is my pip packages:



Package      Version
------------ -------
asn1crypto 0.24.0
bcrypt 3.1.4
cffi 1.11.5
cryptography 2.3.1
fabric 2.3.1
idna 2.7
invoke 1.1.1
paramiko 2.4.1
pip 18.1
pyasn1 0.4.4
pycparser 2.18
PyNaCl 1.2.1
setuptools 40.6.3
six 1.11.0
wheel 0.32.3


And this is my fab file:



from fabric import Connection
from invoke import task

@task
def deploy(c, branch='master', directory='*secret*', compile='true'):
with Connection('*secret*') as c:
deploy_process(c, branch, directory, compile)

def deploy_process(c, branch, directory, compile):
code_dir = '/var/www/' + directory
service = directory + ".service"
if not c.run("cd {} && git fetch origin".format(code_dir), warn=True):
c.run("git clone *also secret repo* {}".format(code_dir))

c.run("cd {} && git fetch origin".format(code_dir))
c.run("cd {} && git checkout -f {}".format(code_dir, branch))
c.run("cd {} && git pull origin {}".format(code_dir, branch))
if not c.run("test -d {}/tmp/pids".format(code_dir), warn=True):
c.run("cd {} && mkdir -p tmp/pids".format(code_dir))
c.run("cd {} && bundle install --without development test".format(code_dir))
c.run("cd {} && rails tmp:cache:clear db:migrate RAILS_ENV=production".format(code_dir))
if (compile == 'true'):
c.run("cd {} && rails assets:precompile RAILS_ENV=production".format(code_dir))
c.run("cd {} && rails assets:clean RAILS_ENV=production".format(code_dir))

c.run("systemctl restart {}".format(service))


And there is an error:



Traceback (most recent call last):
File "/usr/local/bin/fab", line 11, in <module>
sys.exit(program.run())
File "/usr/local/lib/python3.7/site-packages/invoke/program.py", line 335, in run
self.execute()
File "/usr/local/lib/python3.7/site-packages/invoke/program.py", line 491, in execute
executor.execute(*self.tasks)
File "/usr/local/lib/python3.7/site-packages/invoke/executor.py", line 129, in execute
result = call.task(*args, **call.kwargs)
File "/usr/local/lib/python3.7/site-packages/invoke/tasks.py", line 128, in __call__
result = self.body(*args, **kwargs)
File "/Users/vassa/Projects/pochtagram/fabfile.py", line 11, in deploy
if not c.run("cd {} && git fetch origin".format(code_dir), warn=True):
File "<decorator-gen-3>", line 2, in run
File "/usr/local/lib/python3.7/site-packages/fabric/connection.py", line 29, in opens
self.open()
File "/usr/local/lib/python3.7/site-packages/fabric/connection.py", line 541, in open
self.client.connect(**kwargs)
File "/usr/local/lib/python3.7/site-packages/paramiko/client.py", line 424, in connect
passphrase,
File "/usr/local/lib/python3.7/site-packages/paramiko/client.py", line 714, in _auth
raise saved_exception
File "/usr/local/lib/python3.7/site-packages/paramiko/client.py", line 686, in _auth
filename, pkey_class, passphrase,
File "/usr/local/lib/python3.7/site-packages/paramiko/client.py", line 551, in _key_from_filepath
key = klass.from_private_key_file(key_path, password)
File "/usr/local/lib/python3.7/site-packages/paramiko/pkey.py", line 206, in from_private_key_file
key = cls(filename=filename, password=password)
File "/usr/local/lib/python3.7/site-packages/paramiko/rsakey.py", line 48, in __init__
self._from_private_key_file(filename, password)
File "/usr/local/lib/python3.7/site-packages/paramiko/rsakey.py", line 169, in _from_private_key_file
data = self._read_private_key_file('RSA', filename, password)
File "/usr/local/lib/python3.7/site-packages/paramiko/pkey.py", line 279, in _read_private_key_file
data = self._read_private_key(tag, f, password)
File "/usr/local/lib/python3.7/site-packages/paramiko/pkey.py", line 289, in _read_private_key
raise SSHException('not a valid ' + tag + ' private key file')
paramiko.ssh_exception.SSHException: not a valid RSA private key file


Hope smb can help me ...










share|improve this question



























    0















    I have some problems with deployment throw pip fabric on my new MacBook. There is some issues in google, but what they recommend doesn't work ... Also same config works on High Sierra on another mac, so seems like i'm misunderstanding smth.
    There is my pip packages:



    Package      Version
    ------------ -------
    asn1crypto 0.24.0
    bcrypt 3.1.4
    cffi 1.11.5
    cryptography 2.3.1
    fabric 2.3.1
    idna 2.7
    invoke 1.1.1
    paramiko 2.4.1
    pip 18.1
    pyasn1 0.4.4
    pycparser 2.18
    PyNaCl 1.2.1
    setuptools 40.6.3
    six 1.11.0
    wheel 0.32.3


    And this is my fab file:



    from fabric import Connection
    from invoke import task

    @task
    def deploy(c, branch='master', directory='*secret*', compile='true'):
    with Connection('*secret*') as c:
    deploy_process(c, branch, directory, compile)

    def deploy_process(c, branch, directory, compile):
    code_dir = '/var/www/' + directory
    service = directory + ".service"
    if not c.run("cd {} && git fetch origin".format(code_dir), warn=True):
    c.run("git clone *also secret repo* {}".format(code_dir))

    c.run("cd {} && git fetch origin".format(code_dir))
    c.run("cd {} && git checkout -f {}".format(code_dir, branch))
    c.run("cd {} && git pull origin {}".format(code_dir, branch))
    if not c.run("test -d {}/tmp/pids".format(code_dir), warn=True):
    c.run("cd {} && mkdir -p tmp/pids".format(code_dir))
    c.run("cd {} && bundle install --without development test".format(code_dir))
    c.run("cd {} && rails tmp:cache:clear db:migrate RAILS_ENV=production".format(code_dir))
    if (compile == 'true'):
    c.run("cd {} && rails assets:precompile RAILS_ENV=production".format(code_dir))
    c.run("cd {} && rails assets:clean RAILS_ENV=production".format(code_dir))

    c.run("systemctl restart {}".format(service))


    And there is an error:



    Traceback (most recent call last):
    File "/usr/local/bin/fab", line 11, in <module>
    sys.exit(program.run())
    File "/usr/local/lib/python3.7/site-packages/invoke/program.py", line 335, in run
    self.execute()
    File "/usr/local/lib/python3.7/site-packages/invoke/program.py", line 491, in execute
    executor.execute(*self.tasks)
    File "/usr/local/lib/python3.7/site-packages/invoke/executor.py", line 129, in execute
    result = call.task(*args, **call.kwargs)
    File "/usr/local/lib/python3.7/site-packages/invoke/tasks.py", line 128, in __call__
    result = self.body(*args, **kwargs)
    File "/Users/vassa/Projects/pochtagram/fabfile.py", line 11, in deploy
    if not c.run("cd {} && git fetch origin".format(code_dir), warn=True):
    File "<decorator-gen-3>", line 2, in run
    File "/usr/local/lib/python3.7/site-packages/fabric/connection.py", line 29, in opens
    self.open()
    File "/usr/local/lib/python3.7/site-packages/fabric/connection.py", line 541, in open
    self.client.connect(**kwargs)
    File "/usr/local/lib/python3.7/site-packages/paramiko/client.py", line 424, in connect
    passphrase,
    File "/usr/local/lib/python3.7/site-packages/paramiko/client.py", line 714, in _auth
    raise saved_exception
    File "/usr/local/lib/python3.7/site-packages/paramiko/client.py", line 686, in _auth
    filename, pkey_class, passphrase,
    File "/usr/local/lib/python3.7/site-packages/paramiko/client.py", line 551, in _key_from_filepath
    key = klass.from_private_key_file(key_path, password)
    File "/usr/local/lib/python3.7/site-packages/paramiko/pkey.py", line 206, in from_private_key_file
    key = cls(filename=filename, password=password)
    File "/usr/local/lib/python3.7/site-packages/paramiko/rsakey.py", line 48, in __init__
    self._from_private_key_file(filename, password)
    File "/usr/local/lib/python3.7/site-packages/paramiko/rsakey.py", line 169, in _from_private_key_file
    data = self._read_private_key_file('RSA', filename, password)
    File "/usr/local/lib/python3.7/site-packages/paramiko/pkey.py", line 279, in _read_private_key_file
    data = self._read_private_key(tag, f, password)
    File "/usr/local/lib/python3.7/site-packages/paramiko/pkey.py", line 289, in _read_private_key
    raise SSHException('not a valid ' + tag + ' private key file')
    paramiko.ssh_exception.SSHException: not a valid RSA private key file


    Hope smb can help me ...










    share|improve this question

























      0












      0








      0








      I have some problems with deployment throw pip fabric on my new MacBook. There is some issues in google, but what they recommend doesn't work ... Also same config works on High Sierra on another mac, so seems like i'm misunderstanding smth.
      There is my pip packages:



      Package      Version
      ------------ -------
      asn1crypto 0.24.0
      bcrypt 3.1.4
      cffi 1.11.5
      cryptography 2.3.1
      fabric 2.3.1
      idna 2.7
      invoke 1.1.1
      paramiko 2.4.1
      pip 18.1
      pyasn1 0.4.4
      pycparser 2.18
      PyNaCl 1.2.1
      setuptools 40.6.3
      six 1.11.0
      wheel 0.32.3


      And this is my fab file:



      from fabric import Connection
      from invoke import task

      @task
      def deploy(c, branch='master', directory='*secret*', compile='true'):
      with Connection('*secret*') as c:
      deploy_process(c, branch, directory, compile)

      def deploy_process(c, branch, directory, compile):
      code_dir = '/var/www/' + directory
      service = directory + ".service"
      if not c.run("cd {} && git fetch origin".format(code_dir), warn=True):
      c.run("git clone *also secret repo* {}".format(code_dir))

      c.run("cd {} && git fetch origin".format(code_dir))
      c.run("cd {} && git checkout -f {}".format(code_dir, branch))
      c.run("cd {} && git pull origin {}".format(code_dir, branch))
      if not c.run("test -d {}/tmp/pids".format(code_dir), warn=True):
      c.run("cd {} && mkdir -p tmp/pids".format(code_dir))
      c.run("cd {} && bundle install --without development test".format(code_dir))
      c.run("cd {} && rails tmp:cache:clear db:migrate RAILS_ENV=production".format(code_dir))
      if (compile == 'true'):
      c.run("cd {} && rails assets:precompile RAILS_ENV=production".format(code_dir))
      c.run("cd {} && rails assets:clean RAILS_ENV=production".format(code_dir))

      c.run("systemctl restart {}".format(service))


      And there is an error:



      Traceback (most recent call last):
      File "/usr/local/bin/fab", line 11, in <module>
      sys.exit(program.run())
      File "/usr/local/lib/python3.7/site-packages/invoke/program.py", line 335, in run
      self.execute()
      File "/usr/local/lib/python3.7/site-packages/invoke/program.py", line 491, in execute
      executor.execute(*self.tasks)
      File "/usr/local/lib/python3.7/site-packages/invoke/executor.py", line 129, in execute
      result = call.task(*args, **call.kwargs)
      File "/usr/local/lib/python3.7/site-packages/invoke/tasks.py", line 128, in __call__
      result = self.body(*args, **kwargs)
      File "/Users/vassa/Projects/pochtagram/fabfile.py", line 11, in deploy
      if not c.run("cd {} && git fetch origin".format(code_dir), warn=True):
      File "<decorator-gen-3>", line 2, in run
      File "/usr/local/lib/python3.7/site-packages/fabric/connection.py", line 29, in opens
      self.open()
      File "/usr/local/lib/python3.7/site-packages/fabric/connection.py", line 541, in open
      self.client.connect(**kwargs)
      File "/usr/local/lib/python3.7/site-packages/paramiko/client.py", line 424, in connect
      passphrase,
      File "/usr/local/lib/python3.7/site-packages/paramiko/client.py", line 714, in _auth
      raise saved_exception
      File "/usr/local/lib/python3.7/site-packages/paramiko/client.py", line 686, in _auth
      filename, pkey_class, passphrase,
      File "/usr/local/lib/python3.7/site-packages/paramiko/client.py", line 551, in _key_from_filepath
      key = klass.from_private_key_file(key_path, password)
      File "/usr/local/lib/python3.7/site-packages/paramiko/pkey.py", line 206, in from_private_key_file
      key = cls(filename=filename, password=password)
      File "/usr/local/lib/python3.7/site-packages/paramiko/rsakey.py", line 48, in __init__
      self._from_private_key_file(filename, password)
      File "/usr/local/lib/python3.7/site-packages/paramiko/rsakey.py", line 169, in _from_private_key_file
      data = self._read_private_key_file('RSA', filename, password)
      File "/usr/local/lib/python3.7/site-packages/paramiko/pkey.py", line 279, in _read_private_key_file
      data = self._read_private_key(tag, f, password)
      File "/usr/local/lib/python3.7/site-packages/paramiko/pkey.py", line 289, in _read_private_key
      raise SSHException('not a valid ' + tag + ' private key file')
      paramiko.ssh_exception.SSHException: not a valid RSA private key file


      Hope smb can help me ...










      share|improve this question














      I have some problems with deployment throw pip fabric on my new MacBook. There is some issues in google, but what they recommend doesn't work ... Also same config works on High Sierra on another mac, so seems like i'm misunderstanding smth.
      There is my pip packages:



      Package      Version
      ------------ -------
      asn1crypto 0.24.0
      bcrypt 3.1.4
      cffi 1.11.5
      cryptography 2.3.1
      fabric 2.3.1
      idna 2.7
      invoke 1.1.1
      paramiko 2.4.1
      pip 18.1
      pyasn1 0.4.4
      pycparser 2.18
      PyNaCl 1.2.1
      setuptools 40.6.3
      six 1.11.0
      wheel 0.32.3


      And this is my fab file:



      from fabric import Connection
      from invoke import task

      @task
      def deploy(c, branch='master', directory='*secret*', compile='true'):
      with Connection('*secret*') as c:
      deploy_process(c, branch, directory, compile)

      def deploy_process(c, branch, directory, compile):
      code_dir = '/var/www/' + directory
      service = directory + ".service"
      if not c.run("cd {} && git fetch origin".format(code_dir), warn=True):
      c.run("git clone *also secret repo* {}".format(code_dir))

      c.run("cd {} && git fetch origin".format(code_dir))
      c.run("cd {} && git checkout -f {}".format(code_dir, branch))
      c.run("cd {} && git pull origin {}".format(code_dir, branch))
      if not c.run("test -d {}/tmp/pids".format(code_dir), warn=True):
      c.run("cd {} && mkdir -p tmp/pids".format(code_dir))
      c.run("cd {} && bundle install --without development test".format(code_dir))
      c.run("cd {} && rails tmp:cache:clear db:migrate RAILS_ENV=production".format(code_dir))
      if (compile == 'true'):
      c.run("cd {} && rails assets:precompile RAILS_ENV=production".format(code_dir))
      c.run("cd {} && rails assets:clean RAILS_ENV=production".format(code_dir))

      c.run("systemctl restart {}".format(service))


      And there is an error:



      Traceback (most recent call last):
      File "/usr/local/bin/fab", line 11, in <module>
      sys.exit(program.run())
      File "/usr/local/lib/python3.7/site-packages/invoke/program.py", line 335, in run
      self.execute()
      File "/usr/local/lib/python3.7/site-packages/invoke/program.py", line 491, in execute
      executor.execute(*self.tasks)
      File "/usr/local/lib/python3.7/site-packages/invoke/executor.py", line 129, in execute
      result = call.task(*args, **call.kwargs)
      File "/usr/local/lib/python3.7/site-packages/invoke/tasks.py", line 128, in __call__
      result = self.body(*args, **kwargs)
      File "/Users/vassa/Projects/pochtagram/fabfile.py", line 11, in deploy
      if not c.run("cd {} && git fetch origin".format(code_dir), warn=True):
      File "<decorator-gen-3>", line 2, in run
      File "/usr/local/lib/python3.7/site-packages/fabric/connection.py", line 29, in opens
      self.open()
      File "/usr/local/lib/python3.7/site-packages/fabric/connection.py", line 541, in open
      self.client.connect(**kwargs)
      File "/usr/local/lib/python3.7/site-packages/paramiko/client.py", line 424, in connect
      passphrase,
      File "/usr/local/lib/python3.7/site-packages/paramiko/client.py", line 714, in _auth
      raise saved_exception
      File "/usr/local/lib/python3.7/site-packages/paramiko/client.py", line 686, in _auth
      filename, pkey_class, passphrase,
      File "/usr/local/lib/python3.7/site-packages/paramiko/client.py", line 551, in _key_from_filepath
      key = klass.from_private_key_file(key_path, password)
      File "/usr/local/lib/python3.7/site-packages/paramiko/pkey.py", line 206, in from_private_key_file
      key = cls(filename=filename, password=password)
      File "/usr/local/lib/python3.7/site-packages/paramiko/rsakey.py", line 48, in __init__
      self._from_private_key_file(filename, password)
      File "/usr/local/lib/python3.7/site-packages/paramiko/rsakey.py", line 169, in _from_private_key_file
      data = self._read_private_key_file('RSA', filename, password)
      File "/usr/local/lib/python3.7/site-packages/paramiko/pkey.py", line 279, in _read_private_key_file
      data = self._read_private_key(tag, f, password)
      File "/usr/local/lib/python3.7/site-packages/paramiko/pkey.py", line 289, in _read_private_key
      raise SSHException('not a valid ' + tag + ' private key file')
      paramiko.ssh_exception.SSHException: not a valid RSA private key file


      Hope smb can help me ...







      macos python macbook-pro deployment pip






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 15 at 15:17









      Василий СергеевВасилий Сергеев

      11




      11






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "3"
          };
          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%2fsuperuser.com%2fquestions%2f1394565%2ftrouble-with-deploy-throw-pip-fabric-on-macos%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 Super User!


          • 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%2fsuperuser.com%2fquestions%2f1394565%2ftrouble-with-deploy-throw-pip-fabric-on-macos%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

          Сан-Квентин

          Алькесар

          Josef Freinademetz