Getting Error: pexpect not installed, try: pip install pexpect - pexpect

Configuring Rundeck remote windows node using py-winrm. Successfully configured using Basic Auth, then trying to configure to use Kerberos I started getting an error meeting the requirements for Py-Winrm.
Rundeck 3.3.11 with py-winrm on Windows Server 2016 Server. Getting an error connecting to remote host running a Command job.
Error: pexpect not installed, try: pip install pexpect
Python3.9.6
verified pexpect 4.8.0 installed using pip list
I've tried;
uninstalled/reinstalled pexpect and Python and restarted Windows after Python reinstall and Rundeck Service after each change.
Any help would be greatly appreciated.
Thank you

Go to Project Settings > Edit Configuration and click on the "Default Node Executor" tab, (make sure that you're using "WinRM Node Executor Python" as default node executor), on the "Python Interpreter" textbox put the python3 binary full path (the python3 path that you're used to installing the pexpect module). Same for the "Default file copier" tab.

Related

NSIS: Access https site in ExecDos

I'm trying to create an installer for a python based scientific application. We use Anaconda as a python distribution and I found https://github.com/faph/NSIS-Conda-Macros to help me setup an installer for conda packages.
However, downloading the miniconda installer failed. I was able to solve that with the help of:
Download of file during NSIS installer run freezes at "connecting"
But I found no way to make the updating of packages work. They use:
ExecDos::exec /DETAILED '"$CONDA" update -y -q conda' "" ""
conda then tries to connect over https to get the most recent packages from their server. The connection always times out. When i run the same code directly in cmd it runs fine.
So my question:
Is it even possible to access https in ExecDos::exec? Does anyone have an idea to work-around the issue?

Apache fails to start as Windows service with mod_wsgi

I'm using Apache 2.4, Python 3.5 and appropriate mod_wsgi from Gohlike binaries page, everything is 64-bit. Apache works as intended when it's started manually, but when I'm trying to start it as service it fails and produces
httpd.exe: Syntax error on line 180 of C:/Apache24/httpd.conf: Cannot load c:/Users/<Username>/AppData/Local/Programs/Python/Python35/Lib/site-packages/mod_wsgi/server/mod_wsgi.cp35-win_amd64.pyd
into server: \xcd\xe5 \xed\xe0\xe9\xe4\xe5\xed
\xf3\xea\xe0\xe7\xe0\xed\xed\xfb\xe9 \xec\xee\xe4\xf3\xeb\xfc
(Specified module could not be found).
to Windows event log.
Problem is solved. The error occured because Python installation wasn't system-wide.
Add python to path before install
set PATH=E:\python35;%PATH%
httpd.exe -k uninstall
httpd.exe -k install

Could not execute Node.js Cloud9

I am trying to use Cloud9 IDE on a server. I added the SSH key and once I try to SSH into the server the error message
Could not execute node.js on root#xxx.xxx.xxx.xxx
appears.
I have nodejs installed on the server, v0.10.25
You need to install the package "nodejs-legacy".
apt-get install nodejs-legacy
The SSH dialog allows you to set the path to the Node.js binary. That should solve your issue.
I found it is necessary to scroll down and click on the advanced tab. Then I entered /usr/bin/nodejs from my "which nodejs" output in my SSH session. This worked for me even though the documentation states AWS tries to do this by default. That left me in the AWS file work space on the server I ssh'ed into as desired.
nodejs was not installed on my EC2 instance, so I installed using the instructions from the following link, and it work perfectly. Tutorial: Setting Up Node.js on an Amazon EC2 Instance
sudo apt-get install nodejs worked for me

how to setup devpi-server for pypi pip searching

I am using a a devpi-server to locally cache and install pypi packages using pip. However when I search for packages using the devpi server I get the following error:
pypi.xyz.com is the name of the server
ProtocolError: <ProtocolError for pypi.xyz.com:33141/root/pypi/+simple/: 405 Method Not Allowed>
Note that install work just fine
Edit: I am using a proxy that is allowed to access pypi.xyz.com by setting http_proxy before calling the pip command. The proxy is working fine and allows access to the pypi.xyz.com server as you can run the pip install commands without any trouble.
pip.conf:
[global]
[install]
index-url = http://pypi.xyz.com:33141/root/pypi/+simple/
[search]
index = http://pypi.xyz.com:33141/root/pypi/+simple/
Adding the clarifications requested by #JanVlcinsky:
1. Installed devpi using pypi
2. None of the default settings were modified except the port change
3. Protocol Error is in the console when I use pip with the following environment variable set
export http_proxy=http://localhost:33128
Changed port to 33141 Just for some obfuscation security, try to avoid using defaults
It is an http_proxy (running locally using squid)
You can find the answer in the "using pip search" section of the official doc:
pip install -q -U devpi-web
devpi-server --stop
devpi-server --recreate-search-index
devpi-server --start

knife-windows: Network Error: getaddrinfo: Name or service not known (windows:22)

I have an Ubuntu workstation and i'm trying to bootstrap a windows node. The windows node has ssh open on port 2222. I've been following http://docs.opscode.com/plugin_knife_windows.html.
ateetor#ateetor-virtual-machine:~/chef/chef-repo$ sudo gem install knife-windows --http-proxy=[REMOVED]
Successfully installed knife-windows-0.5.12
1 gem installed
Installing ri documentation for knife-windows-0.5.12...
Installing RDoc documentation for knife-windows-0.5.12...
ateetor#ateetor-virtual-machine:~/chef/chef-repo$ sudo knife bootstrap windows ssh 10.29.3.114 -x chef -P SSHuser1! -N test -p 2222 -VV
DEBUG: Looking for bootstrap template in /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/knife/bootstrap
DEBUG: Found bootstrap template in /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/knife/bootstrap
Bootstrapping Chef on windows
DEBUG: Adding windows
DEBUG: establishing connection to windows:2222
ERROR: Network Error: getaddrinfo: Name or service not known
Check your knife configuration and network settings
To me what that looks like is it's trying to use the word windows as part of the IP; however my syntax matches the guide so i don't know why. Does anyone have any ideas on how to fix this?
If you look at the output it's running the generic bootstrap template.
Looking for bootstrap template in /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/knife/bootstrap
Most likely there is an installation or ruby environment issue resolving the knife-windows gem.
When correctly configured you should see:
Looking for bootstrap template in /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/knife-windows-0.5.12/lib/chef/knife/bootstrap
The only fix I have found is to use knife from a windows workstation instead of a linux one.
knife bootstrap windows winrm 111.22.33.44.compute-1.amazonaws.com -x Administrator -P "asdklfj329" -N "windows-2008-551"
Enjoy :)
I have faced the similar issue.One of the reasons for this might be you knife-windows gem package is not installed in expected location.
knife-windows resolves target hostname ,if its not properly installed winrm knife cant resolve targetname.So to overcome this install knife-windows as below
To install the knife windows plugin using RubyGems, run the following command:
$ /opt/chef/embedded/bin/gem install knife-windows
if properly installed you should be able to find knife-windows at
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/

Resources