Wput error size fail - file-upload

I am trying to upload the files to my shared linux hosting domain since i am new to this utility please help me whats going wrong. Details are as follows
domain : mydomain.in
user : ftp_user
pwd : pwd
destination folder : /upload (Permission 777)
host os: windows 7 32 Bit
server : Linux shared hosting
Terminal : cmd with Admistrative Rights
wput bpp_config.ini --verbose -o log.txt ftp://ftp_user:pwd#mydomain.in/upload
output of log.txt
--10:04:02-- `bpp_config.ini'
=> ftp://ftp_user:xxxxx#xxx.xxx.xxx.xx:21/upload
Connecting to xxx.xxx.xx.xx:21... connected# --------- Welcome to Pure-FTPd [privsep] [TLS] ----------
# You are user number 4 of 50 allowed.
# Local time is now 10:04. Server port: 21.
# IPv6 connections are also welcome on this server.
!
==> AUTH TLS ... done (communication is now encrypted!)
Logging in as xxx ... Logged in!
==> SIZE upload ... failed.
==> TYPE I ... done.
Setting data protection level to private ... done.
==> PASV ... done.
connection failed.
==> PORT ... failed.
Send Failed. Waiting 10 seconds... ==> SIZE upload ... failed.
Setting data protection level to private ... done.
==> PASV ... done.
connection failed.
==> PORT ... failed.
Send Failed. Waiting 10 seconds...

The error in your case is not that the SIZE command failed (that's ok if the file doesn't exist yet remotely). However, wput cannot establish a separate data connection to the target server, as you can see through
==> PASV ... done.
connection failed.
==> PORT ... failed.
When running more verbosely (-d) you’ll see to which IP wput is trying to connect. Most likely a firewall is blocking the connection. Try disabling it and it should work.

Related

kex_exchange_identification: Connection closed by remote host

I've wanted to connect my share hosting with ssh. So I generate an ssh key in the ssh action of cpanel and authorized it. Then I've downloaded the private key and drop it in the ./ssh folder of my MacBook.I've used this code to connect my host.
ssh -p 2083 username#host IP
but I got this error:
kex_exchange_identification: Connection closed by remote host
How can I solve my problem?
I run into a similar case with a small computer I have in my desk. What I did to debug the issue was to run sshd -t, which runs the sshd daemon in debug mode. This command reported that the permissions of my keys were invalid. All I had to do then was to go in the folder where the keys are stored and issue chmod 0600 <your_ssh_keys>.
Maybe the action you run generated things with the wrong permissions too.
I got this error when using docker command with remote host
docker -H ssh://user#server compose up
after some digging i found on my remote server in auth logs (/var/log/auth.log) this:
Aug 8 14:51:46 user sshd[1341]: error: beginning MaxStartups throttling
Aug 8 14:51:46 user sshd[1341]: drop connection #10 from [some_ip]:32992 on [some_ip]:22 past MaxStartups
This lead me to change MaxStartups settings in /etc/ssh/sshd_config. After restarting ssh service everything worked like a charm.
I had same problem and it was happend as I use ProxyCommand in ssh config file. In my case the Host was not defined correctly which then caused the same error!

bind() failed: Cannot assign requested address (99) error while executing Selenium based automation test in server

I have code for web ui automation test created with Katalon, I have tried to run it locally and it worked well.
Then I push my code to server but when I run it from server, it failed. It failed to open the web/url that i want.
I generate the code to execute test from server but when I run that code this is happened :
bind failed
then it kept loading the browser until it timed out :
Can anyone suggest/comment or help with a solution for this?
This error message...
[SEVERE]: bind() failed: Cannot assign requested address (99)
...implies that the ChromeDriver was unable to bind the Browsing Context i.e. Chrome Browser session.
Initiating ChromeDriver with --verbose flag would have helped to debug the issue in a better way.
Solution
As per the documentation in [Errno 99] Cannot assign requested address when starting Dockerized web app the probhable cause and the solution would be to:
Close all processes that may be running on your port number. Assuming you are running on port 8000:
lsof -t -i tcp:8000 | xargs kill -9
You are probably using an app adress as localhost or 127.0.0.1 and you need to change it to 0.0.0.0
Another possible reason can be, google-chrome attempted to listen on IPv6 address, which was not enabled. You can either enable IPv6 support (which works only on Linux host) or ignore the error since ChromeDriver process will be listening on IPv4 after initial failed attempts.

x2go Connection failed. bash: bash: command not found

I want to connect from my home pc with VPN (ubuntu-18.04) to work pc (ubuntu 18.04) using x2go.
Server side installation:
sudo add-apt-repository ppa:x2go/stable
sudo apt-get update
sudo apt-get install x2goserver x2goserver-xsession
Client side installation:
sudo apt-get install x2goclient
I am able to ssh to my remote desktop, but x2go doesn't work. Problem seems to be in the server side, since I tried to x2go connect from different computer (CentOs) and error was the same.
Client session preferences window:
I tried almost everything in session preferences, even with RSA key (I have it) or single application session type and many else, always the same error.
Client debug log: (x2goclient --debug)
x2go-INFO-1> "Starting X2Go Client 4.1.2.1..." x2go-WARNING-1> English
language requested, not loading translator. x2go-WARNING-1> English
language requested, not loading translator. Object::connect: No such
slot ONMainWindow::slotCheckAgentProcess() x2go-INFO-3> "Started X2Go
Client." x2go-DEBUG-../src/onmainwindow.cpp:563> "$HOME=/home/XXX"
x2go-DEBUG-../src/onmainwindow.cpp:2242> Reading 1 sessions from
config file. x2go-DEBUG-../src/sessionbutton.cpp:342> Creating QPixmap
with session icon: ":/img/icons/128x128/x2gosession.png".
x2go-DEBUG-../src/onmainwindow.cpp:12843> libssh not initialized yet.
Initializing. x2go-DEBUG-../src/onmainwindow.cpp:2728> Creating
QPixmap with session icon: '":/img/icons/128x128/x2gosession.png"'.
x2go-DEBUG-../src/onmainwindow.cpp:2795> Starting session via Smart
Card, SSH Agent or Kerberos token. x2go-INFO-8> "Starting connection
to server: 192.168.29.15:22" x2go-DEBUG-../src/onmainwindow.cpp:2829>
Starting new ssh connection to server:"192.168.29.15":"22" krbLogin:
false x2go-DEBUG-../src/sshmasterconnection.cpp:175>
SshMasterConnection, host "192.168.29.15"; port 22; user "XXX";
useproxy false; proxyserver "192.168.29.15"; proxyport 22
x2go-DEBUG-../src/sshmasterconnection.cpp:248> Starting SSH connection
without Kerberos authentication.
x2go-DEBUG-../src/sshmasterconnection.cpp:252> SshMasterConnection,
instance SshMasterConnection(0x56102247dbe0) created.
x2go-DEBUG-../src/sshmasterconnection.cpp:520> SshMasterConnection,
instance SshMasterConnection(0x56102247dbe0) entering thread.
x2go-DEBUG-../src/sshmasterconnection.cpp:840> Session port before
config file parse: 22 x2go-DEBUG-../src/sshmasterconnection.cpp:850>
Session port after config file parse: 22
x2go-DEBUG-../src/sshmasterconnection.cpp:915> Session port before
config file parse (part 2): 22
x2go-DEBUG-../src/sshmasterconnection.cpp:925> Session port after
config file parse (part 2): 22
x2go-DEBUG-../src/sshmasterconnection.cpp:950> cserverAuth
x2go-DEBUG-../src/sshmasterconnection.cpp:991> state: 1
x2go-DEBUG-../src/sshmasterconnection.cpp:1364> userAuthAuto failed:""
(code 1)
x2go-DEBUG-../src/sshmasterconnection.cpp:1274> Trying password
mechanism if available.
x2go-DEBUG-../src/sshmasterconnection.cpp:1278> Password mechanism
available. Continuing.
x2go-DEBUG-../src/sshmasterconnection.cpp:726> User authentication OK.
x2go-DEBUG-../src/sshmasterconnection.cpp:1789> LOGIN CHECK:"LOGIN OK
" x2go-DEBUG-../src/sshmasterconnection.cpp:1792> don't have
interaction x2go-DEBUG-../src/sshmasterconnection.cpp:1825> LOOP
FINISHED x2go-DEBUG-../src/sshmasterconnection.cpp:1829> No
interaction needed, continue session
x2go-DEBUG-../src/sshmasterconnection.cpp:735> Login Check - OK
x2go-DEBUG-../src/onmainwindow.cpp:2923> SSH connection established.
x2go-DEBUG-../src/onmainwindow.cpp:3336> Continue normal X2Go session
x2go-DEBUG-../src/sshprocess.cpp:199> Executing remote command via
SshProcess object 0: "x2golistsessions"
x2go-DEBUG-../src/sshprocess.cpp:213> this=SshProcess(0x5610224a1f30)
Running masterCon->addChannelConnection(this, '
"1d4dfc1a-7f4d-4f00-b39e-07273d3d973d" ', ' "bash -l -c 'echo
"X2GODATABEGIN:1d4dfc1a-7f4d-4f00-b39e-07273d3d973d"; export
PATH="/usr/local/bin:/usr/bin:/bin";export TERM="dumb";
x2golistsessions; echo "X2GODATAEND:1d4dfc1a-7f4d-4f00-b39e-07273d"
'); x2go-DEBUG-../src/sshmasterconnection.cpp:1891> Locking SSH
channel connection MUTEX.
x2go-DEBUG-../src/sshmasterconnection.cpp:1893> Passing new channel
connection object to channelConnections.
x2go-DEBUG-../src/sshmasterconnection.cpp:1895> Unlocking SSH channel
connection MUTEX. x2go-DEBUG-../src/sshmasterconnection.cpp:2083>
Creating new channel.
x2go-DEBUG-../src/sshmasterconnection.cpp:2100> New
channel:0x7fcf84012aa0
x2go-DEBUG-../src/sshmasterconnection.cpp:2185> Executing remote:
"bash -l -c 'echo
"X2GODATABEGIN:1d4dfc1a-7f4d-4f00-b39e-07273d3d973d"; export
PATH="/usr/local/bin:/usr/bin:/bin";export TERM="dumb";
x2golistsessions; echo
"X2GODATAEND:1d4dfc1a-7f4d-4f00-b39e-07273d3d973d";'"
x2go-DEBUG-../src/sshmasterconnection.cpp:2208> New exec channel
created.
x2go-DEBUG-../src/sshmasterconnection.cpp:2257> EOF on channel
0x7fcf84012aa0; SshProcess object: 0
x2go-DEBUG-../src/sshmasterconnection.cpp:2380> EOF sent.
x2go-DEBUG-../src/sshmasterconnection.cpp:2384> Channel closed.
x2go-DEBUG-../src/sshprocess.cpp:526> SSH finished: raw output
(stdout): "" x2go-DEBUG-../src/sshprocess.cpp:532> Have stderr only,
something must be wrong. x2go-DEBUG-../src/sshprocess.cpp:537> SSH
finished: false - "bash: bash: command not found " (0).
x2go-DEBUG-../src/onmainwindow.cpp:3804> "bash: bash: command not
found
If someone was interested, I can show server's side /var/log/syslog
Thank you for your help
Please try moving your .bashrc aside and retry.
It was my bad, silly me. I had a typo in /etc/environment file and I didn't notice it because I haven't restarted my PC after that typo. After fixing it, it worked.

Monit EXEC not working when monitored process dies

using Monit 5.15 on FreeBSD 10.2:
set daemon 5
set logfile syslog
set pidfile /var/run/monit.pid
set idfile /var/.monit.id
set statefile /var/.monit.state
set alert x#y.z
set mailserver localhost
set httpd port 2812 and
use address 192.168.40.72
allow 192.168.20.0/24
allow admin:monit
check process haproxy with pidfile /var/run/haproxy.pid
if failed host 192.168.40.72 port 9090 type tcp
then exec "/bin/sh -c '/bin/echo `/bin/date` >> /tmp/monit.test'"
When i run monit with -vI and i kill haproxy, i have the following output:
Adding net allow '192.168.20.0/24'
Adding credentials for user 'admin'
Runtime constants:
Control file = /usr/local/etc/monitrc
Log file = syslog
Pid file = /var/run/monit.pid
Id file = /var/.monit.id
State file = /var/.monit.state
Debug = True
Log = True
Use syslog = True
Is Daemon = True
Use process engine = True
Poll time = 5 seconds with start delay 0 seconds
Expect buffer = 256 bytes
Mail server(s) = localhost:25 with timeout 30 seconds
Mail from = (not defined)
Mail subject = (not defined)
Mail message = (not defined)
Start monit httpd = True
httpd bind address = 192.168.40.72
httpd portnumber = 2812
httpd ssl = Disabled
httpd signature = Enabled
httpd auth. style = Basic Authentication and Host/Net allow list
Alert mail to = root#localhost
Alert on = All events
The service list contains the following entries:
Process Name = haproxy
Pid file = /var/run/haproxy.pid
Monitoring mode = active
Existence = if does not exist then restart
Port = if failed [192.168.40.72]:9090 type TCP/IP protocol DEFAULT with timeout 5 seconds then exec '/bin/sh -c /bin/echo `/bin/date` >> /tmp/monit.test'
System Name = appsrv01
Monitoring mode = active
-------------------------------------------------------------------------------
pidfile '/var/run/monit.pid' does not exist
Starting Monit 5.15 daemon with http interface at [192.168.40.72]:2812
Starting Monit HTTP server at [192.168.40.72]:2812
Monit HTTP server started
'appsrv01' Monit 5.15 started
Sending Monit instance changed notification to root#localhost
'haproxy' process is running with pid 42999
'haproxy' zombie check succeeded
'haproxy' succeeded testing protocol [DEFAULT] at [192.168.40.72]:9090 [TCP/IP]
'haproxy' connection succeeded to [192.168.40.72]:9090 [TCP/IP]
'haproxy' process is running with pid 42999
'haproxy' zombie check succeeded
'haproxy' succeeded testing protocol [DEFAULT] at [192.168.40.72]:9090 [TCP/IP]
'haproxy' connection succeeded to [192.168.40.72]:9090 [TCP/IP]
'haproxy' process is running with pid 42999
'haproxy' zombie check succeeded
'haproxy' succeeded testing protocol [DEFAULT] at [192.168.40.72]:9090 [TCP/IP]
'haproxy' connection succeeded to [192.168.40.72]:9090 [TCP/IP]
'haproxy' process test failed [pid=42999] -- No such process
'haproxy' process is not running
Sending Does not exist notification to root#localhost
'haproxy' trying to restart
'haproxy' stop skipped -- method not defined
'haproxy' start method not defined
'haproxy' monitoring enabled
'haproxy' process test failed [pid=42999] -- No such process
'haproxy' process is not running
'haproxy' trying to restart
'haproxy' stop skipped -- method not defined
'haproxy' start method not defined
'haproxy' monitoring enabled
^CShutting down Monit HTTP server
Monit HTTP server stopped
Monit daemon with pid [48685] stopped
'appsrv01' Monit 5.15 stopped
Sending Monit instance changed notification to root#localhost
The EXEC Line never gets executed, i dont see any new lines in /tmp/monit.test
If i change the checked Port from 9090 to some invalid port, lets say 9190 and start monit (haproxy is running !), i see:
Starting Monit 5.15 daemon with http interface at [192.168.40.72]:2812
Starting Monit HTTP server at [192.168.40.72]:2812
Monit HTTP server started
'appsrv01' Monit 5.15 started
Sending Monit instance changed notification to root#localhost
'haproxy' process is running with pid 50703
'haproxy' zombie check succeeded
Socket test failed for [192.168.40.72]:9190 -- Connection refused
'haproxy' failed protocol test [DEFAULT] at [192.168.40.72]:9190 [TCP/IP] -- Connection refused
Sending Connection failed notification to root#localhost
'haproxy' exec: /bin/sh
'haproxy' process is running with pid 50703
'haproxy' zombie check succeeded
Socket test failed for [192.168.40.72]:9190 -- Connection refused
'haproxy' failed protocol test [DEFAULT] at [192.168.40.72]:9190 [TCP/IP] -- Connection refused
'haproxy' exec: /bin/sh
Why does the EXEC Line works here but not when i kill -9 haproxy ?
What i'm trying to do is get monit to run the exec in case of a haproxy failure. the exec line will then contain a command to switch the CARP IP to another host.
haproxy itself is monitored using zabbix, so the NOC can investigate the cause of the failure later.
When you kill -9 haproxy you're killing the daemon. So when monit performs this "check process" block, it's detecting that the process isn't there and restarting the process. It doesn't perform the check on that port because it sees the process isn't there.
It works when you give it an invalid port because the process is still alive. When it performs the port check it will fail that and run the script.
You should add an additional line to this check block that says
check process haproxy with pidfile /var/run/haproxy.pid
if failed host 192.168.40.72 port 9090 type tcp
then exec "/bin/sh -c '/bin/echo `/bin/date` >> /tmp/monit.test'"
if restarted then exec "/bin/sh -c '/bin/echo `/bin/date` >>/tmp/monit.test'"
This should run the shell commands on both a restart AND a failed host.

SSL handshake with ActiveMQ server gives NullPointerException when connecting via SilverTunnel netlib

Summary
Connecting to ActiveMQ via TCP works fine with or without netlib.
Connecting via SSL works fine without netlib but fails with netlib.
Note: I'm using apache-activemq-5.6.0 and silvertunnel.org_netlib-0.14-beta.
This problem occurs whether using netlib's tcpipNetLayer or torNetLayer. However, only the tcpipNetLayer case is considered here to keep things simple.
BTW, SSL + netlib worked fine with the HornetQ messaging server (which implements SSL authentication differently) but HornetQ had problems that led me to try using ActiveMQ.
For convenience I have created a simple test case with a consumer and two different producers.
producer connects without netlib - works fine.
producer-tcpip connects with neltib using the tcpipNetLayer - the following errors occur:
With SSL debugging turned on for ActiveMQ the producer-tcpip program outputs to the console the following error message and then hangs:
ActiveMQ Transport: ssl://null:0, handling exception: java.lang.NullPointerException
This is midway through an SSL handshake because the producer-tcpip program generates the log4j message:
DEBUG org.apache.activemq.transport.failover.FailoverTransport - Attempting 0th connect to: ssl://localhost:61616
DEBUG org.apache.activemq.transport.WireFormatNegotiator - Sending: WireFormatInfo { version=9, properties={MaxFrameSize=104857600, CacheSize=1024, CacheEnabled=true, SizePrefixDisabled=false, MaxInactivityDurationInitalDelay=10000, TcpNoDelayEnabled=true, MaxInactivityDuration=30000, TightEncodingEnabled=true, StackTraceEnabled=true}, magic=[A,c,t,i,v,e,M,Q]}
Then when the producer-tcpip program is killed (e.g. with a ctrl+C) then the activemq.log reports that:
WARN | Transport Connection to: tcp://127.0.0.1:49463 failed: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake | org.apache.activemq.broker.TransportConnection.Transport | ActiveMQ Transport: ssl:///127.0.0.1:49463
ERROR | Could not accept connection from tcp://127.0.0.1:49463: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake | org.apache.activemq.broker.TransportConnector | ActiveMQ Task-3
I have no idea what could be causing this or how it can be resolved. Can anyone help?
Steps to reproduce the problem (takes under 15 minutes):
download the test case
wget http://anandavala.info/miscl/testing-AMQ-Netlib-SSL.zip
unzip testing-AMQ-Netlib-SSL.zip
rm testing-AMQ-Netlib-SSL.zip
cd testing-AMQ-Netlib-SSL
Download latest ActiveMQ into the testing directory
wget https://www.apache.org/dist/activemq/apache-activemq/5.6.0/apache-activemq-5.6.0-bin.tar.gz
tar -xzf apache-activemq-5.6.0-bin.tar.gz
rm apache-activemq-5.6.0-bin.tar.gz
Edit conf/activemq.xml to accept ssl
gedit apache-activemq-5.6.0/conf/activemq.xml
replace the transportConnectors entry with the following lines (to enable SSL)
<transportConnectors>
<transportConnector name="ssl" uri="ssl://0.0.0.0:61616?needClientAuth=true"/>
</transportConnectors>
<sslContext>
<sslContext
keyStore="broker.ks" keyStorePassword="password"
trustStore="client.ks" trustStorePassword="password"/>
</sslContext>
start server
cd apache-activemq-5.6.0
bin/activemq start
view logging output
tail -f data/activemq.log
open another console then cd into the testing-AMQ-Netlib-SSL directory
Download latest SilverTunnel netlib into the testing directory
wget http://sourceforge.net/projects/silvertunnel/files/silvertunnel_Netlib/silvertunnel.org_netlib-0.14-beta.zip
unzip silvertunnel.org_netlib-0.14-beta.zip
rm silvertunnel.org_netlib-0.14-beta.zip
compile the source code into three runnable jar files in separate directories
ant
run the consumer
cd consumer
./consumer
open another console then cd into the testing-AMQ-Netlib-SSL/producer directory
run the producer
./producer
let it run for a bit to satisfy yourself that it works then kill the producer by hitting ctrl+C
run the producer-tcpip
cd ../producer-tcpip
./producer-tcpip
let it run for a bit to satisfy yourself that it has stalled at a NullPointerException then kill the producer-tcpip by hitting ctrl+C
notice the debug message in producer-tcpip's output
tail -f logs/output.log
also notice the error message that appears at the bottom of activemq.log (see the tail output from the first console window) or type at the current prompt
tail -f ../apache-activemq-5.6.0/data/activemq.log
Thanks for your help!