0

I have a ubuntu web server that uses a chron job to connected to a third party sftp, pull a file and disconnect. This was working for a few weeks and has stopped.

I tried to manually SSH into the sftp from my webserver and I got the following error:

shell request failed on channel 0

This lead me to https://stackoverflow.com/questions/27021641/how-to-fix-request-failed-on-channel-0

This gave me lsof /dev/pts/* to see what open files I have

sudo lsof /dev/pts/*
COMMAND  PID   USER       FD   TYPE DEVICE SIZE/OFF NODE NAME
bash    1513 ubuntu    0u   CHR  136,0      0t0    3 /dev/pts/0
bash    1513 ubuntu    1u   CHR  136,0      0t0    3 /dev/pts/0
bash    1513 ubuntu    2u   CHR  136,0      0t0    3 /dev/pts/0
bash    1513 ubuntu  255u   CHR  136,0      0t0    3 /dev/pts/0
sudo    1670   root    0u   CHR  136,0      0t0    3 /dev/pts/0
sudo    1670   root    1u   CHR  136,0      0t0    3 /dev/pts/0
sudo    1670   root    2u   CHR  136,0      0t0    3 /dev/pts/0
lsof    1671   root    0u   CHR  136,0      0t0    3 /dev/pts/0
lsof    1671   root    1u   CHR  136,0      0t0    3 /dev/pts/0
lsof    1671   root    2u   CHR  136,0      0t0    3 /dev/pts/0

If I'm understanding this correctly I have 255 instances of a psuedo terminal open from my script. As such if I'm not completely wrong I have two problems. One is that I need to close those so that I can get my code working again and secondly I need to fix my code such that it closes this properly.

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.