Is Net::SFTP failing because of SSH? - perl

I have trouble connecting with Net::SFTP to a remote server. I ran the same script before on another machine with success, however, I get now the following error:
[root#script-server fmzbih_cms_weather_updater]# ./fmzbih_cms_forecast.pl
script-server.bih.net.ba: Reading configuration data /root/.ssh/config
script-server.bih.net.ba: Reading configuration data /etc/ssh_config
script-server.bih.net.ba: Allocated local port 1023.
script-server.bih.net.ba: Connecting to 10.100.4.193, port 22.
script-server.bih.net.ba: Remote protocol version ., remote software version
script-server.bih.net.ba: Net::SSH::Perl Version 1.34, protocol version 1.5.
script-server.bih.net.ba: No compat match: .
script-server.bih.net.ba: Connection established.
Can't locate object method "_session_channel" via package "Net::SSH::Perl::SSH1" at /usr/local/lib/perl5/site_perl/5.14.2/Net/SFTP.pm line 78.
Could this be because of SSH1 being used as shown in log? Shouldn't SFTP use SSH2?

Related

Adafruit minimqtt on Pi Pico H with Wiznet RP2040 ethernet hat "RuntimeError: Failed to establish connection."

I'm trying to use the adafruit minimqtt library on a Pi Pico H, running circuitpython. I've been following this guide
I'm using a mosquito broker on my windows 10 laptop and connecting directly through an ethernet cable to the Wiznet hat, as in the tutorial. The code I'm using is copied directly from the example with the following changes:
changed the IP address on line 22 to that of my windows machine
uncommneted lines 68 and 70, and commented out line 73 to avoid using DHCP (someone else on the github has noted that the dhcp doesn't work). Also deleted the extra space in line 70
I get the following error:
Traceback (most recent call last):
File "<stdin>", line 84, in <module>
File "/lib/adafruit_minimqtt/adafruit_minimqtt.py", line 441, in connect
File "/lib/adafruit_minimqtt/adafruit_minimqtt.py", line 266, in _get_connect_socket
File "/lib/adafruit_wiznet5k/adafruit_wiznet5k_socket.py", line 246, in connect
File "/lib/adafruit_wiznet5k/adafruit_wiznet5k.py", line 570, in socket_connect
RuntimeError: Failed to establish connection.
I've looked through each of the scripts referenced and can't find any obvious errors (I'm not an expert in this so there might be something I've missed). I can't find anyone who's experienced this same error code, any help here would be appreciated.
I've tried running the first half of the code (up to line 68), and then pinging the pico from my laptop. I've also pinged my laptop from the board. Both were successful, so I don't think it's a hardware issue.
I've double checked that my broker is not in local mode. My .conf file contains
listener 1883
allow_anonymous true
and when I run mosquitto I get
C:\Users\me1xmtx\mosquitto>mosquitto -c rem.conf -v
1676306316: mosquitto version 2.0.15 starting
1676306316: Config loaded from rem.conf.
1676306316: Opening ipv6 listen socket on port 1883.
1676306316: Opening ipv4 listen socket on port 1883.
1676306316: mosquitto version 2.0.15 running
TCP (and UDP just in case) ports 1883 are open on the windows laptop

failed to find free socket port for process dispatcher when trying remote debug

Highlights:
windows 10 host machine
ubuntu vagrant box (virtualbox) as guest vm
using vagrant port forwarding as like this: config.vm.network "forwarded_port", guest: 1234, host: 12340
IDE: IntelliJ IDEA with Ruby plugin
The Issue:
I've tried to set up remote ruby debug following this guide and getting an error in IDE: "failed to find free socket port for process dispatcher". It looks this issue is not IntelliJ-specific, I was able to reproduce it with latest RubyMine as well.
From IDEA's log
2017-07-07 21:53:03,515 [8879188] INFO - tion.impl.ExecutionManagerImpl - Failed to find free socket port for process dispatcher
com.intellij.execution.ExecutionException: Failed to find free socket port for process dispatcher
at org.jetbrains.plugins.ruby.ruby.debugger.RubyProcessDispatcher.<init>(RubyProcessDispatcher.java:46)
at org.jetbrains.plugins.ruby.ruby.debugger.RubyRemoteDebugRunner.doExecute(RubyRemoteDebugRunner.java:62)
...
Caused by: java.net.BindException: Address already in use: JVM_Bind
at java.net.TwoStacksPlainSocketImpl.socketBind(Native Method)
at java.net.TwoStacksPlainSocketImpl.socketBind(TwoStacksPlainSocketImpl.java:137)
...
I can understand it says Address already in use: JVM_Bind, but how remote debug supposed to work at all then? (I mean Is there any way to access guest vm port not forwarding it before? Clearly no) Any help to solve this issue is much appreciated.
For me the issue was due to another debug session that was open in the background. To prevent that from happening again (and also close all other currently open sessions, once you run the configuration again) select "Single instance only" in the Debug Configuration:

Differences between pyserial 2.3 and 2.7?

can someone list the differences between pyserial 2.6 and pyserial 2.7
I'm unable to get the release notes for both the releases.
The list is maintained in CHANGES.rst on GitHub.
Version 2.7 2013-10-17
Win32: setRTS and setDTR can be called before the port is opened and it will set the initial state on port open.
Posix: add platform specific method: outWaiting (already present for Win32)
Posix: rename flowControl to setXON to match name on Win32, add flowControlOut function
rfc2217: zero polls value (baudrate, data size, stop bits, parity) (Erik Lundh)
Posix: [Patch pyserial:28] Accept any speed on Linux [update]
Posix: [Patch pyserial:29] PosixSerial.read() should "ignore" errno.EINTR
OSX: [Patch pyserial:27] Scan by VendorID/Product ID for USB Serial devices
Ensure working with bytes in write() calls
Bugfixes:
[Bug 3540332] SerialException not returned
[Bug pyserial:145] Error in socket_connection.py
[Bug pyserial:135] reading from socket with timeout=None causes TypeError
[Bug pyserial:130] setup.py should not append py3k to package name
[Bug pyserial:117] no error on lost conn w/socket://
Bugfixes (posix):
[Patch 3462364] Fix: NameError: global name 'base' is not defined
list_ports and device() for BSD updated (Anders Langworthy)
[Bug 3518380] python3.2 -m serial.tools.list_ports error
[Bug pyserial:137] Patch to add non-standard baudrates to Cygwin
[Bug pyserial:141] open: Pass errno from IOError to SerialException
[Bug pyserial:125] Undefined 'base' on list_ports_posix.py, function usb_lsusb
[Bug pyserial:151] Serial.write() without a timeout uses 100% CPU on POSIX
[Patch pyserial:30] [PATCH 1/1] serial.Serial() should not raise IOError.
Bugfixes (win32):
[Bug 3444941] ctypes.WinError() unicode error
[Bug 3550043] on Windows in tools global name 'GetLastError' is not defined
[Bug pyserial:146] flush() does nothing in windows (despite docs)
[Bug pyserial:144] com0com ports ignored due to missing "friendly name"
[Bug pyserial:152] Cannot configure port, some setting was wrong. Can leave port handle open but port not accessible

The Datastax cassandra community server 2.1.10 service on local computer started and then stopped

I am trying to configure a two node cluster with cassandra in windows r2 2008
So i installed cassandra community version in one server (10.xxx.0.1,10.xxx.0.2)
And then I stopped the service and then edited the configuraton.yaml file in the conf folder.
The changes are:
cluster_name
commented the num_tokens
gave the tokens in initial_token,
seeds as 10.xxx.0.1,10.xxx.0.2,
listen_addresses are their respective ip addresses which are 10.xxx.0.1,10.xxx.0.2,
rpc_addresses as 0.0.0.0,
endpointsnitch as gossip
I also changed the cassandra rackdc.properties file to dc=DC1 rack=RAC1.
I then saved and started back the service and opened the cqlsh, but it is not connecting. Below is the error:
2015-10-12 16:20:13 Commons Daemon procrun stderr initialized
If rpc_address is set to a wildcard address (0.0.0.0), then you must set broadcast_rpc_address to a value other than 0.0.0.0
Fatal configuration error; unable to start. See log for stacktrace.
..
ERROR 21:20:14 Fatal configuration error
org.apache.cassandra.exceptions.ConfigurationException: If rpc_address is set to a wildcard address (0.0.0.0), then you must set broadcast_rpc_address to a value other than 0.0.0.0
at org.apache.cassandra.config.DatabaseDescriptor.applyAddressConfig(DatabaseDescriptor.java:285) ~[apache-cassandra-2.1.10.jar:2.1.10]
at org.apache.cassandra.config.DatabaseDescriptor.applyConfig(DatabaseDescriptor.java:443) ~[apache-cassandra-2.1.10.jar:2.1.10]
at org.apache.cassandra.config.DatabaseDescriptor.<clinit>(DatabaseDescriptor.java:136) ~[apache-cassandra-2.1.10.jar:2.1.10]
at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:168) [apache-cassandra-2.1.10.jar:2.1.10]
at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:562) [apache-cassandra-2.1.10.jar:2.1.10]
at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:651) [apache-cassandra-2.1.10.jar:2.1.10]
If you out 0.0.0.0 to the rpc_address you have to change the broadcast_rpc_address like in http://docs.datastax.com/en/cassandra/2.1/cassandra/configuration/configCassandra_yaml_r.html , I think that the right broadcast_rpc_address can be the own ip address.

Net::SSH::Perl throws error No kex algorithm at /usr/share/perl5/vendor_perl/Net/SSH/Perl/SSH2.pm line 92

I am using Net::SSH::Perl to connect to a Qlogic switch. when it fails with the below error:
No kex algorithm at /usr/share/perl5/vendor_perl/Net/SSH/Perl/SSH2.pm
line 92
Code:
use Net::SSH::Perl;
$ssh = Net::SSH::Perl->new("$switch_name", protocol=>'2,1',debug=>1);
$ssh->login("USER","$pw");
($stdout,$stderr,$exit) = $ssh->cmd("$cmd");
Debug output:
myserver: Reading configuration data /export/home/ibmi1984/.ssh/config
myserver: Reading configuration data /etc/ssh_config
myserver: Connecting to HFDB12PF26A, port 22.
myserver: Remote protocol version 2.0, remote software version OpenSSH_6.7
myserver: Net::SSH::Perl Version 1.34, protocol version 2.0.
.yserver: No compat match: OpenSSH_6.7
myserver: Connection established.
myserver: Sent key-exchange init (KEXINIT), wait response.
No kex algorithm at /usr/share/perl5/vendor_perl/Net/SSH/Perl/SSH2.pm line 92
Could someone please help me fix this. The same code works on other devices, it is just this device which has an issue.
Thank you,
Gary
This issue was fixed by upgrading Net::SSH::Perl to v1.41
Thanks for the tip #daxim