Tmux not starting after closing terminal on freeze session - tmux

My tmux panes became frozen and I decided to close the terminal because I somehow thought that would fix it. Now, when I run the tmux command in my home directory, tmux's usual green bar doesn't show up at the bottom and it looks like I'm being asked to enter input infinitely.
I'm using tmux 3.1 and there are two tmux-client log files in my home directory, which are shown below. The second log file appeared when I was trying to fix the issue. Also, when I try to open the files I was editing using tmux, I get an error saying that swap files were found for them.
tmux-client-92612.log:
1588823002.943027 client started (92612): version 3.1, socket /private/tmp/tmux-501/default, protocol 8
1588823002.943122 on Darwin 19.0.0 Darwin Kernel Version 19.0.0: Thu Oct 17 16:17:15 PDT 2019; root:xnu-6153.41.3~29/RELEASE_X86_64; libevent 2.1.11-stable (select)
1588823002.943243 socket is /private/tmp/tmux-501/default
1588823002.943264 trying connect
1588823002.943339 add peer 0x10adb5000: 6 (0x0)
1588823002.944435 sending message 100 to peer 0x10adb5000 (4 bytes)
1588823002.944453 sending message 101 to peer 0x10adb5000 (15 bytes)
1588823002.944460 sending message 102 to peer 0x10adb5000 (13 bytes)
1588823002.944466 sending message 108 to peer 0x10adb5000 (14 bytes)
1588823002.944483 sending message 104 to peer 0x10adb5000 (0 bytes)
1588823002.944490 sending message 107 to peer 0x10adb5000 (4 bytes)
1588823002.944496 sending message 105 to peer 0x10adb5000 (28 bytes)
1588823002.944502 sending message 105 to peer 0x10adb5000 (16 bytes)
1588823002.944508 sending message 105 to peer 0x10adb5000 (20 bytes)
1588823002.944514 sending message 105 to peer 0x10adb5000 (57 bytes)
1588823002.944520 sending message 105 to peer 0x10adb5000 (25 bytes)
1588823002.944527 sending message 105 to peer 0x10adb5000 (53 bytes)
1588823002.944533 sending message 105 to peer 0x10adb5000 (12 bytes)
1588823002.944541 sending message 105 to peer 0x10adb5000 (66 bytes)
1588823002.944548 sending message 105 to peer 0x10adb5000 (50 bytes)
1588823002.944554 sending message 105 to peer 0x10adb5000 (18 bytes)
1588823002.944560 sending message 105 to peer 0x10adb5000 (17 bytes)
1588823002.944566 sending message 105 to peer 0x10adb5000 (14 bytes)
1588823002.944574 sending message 105 to peer 0x10adb5000 (19 bytes)
1588823002.944580 sending message 105 to peer 0x10adb5000 (8 bytes)
1588823002.944586 sending message 105 to peer 0x10adb5000 (19 bytes)
1588823002.944592 sending message 105 to peer 0x10adb5000 (15 bytes)
1588823002.944598 sending message 105 to peer 0x10adb5000 (22 bytes)
1588823002.944604 sending message 106 to peer 0x10adb5000 (0 bytes)
1588823002.944613 sending message 200 to peer 0x10adb5000 (4 bytes)
1588823002.944619 client loop enter
tmux-client-92706.log:
1588823622.214067 client started (92706): version 3.1, socket /private/tmp/tmux-501/default, protocol 8
1588823622.214123 on Darwin 19.0.0 Darwin Kernel Version 19.0.0: Thu Oct 17 16:17:15 PDT 2019; root:xnu-6153.41.3~29/RELEASE_X86_64; libevent 2.1.11-stable (select)
1588823622.214161 socket is /private/tmp/tmux-501/default
1588823622.214178 trying connect
1588823622.214253 add peer 0x10adba000: 6 (0x0)
1588823622.215324 sending message 100 to peer 0x10adba000 (4 bytes)
1588823622.215342 sending message 101 to peer 0x10adba000 (15 bytes)
1588823622.215348 sending message 102 to peer 0x10adba000 (13 bytes)
1588823622.215354 sending message 108 to peer 0x10adba000 (14 bytes)
1588823622.215370 sending message 104 to peer 0x10adba000 (0 bytes)
1588823622.215376 sending message 107 to peer 0x10adba000 (4 bytes)
1588823622.215382 sending message 105 to peer 0x10adba000 (28 bytes)
1588823622.215388 sending message 105 to peer 0x10adba000 (16 bytes)
1588823622.215393 sending message 105 to peer 0x10adba000 (20 bytes)
1588823622.215399 sending message 105 to peer 0x10adba000 (57 bytes)
1588823622.215405 sending message 105 to peer 0x10adba000 (25 bytes)
1588823622.215410 sending message 105 to peer 0x10adba000 (53 bytes)
1588823622.215416 sending message 105 to peer 0x10adba000 (12 bytes)
1588823622.215422 sending message 105 to peer 0x10adba000 (66 bytes)
1588823622.215427 sending message 105 to peer 0x10adba000 (50 bytes)
1588823622.215433 sending message 105 to peer 0x10adba000 (18 bytes)
1588823622.215438 sending message 105 to peer 0x10adba000 (17 bytes)
1588823622.215444 sending message 105 to peer 0x10adba000 (14 bytes)
1588823622.215450 sending message 105 to peer 0x10adba000 (19 bytes)
1588823622.215455 sending message 105 to peer 0x10adba000 (8 bytes)
1588823622.215461 sending message 105 to peer 0x10adba000 (19 bytes)
1588823622.215466 sending message 105 to peer 0x10adba000 (15 bytes)
1588823622.215472 sending message 105 to peer 0x10adba000 (22 bytes)
1588823622.215477 sending message 106 to peer 0x10adba000 (0 bytes)
1588823622.215485 sending message 200 to peer 0x10adba000 (4 bytes)
1588823622.215491 client loop enter

Sounds like the tmux server has hung. Does it work again if you do pkill -WINCH tmux?
If no, you will need to do pkill -9 tmux and restart it.
Do you remember what you were doing when it hung? Can you reproduce?

Related

BLE: WriteValue of GattCharacteristic doesn't get called

I followed the tutorial from The Bluetooth Technology for Linux Developers Study Guide (I skipped the 5th guide because I'm doing a gatt server), and everything worked fine until I got to Handling Characteristic Writes.
(Also, I am using a Raspberry PI 4 Model B)
In nRF Connect I have the following in the logs:
Writing request to characteristic e95d93ee-251d-470a-a062-fa1922dfa9a8
Data written to e95d93ee-251d-470a-a062-fa1922dfa9a8, value: (0x)68-65-6C-6C-6F, "hello"
"hello" sent
so the data should have been sent.
sudo btmon gives the following:
> ACL Data RX: Handle 64 flags 0x02 dlen 14 #129 [hci0] 82.584227
ATT: Prepare Write Request (0x16) len 9
Handle: 0x0019
Offset: 0x0000
Data: 68656c6c6f
< ACL Data TX: Handle 64 flags 0x00 dlen 14 #130 [hci0] 82.585053
ATT: Prepare Write Response (0x17) len 9
Handle: 0x0019
Offset: 0x0000
Data: 68656c6c6f
> HCI Event: Number of Completed Packets (0x13) plen 5 #131 [hci0] 82.814773
Num handles: 1
Handle: 64
Count: 1
so the data was indeed received. Though I don't understand why it says Prepare Write Request instead of just Write Request.
bluetoothd with -nd flag and tail -f /var/log/syslog gives the following:
Jul 28 09:20:45 raspberrypi bluetoothd[820]: bluetoothd[820]: src/device.c:gatt_debug() (chan 0x1bb9dd0) ATT PDU received: 0x16
Jul 28 09:20:45 raspberrypi bluetoothd[820]: bluetoothd[820]: src/device.c:gatt_debug() Prep Write Req - handle: 0x0019
Jul 28 09:20:45 raspberrypi bluetoothd[820]: src/device.c:gatt_debug() (chan 0x1bb9dd0) ATT PDU received: 0x16
Jul 28 09:20:45 raspberrypi bluetoothd[820]: src/device.c:gatt_debug() Prep Write Req - handle: 0x0019
but there is no reaction using sudo dbus-monitor --system, and nothing either in the program output terminal.
Do you have any Idea where the problem might come from?
(I tried reinstalling nRF Connect twice already, so I think the problem is from somewhere in the Raspberry, but is it from bluez? from dbus? or somewhere else?)
After reinstalling bluez, and not solving anything, I tried with an old samsung tablet, and it works. So it appears my assumption was wrong and the problem could be from my phone.

PostgreSQL SSH Tunnel Connection Within R (ssh_tunnel crashing when trying to connect)

I am trying to connect to a postgreSQL database (hosted on AWS RDS) via an SSH tunnel in R. So far, I have been able to connect using the following methods:
1.---------------------------
Opening the ssh tunnel in my terminal (MacOs) using
ssh -i {key file path} -f -N -L 5432:{db host}:5432 {ssh user}#{ssh host} -v
and then connecting to the database using
psql -hlocalhost -U{db user} -p5432 -dpostgres
2.---------------------------
Opening the ssh tunnel in my terminal and then running the following code in R to connect
conn <- dbConnect(
RPostgres::Postgres(),
dbname = db_name,
user = db_user,
password = db_password,
host = "127.0.0.1",
port = db_port
)
3.---------------------------
This is where the issue occurs. I'm able to connect by opening the ssh tunnel in R (in a background environment) with
tunnel_process <- callr::r_bg(
function(ssh_host, ssh_user, ssh_key, db_host, db_port) {
session <- ssh::ssh_connect(host = glue::glue("{ ssh_user }#{ ssh_host }"),
keyfile = ssh_key,
verbose = 3)
ssh::ssh_tunnel(session = session,
port = db_port,
target = glue::glue("{ db_host }:{ db_port }"))
},
args = list(ssh_host, ssh_user, ssh_key, db_host, db_port),
stdout = nullfile(),
stderr = nullfile()
)
But then I'm unable to use the same "dbConnect" code as above to connect. It only gives me the following error message
Error: could not connect to server: Connection refused
Is the server running on host "127.0.0.1" and accepting
TCP/IP connections on port 5432?
I am however able to connect directly from the terminal using the connection code in part 1. but only if I run psql -hlocalhost -U{db user} -p5432 -dpostgres, then re-run the ssh tunnel code in R, and only THEN enter my password in the terminal. I would appear that every time I try to connect, it closes the SSH tunnel, so I then have to re-launch it before submitting my password.
Question---------------------------
From what I just detailed, it would appear that:
a. My database is reachable since I can easily connect through the terminal
b. My R code works since I'm able to use it to both successfully open the SSH tunnel AND connect to the database. I'm just unable to use both together for some reason.
c. The tunnel I open through R breaks any time I try to connect to the database. This is not the case for the tunnel I open directly in the terminal.
Since I want to be able to do everything directly from R, does anybody here have any ideas on what may be causing the issue?
EDIT---------------------------
Here's the log I get in R when I try to connect to the database, just before it closes the tunnel:
> ssh::ssh_tunnel(session = session,
+ port = db_port,
+ target = glue::glue("{ db_host }:{ db_port }"))
\ Waiting for connetion on port 5432... client connected!
channel_open: Creating a channel 43 with 64000 window and 32768 max packet
ssh_socket_unbuffered_write: Enabling POLLOUT for socket
packet_send2: packet: wrote [len=124,padding=18,comp=105,payload=105]
channel_open: Sent a SSH_MSG_CHANNEL_OPEN type direct-tcpip for channel 43
ssh_packet_socket_callback: packet: read type 80 [len=492,padding=16,comp=475,payload=475]
ssh_packet_process: Dispatching handler for packet type 80
ssh_packet_global_request: Received SSH_MSG_GLOBAL_REQUEST packet
ssh_packet_global_request: UNKNOWN SSH_MSG_GLOBAL_REQUEST hostkeys-00#openssh.com 0
ssh_packet_process: Couldn't do anything with packet type 80
packet_send2: packet: wrote [len=12,padding=6,comp=5,payload=5]
ssh_socket_unbuffered_write: Enabling POLLOUT for socket
ssh_packet_socket_callback: packet: read type 91 [len=28,padding=10,comp=17,payload=17]
ssh_packet_process: Dispatching handler for packet type 91
ssh_packet_channel_open_conf: Received SSH2_MSG_CHANNEL_OPEN_CONFIRMATION
ssh_packet_channel_open_conf: Received a CHANNEL_OPEN_CONFIRMATION for channel 43:0
ssh_packet_channel_open_conf: Remote window : 2097152, maxpacket : 32768
| Tunneled -1 bytes...ssh_socket_unbuffered_write: Enabling POLLOUT for socket
packet_send2: packet: wrote [len=28,padding=10,comp=17,payload=17]
channel_write_common: channel_write wrote 8 bytes
| Tunneled 7 bytes...ssh_packet_socket_callback: packet: read type 94 [len=28,padding=17,comp=10,payload=10]
ssh_packet_process: Dispatching handler for packet type 94
channel_rcv_data: Channel receiving 1 bytes data in 0 (local win=64000 remote win=2097144)
channel_default_bufferize: placing 1 bytes into channel buffer (stderr=0)
channel_rcv_data: Channel windows are now (local win=63999 remote win=2097144)
ssh_socket_unbuffered_write: Enabling POLLOUT for socket
packet_send2: packet: wrote [len=28,padding=18,comp=9,payload=9]
grow_window: growing window (channel 43:0) to 1280000 bytes
ssh_channel_read_timeout: Read (1) buffered : 1 bytes. Window: 1280000
- Tunneled 8 bytes...ssh_socket_unbuffered_write: Enabling POLLOUT for socket
packet_send2: packet: wrote [len=316,padding=17,comp=298,payload=298]
channel_write_common: channel_write wrote 289 bytes
/ Tunneled 297 bytes...ssh_packet_socket_callback: packet: read type 94 [len=3964,padding=12,comp=3951,payload=3951]
ssh_packet_process: Dispatching handler for packet type 94
channel_rcv_data: Channel receiving 3942 bytes data in 0 (local win=1280000 remote win=2096855)
channel_default_bufferize: placing 3942 bytes into channel buffer (stderr=0)
channel_rcv_data: Channel windows are now (local win=1276058 remote win=2096855)
ssh_channel_read_timeout: Read (3942) buffered : 3942 bytes. Window: 1276058
\ Tunneled 4239 bytes...ssh_socket_unbuffered_write: Enabling POLLOUT for socket
packet_send2: packet: wrote [len=156,padding=8,comp=147,payload=147]
channel_write_common: channel_write wrote 138 bytes
- Tunneled 4377 bytes...ssh_packet_socket_callback: packet: read type 94 [len=76,padding=15,comp=60,payload=60]
ssh_packet_process: Dispatching handler for packet type 94
channel_rcv_data: Channel receiving 51 bytes data in 0 (local win=1276058 remote win=2096717)
channel_default_bufferize: placing 51 bytes into channel buffer (stderr=0)
channel_rcv_data: Channel windows are now (local win=1276007 remote win=2096717)
ssh_channel_read_timeout: Read (51) buffered : 51 bytes. Window: 1276007
| Tunneled 4428 bytes...ssh_socket_unbuffered_write: Enabling POLLOUT for socket
packet_send2: packet: wrote [len=140,padding=14,comp=125,payload=125]
channel_write_common: channel_write wrote 116 bytes
\ Tunneled 4544 bytes...ssh_packet_socket_callback: packet: read type 94 [len=60,padding=8,comp=51,payload=51]
ssh_packet_process: Dispatching handler for packet type 94
channel_rcv_data: Channel receiving 42 bytes data in 0 (local win=1276007 remote win=2096601)
channel_default_bufferize: placing 42 bytes into channel buffer (stderr=0)
channel_rcv_data: Channel windows are now (local win=1275965 remote win=2096601)
ssh_channel_read_timeout: Read (42) buffered : 42 bytes. Window: 1275965
/ Tunneled 4586 bytes...ssh_socket_unbuffered_write: Enabling POLLOUT for socket
packet_send2: packet: wrote [len=60,padding=19,comp=40,payload=40]
channel_write_common: channel_write wrote 31 bytes
- Tunneled 4617 bytes...packet_send2: packet: wrote [len=12,padding=6,comp=5,payload=5]
ssh_channel_send_eof: Sent a EOF on client channel (43:0)
ssh_socket_unbuffered_write: Enabling POLLOUT for socket
packet_send2: packet: wrote [len=12,padding=6,comp=5,payload=5]
ssh_channel_close: Sent a close on client channel (43:0)
ssh_socket_unbuffered_write: Enabling POLLOUT for socket
tunnel closed!
For reference, this is what the same log looks like when using the workaround detailed in 3. (re-running the ssh_tunnel right before submitting my password in the terminal):
> ssh::ssh_tunnel(session = session,
+ port = db_port,
+ target = glue::glue("{ db_host }:{ db_port }"))
\ Waiting for connetion on port 5432... client connected!
channel_open: Creating a channel 43 with 64000 window and 32768 max packet
ssh_socket_unbuffered_write: Enabling POLLOUT for socket
packet_send2: packet: wrote [len=124,padding=18,comp=105,payload=105]
channel_open: Sent a SSH_MSG_CHANNEL_OPEN type direct-tcpip for channel 43
ssh_packet_socket_callback: packet: read type 80 [len=492,padding=16,comp=475,payload=475]
ssh_packet_process: Dispatching handler for packet type 80
ssh_packet_global_request: Received SSH_MSG_GLOBAL_REQUEST packet
ssh_packet_global_request: UNKNOWN SSH_MSG_GLOBAL_REQUEST hostkeys-00#openssh.com 0
ssh_packet_process: Couldn't do anything with packet type 80
packet_send2: packet: wrote [len=12,padding=6,comp=5,payload=5]
ssh_socket_unbuffered_write: Enabling POLLOUT for socket
ssh_packet_socket_callback: packet: read type 91 [len=28,padding=10,comp=17,payload=17]
ssh_packet_process: Dispatching handler for packet type 91
ssh_packet_channel_open_conf: Received SSH2_MSG_CHANNEL_OPEN_CONFIRMATION
ssh_packet_channel_open_conf: Received a CHANNEL_OPEN_CONFIRMATION for channel 43:0
ssh_packet_channel_open_conf: Remote window : 2097152, maxpacket : 32768
| Tunneled -1 bytes...ssh_socket_unbuffered_write: Enabling POLLOUT for socket
packet_send2: packet: wrote [len=28,padding=10,comp=17,payload=17]
channel_write_common: channel_write wrote 8 bytes
| Tunneled 7 bytes...ssh_packet_socket_callback: packet: read type 94 [len=28,padding=17,comp=10,payload=10]
ssh_packet_process: Dispatching handler for packet type 94
channel_rcv_data: Channel receiving 1 bytes data in 0 (local win=64000 remote win=2097144)
channel_default_bufferize: placing 1 bytes into channel buffer (stderr=0)
channel_rcv_data: Channel windows are now (local win=63999 remote win=2097144)
ssh_socket_unbuffered_write: Enabling POLLOUT for socket
packet_send2: packet: wrote [len=28,padding=18,comp=9,payload=9]
grow_window: growing window (channel 43:0) to 1280000 bytes
ssh_channel_read_timeout: Read (1) buffered : 1 bytes. Window: 1280000
- Tunneled 8 bytes...ssh_socket_unbuffered_write: Enabling POLLOUT for socket
packet_send2: packet: wrote [len=316,padding=17,comp=298,payload=298]
channel_write_common: channel_write wrote 289 bytes
\ Tunneled 297 bytes...ssh_packet_socket_callback: packet: read type 94 [len=3964,padding=12,comp=3951,payload=3951]
ssh_packet_process: Dispatching handler for packet type 94
channel_rcv_data: Channel receiving 3942 bytes data in 0 (local win=1280000 remote win=2096855)
channel_default_bufferize: placing 3942 bytes into channel buffer (stderr=0)
channel_rcv_data: Channel windows are now (local win=1276058 remote win=2096855)
ssh_channel_read_timeout: Read (3942) buffered : 3942 bytes. Window: 1276058
/ Tunneled 4239 bytes...ssh_socket_unbuffered_write: Enabling POLLOUT for socket
packet_send2: packet: wrote [len=156,padding=8,comp=147,payload=147]
channel_write_common: channel_write wrote 138 bytes
| Tunneled 4377 bytes...ssh_packet_socket_callback: packet: read type 94 [len=76,padding=15,comp=60,payload=60]
ssh_packet_process: Dispatching handler for packet type 94
channel_rcv_data: Channel receiving 51 bytes data in 0 (local win=1276058 remote win=2096717)
channel_default_bufferize: placing 51 bytes into channel buffer (stderr=0)
channel_rcv_data: Channel windows are now (local win=1276007 remote win=2096717)
ssh_channel_read_timeout: Read (51) buffered : 51 bytes. Window: 1276007
- Tunneled 4428 bytes...ssh_socket_unbuffered_write: Enabling POLLOUT for socket
packet_send2: packet: wrote [len=140,padding=14,comp=125,payload=125]
channel_write_common: channel_write wrote 116 bytes
/ Tunneled 4544 bytes...ssh_packet_socket_callback: packet: read type 94 [len=60,padding=8,comp=51,payload=51]
ssh_packet_process: Dispatching handler for packet type 94
channel_rcv_data: Channel receiving 42 bytes data in 0 (local win=1276007 remote win=2096601)
channel_default_bufferize: placing 42 bytes into channel buffer (stderr=0)
channel_rcv_data: Channel windows are now (local win=1275965 remote win=2096601)
ssh_channel_read_timeout: Read (42) buffered : 42 bytes. Window: 1275965
\ Tunneled 4586 bytes...ssh_socket_unbuffered_write: Enabling POLLOUT for socket
packet_send2: packet: wrote [len=92,padding=12,comp=79,payload=79]
channel_write_common: channel_write wrote 70 bytes
- Tunneled 4656 bytes...ssh_packet_socket_callback: packet: read type 94 [len=380,padding=15,comp=364,payload=364]
ssh_packet_process: Dispatching handler for packet type 94
channel_rcv_data: Channel receiving 355 bytes data in 0 (local win=1275965 remote win=2096531)
channel_default_bufferize: placing 355 bytes into channel buffer (stderr=0)
channel_rcv_data: Channel windows are now (local win=1275610 remote win=2096531)
ssh_channel_read_timeout: Read (355) buffered : 355 bytes. Window: 1275610
| Tunneled 5011 bytes...
Finally, here's the log when running ssh_connect:
> session <- ssh::ssh_connect(host = glue::glue("{ ssh_user }#{ ssh_host }"),
+ keyfile = ssh_key,
+ verbose = 3)
ssh_pki_import_privkey_base64: Trying to decode privkey passphrase=false
ssh_connect: libssh 0.8.6 (c) 2003-2018 Aris Adamantiadis, Andreas Schneider and libssh contributors. Distributed under the LGPL, please refer to COPYING file for information about your rights, using threading threads_pthread
ssh_socket_connect: Nonblocking connection socket: 50
ssh_connect: Socket connecting, now waiting for the callbacks to work
ssh_connect: Actual timeout : 10000
ssh_socket_pollcallback: Received POLLOUT in connecting state
socket_callback_connected: Socket connection callback: 1 (0)
ssh_socket_unbuffered_write: Enabling POLLOUT for socket
callback_receive_banner: Received banner: SSH-2.0-OpenSSH_7.4
ssh_client_connection_callback: SSH server banner: SSH-2.0-OpenSSH_7.4
ssh_analyze_banner: Analyzing banner: SSH-2.0-OpenSSH_7.4
ssh_analyze_banner: We are talking to an OpenSSH client version: 7.4 (70400)
ssh_known_hosts_read_entries: Failed to open the known_hosts file '/etc/ssh/ssh_known_hosts': No such file or directory
ssh_client_select_hostkeys: Changing host key method to "ecdsa-sha2-nistp256,ssh-ed25519,ecdsa-sha2-nistp521,ecdsa-sha2-nistp384,ssh-rsa,ssh-dss"
ssh_socket_unbuffered_write: Enabling POLLOUT for socket
packet_send2: packet: wrote [len=644,padding=9,comp=634,payload=634]
ssh_packet_socket_callback: packet: read type 20 [len=1276,padding=10,comp=1265,payload=1265]
ssh_packet_process: Dispatching handler for packet type 20
ssh_kex_select_methods: Negotiated curve25519-sha256,ecdsa-sha2-nistp256,aes256-ctr,aes256-ctr,hmac-sha2-256,hmac-sha2-256,none,none,,
ssh_socket_unbuffered_write: Enabling POLLOUT for socket
packet_send2: packet: wrote [len=44,padding=6,comp=37,payload=37]
ssh_packet_socket_callback: packet: read type 31 [len=260,padding=11,comp=248,payload=248]
ssh_packet_process: Dispatching handler for packet type 31
ssh_packet_dh_reply: Received SSH_KEXDH_REPLY
ssh_socket_unbuffered_write: Enabling POLLOUT for socket
packet_send2: packet: wrote [len=12,padding=10,comp=1,payload=1]
ssh_client_curve25519_reply: SSH_MSG_NEWKEYS sent
ssh_packet_socket_callback: Processing 112 bytes left in socket buffer
ssh_packet_socket_callback: packet: read type 21 [len=12,padding=10,comp=1,payload=1]
ssh_packet_process: Dispatching handler for packet type 21
ssh_packet_newkeys: Received SSH_MSG_NEWKEYS
crypt_set_algorithms2: Set output algorithm to aes256-ctr
crypt_set_algorithms2: Set HMAC output algorithm to hmac-sha2-256
crypt_set_algorithms2: Set input algorithm to aes256-ctr
crypt_set_algorithms2: Set HMAC input algorithm to hmac-sha2-256
ssh_packet_newkeys: Signature verified and valid
ssh_packet_socket_callback: Processing 96 bytes left in socket buffer
ssh_packet_socket_callback: packet: read type 7 [len=60,padding=6,comp=53,payload=53]
ssh_packet_process: Dispatching handler for packet type 7
ssh_packet_ext_info: Received SSH_MSG_EXT_INFO
ssh_packet_ext_info: Follows 1 extensions
ssh_packet_ext_info: Extension: server-sig-algs=<rsa-sha2-256,rsa-sha2-512>
ssh_connect: current state : 7
packet_send2: packet: wrote [len=28,padding=10,comp=17,payload=17]
ssh_service_request: Sent SSH_MSG_SERVICE_REQUEST (service ssh-userauth)
ssh_socket_unbuffered_write: Enabling POLLOUT for socket
ssh_packet_socket_callback: packet: read type 6 [len=28,padding=10,comp=17,payload=17]
ssh_packet_process: Dispatching handler for packet type 6
ssh_packet_service_accept: Received SSH_MSG_SERVICE_ACCEPT
ssh_socket_unbuffered_write: Enabling POLLOUT for socket
packet_send2: packet: wrote [len=44,padding=4,comp=39,payload=39]
ssh_packet_socket_callback: packet: read type 51 [len=60,padding=15,comp=44,payload=44]
ssh_packet_process: Dispatching handler for packet type 51
ssh_packet_userauth_failure: Access denied for 'none'. Authentication that can continue: publickey,gssapi-keyex,gssapi-with-mic
ssh_packet_userauth_failure: Access denied for 'none'. Authentication that can continue: publickey,gssapi-keyex,gssapi-with-mic
ssh_key_algorithm_allowed: Checking rsa-sha2-512 with list <ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa,rsa-sha2-512,rsa-sha2-256,ssh-dss>
ssh_key_algorithm_allowed: Checking rsa-sha2-512 with list <ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa,rsa-sha2-512,rsa-sha2-256,ssh-dss>
ssh_key_algorithm_allowed: Checking rsa-sha2-512 with list <ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa,rsa-sha2-512,rsa-sha2-256,ssh-dss>
ssh_socket_unbuffered_write: Enabling POLLOUT for socket
packet_send2: packet: wrote [len=636,padding=11,comp=624,payload=624]
ssh_packet_socket_callback: packet: read type 52 [len=12,padding=10,comp=1,payload=1]
ssh_packet_process: Dispatching handler for packet type 52
ssh_packet_userauth_success: Authentication successful

I accidentally unplugged NodeMCU while upload an Arduino since the unable to upload anything

I accidentally unplugged NodeMCU while uploading a blink sketch from Arduino IDE since then unable to upload anything, moreover my NodeMCU inbuilt LED stays on when connected to USB.
The code that I was trying to upload was just a blink sketch for inbuilt LED. It gives following error when trying to upload anything.
Sketch uses 247047 bytes (23%) of program storage space. Maximum is 1044464 bytes.
Global variables use 32852 bytes (40%) of dynamic memory, leaving 49068 bytes for local variables. Maximum is 81920 bytes.
error: failed sending 0xC0
error: failed sending 8 bytes
error: failed sending 36 bytes
error: failed sending 0xC0
error: failed sending 0xC0
error: failed sending 8 bytes
error: failed sending 36 bytes
error: failed sending 0xC0
error: failed sending 0xC0
error: failed sending 8 bytes
error: failed sending 36 bytes
error: failed sending 0xC0
error: failed sending 0xC0
error: failed sending 8 bytes
error: failed sending 36 bytes
error: failed sending 0xC0
error: failed sending 0xC0
error: failed sending 8 bytes
error: failed sending 36 bytes
error: failed sending 0xC0
error: failed sending 0xC0
error: failed sending 8 bytes
error: failed sending 36 bytes
error: failed sending 0xC0
error: failed sending 0xC0
error: failed sending 8 bytes
error: failed sending 36 bytes
error: failed sending 0xC0
error: failed sending 0xC0
error: failed sending 8 bytes
error: failed sending 36 bytes
error: failed sending 0xC0
error: failed sending 0xC0
error: failed sending 8 bytes
error: failed sending 36 bytes
error: failed sending 0xC0
warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
error: espcomm_upload_mem failed

Kamailio - WebSocket - Setup

I am an web developer and want to create a WEBRTC application. My knowledge level in SIP is beginner. I want my application to talk to kamailio and in process of setting up kamailio by following the below articles.
http://nil.uniza.sk/sip/kamailio/configuring-kamailio-4x-websocket
http://kamailio.org/docs/modules/4.3.x/modules/websocket.html
I was able to connect (using try.jssp.net) to kamailio as multiple clients for initial setup but unable to call from one browser client to another client. Below is the log message that I see in the kamailio server.
I see this error message multiple times logged
Aug 9 20:27:10 ip-10-94-99-80 /usr/sbin/kamailio[25063]: INFO: <core> [parser/parse_fline.c:146]: parse_first_line(): ERROR:parse_first_line: method not followed by SP
Aug 9 20:27:10 ip-10-94-99-80 /usr/sbin/kamailio[25063]: ERROR: <core> [parser/parse_fline.c:243]: parse_first_line(): parse_first_line: bad message (offset: 0)
Aug 9 20:27:10 ip-10-94-99-80 /usr/sbin/kamailio[25063]: DEBUG: <core> [parser/msg_parser.c:619]: parse_msg(): parse_msg: invalid message
Aug 9 20:27:10 ip-10-94-99-80 /usr/sbin/kamailio[25063]: ERROR: <core> [parser/msg_parser.c:705]: parse_msg(): ERROR: parse_msg: message=<#001#020#002#021#037?#037?#012^cP#012^cP#001#020#002#026?A#037?H#0229w>
Aug 9 20:27:10 ip-10-94-99-80 /usr/sbin/kamailio[25063]: ERROR: <core> [receive.c:149]: receive_msg(): core parsing of SIP message failed (10.94.99.80:8088/1)
and also found this in the log
DEBUG: <core> [dset.c:774]: uri_add_rcv_alias(): encoded <sip:d63im5st#avltu6trdhg0.invalid;transport=ws;ob> => [sip:d63im5st#avltu6trdhg0.invalid;transport=ws;ob;alias=172.18.57.119~60481~5]
Aug 9 20:27:33 ip-10-94-99-80 /usr/sbin/kamailio[25074]: DEBUG: nathelper [nathelper.c:965]: add_contact_alias_0_f(): contact uri host is not an ip address
Aug 9 20:27:33 ip-10-94-99-80 /usr/sbin/kamailio[25074]: ERROR: nathelper [nathelper.c:977]: add_contact_alias_0_f(): you can't call add_contact_alias twice, check your config!
Aug 9 20:27:33 ip-10-94-99-80 /usr/sbin/kamailio[25074]: ERROR: <script>: Error aliasing contact <<sip:d63im5st#avltu6trdhg0.invalid;transport=ws;ob>>
Additional log info
Aug 9 20:27:10 ip-10-94-99-80 /usr/sbin/kamailio[25072]: DEBUG: websocket [ws_frame.c:661]: ws_frame_receive(): Rx SIP message:#012REGISTER sip:ip-10-94-99-80.customdomain.com SIP/2.0#015#012Via: SIP/2.0/WS avltu6trdhg0.invalid;branch=z9hG4bK6572200#015#012Max-Forwards: 69#015#012To: <sip:agent01#ip-10-94-99-80.customdomain.com>#015#012From: "agent01" <sip:agent01#ip-10-94-99-80.customdomain.com>;tag=68gqn060sb#015#012Call-ID: 22oik6ujj2bfjuuauasgdq#015#012CSeq: 1 REGISTER#015#012Contact: <sip:d63im5st#avltu6trdhg0.invalid;transport=ws>;+sip.ice;reg-id=1;+sip.instance="<urn:uuid:74809558-6d30-42c3-afbd-072d5d0ad5ab>";expires=600#015#012Expires: 600#015#012Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER#015#012Supported: path,gruu,outbound#015#012User-Agent: JsSIP 0.7.3#015#012Content-Length: 0#015#012#015#012
Aug 9 20:27:15 ip-10-94-99-80 /usr/sbin/kamailio[25073]: DEBUG: websocket [ws_frame.c:661]: ws_frame_receive(): Rx SIP message:#012REGISTER sip:ip-10-94-99-80.customdomain.com SIP/2.0#015#012Via: SIP/2.0/WS egvf3nqhdl35.invalid;branch=z9hG4bK4737687#015#012Max-Forwards: 69#015#012To: <sip:agent02#ip-10-94-99-80.customdomain.com>#015#012From: "agent02" <sip:agent02#ip-10-94-99-80.customdomain.com>;tag=8dldgic783#015#012Call-ID: v4rim0ku5dtqrtqkcgv0an#015#012CSeq: 1 REGISTER#015#012Contact: <sip:bh9ao5ab#egvf3nqhdl35.invalid;transport=ws>;+sip.ice;reg-id=1;+sip.instance="<urn:uuid:f593c0a4-0984-46a0-8f3e-a231fb4d1713>";expires=600#015#012Expires: 600#015#012Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER#015#012Supported: path,gruu,outbound#015#012User-Agent: JsSIP 0.7.3#015#012Content-Length: 0#015#012#015#012
Aug 9 20:27:33 ip-10-94-99-80 /usr/sbin/kamailio[25074]: DEBUG: websocket [ws_frame.c:661]: ws_frame_receive(): Rx SIP message:#012INVITE sip:agent02#ip-10-94-99-80.customdomain.com SIP/2.0#015#012Via: SIP/2.0/WS avltu6trdhg0.invalid;branch=z9hG4bK9231290#015#012Max-Forwards: 69#015#012To: <sip:agent02#ip-10-94-99-80.customdomain.com>#015#012From: "agent01" <sip:agent01#ip-10-94-99-80.customdomain.com>;tag=jngmrtvvec#015#012Call-ID: s1fdqticqc31ru6p5cfs#015#012CSeq: 9973 INVITE#015#012X-Can-Renegotiate: true#015#012Contact: <sip:d63im5st#avltu6trdhg0.invalid;transport=ws;ob>#015#012Content-Type: application/sdp#015#012Session-Expires: 90#015#012Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER#015#012Supported: timer,ice,replaces,outbound#015#012User-Agent: JsSIP 0.7.3#015#012Content-Length: 3876#015#012#015#012v=0#015#012o=- 7098982196661734965 2 IN IP4 127.0.0.1#015#012s=-#015#012t=0 0#015#012a=group:BUNDLE audio video#015#012a=msid-semantic: WMS XynF2020ZZYtShWgfoYkS23q5sgbtcquUl0s#015#012m=audio 56249 RTP/SAVPF 111 103 104 9 0 8 106 105 13 126#015#012c=IN IP4 172.18.57.119#015#012a=rtcp:54672 IN IP4 172.18.57.119#015#012a=candidate:2390899093 1 udp 2122260223 172.18.57.119 56249 typ host generation 0#015#012a=candidate:1221703924 1 udp 2122194687 192.168.0.105 60197 typ host generation 0#015#012a=candidate:2390899093 2 udp 2122260222 172.18.57.119 54672 typ host generation 0#015#012a=candidate:1221703924 2 udp 2122194686 192.168.0.105 54423 typ host generation 0#015#012a=candidate:3221341541 1 tcp 1518280447 172.18.57.119 0 typ host tcptype active generation 0#015#012a=candidate:106054660 1 tcp 1518214911 192.168.0.105 0 typ host tcptype active generation 0#015#012a=candidate:3221341541 2 tcp 1518280446 172.18.57.119 0 typ host tcptype active generation 0#015#012a=candidate:106054660 2 tcp 1518214910 192.168.0.105 0 typ host tcptype active generation 0#015#012a=ice-ufrag:Las7oILW40BIM8zF#015#012a=ice-pwd:A3ewod5vG57HcA/JvnAaRGWV#015#012a=fingerprint:sha-256 31:22:C5:67:B6:CB:D0:66:7D:E4
Aug 9 20:27:33 ip-10-94-99-80 /usr/sbin/kamailio[25074]: DEBUG: websocket [ws_frame.c:661]: ws_frame_receive(): Rx SIP message:#012ACK sip:agent02#ip-10-94-99-80.customdomain.com SIP/2.0#015#012Via: SIP/2.0/WS avltu6trdhg0.invalid;branch=z9hG4bK9231290#015#012To: <sip:agent02#ip-10-94-99-80.customdomain.com>;tag=5f994d94abde79a17171e171202b0e42.d13e#015#012From: "agent01" <sip:agent01#ip-10-94-99-80.customdomain.com>;tag=jngmrtvvec#015#012Call-ID: s1fdqticqc31ru6p5cfs#015#012CSeq: 9973 ACK#015#012Content-Length: 0#015#012#015#012
Any help is appreciated
So you should check your kamailio.cfg, I think config is broken.
And maybe you want to use Asterisk or Freeswitch for WebRTC and PBX. You can find the Kamailio and Freeswitch integration tutorial here:
http://kb.asipto.com/freeswitch:kamailio-3.1.x-freeswitch-1.0.6d-sbc
It will be good choice using Kamailio as routing and registar server. Generally we use Freeswitch or Asterisk as media server for these kind of operations.
Please feel free ask me any questions.

channel 0/1 got hung up in asterisk

I am trying to make a outgoing from an asterisk pbx using .call file but every time .call file is moved in outgoing folder my cli shows
[Jun 16 15:38:12] NOTICE[30435]: pbx_spool.c:372 attempt_thread: Call failed to go through, reason (1) Hangup
[Jun 16 15:38:12] NOTICE[30435]: pbx_spool.c:375 attempt_thread: Queued call to DAHDI/g0/09716927126 expired without completion after 0 attempts
-- Span 1: Channel 0/1 got hangup request, cause 16
-- Hungup 'DAHDI/i1/09711590094-103a'
[Jun 16 15:38:17] NOTICE[30434]: pbx_spool.c:372 attempt_thread: Call failed to go through, reason (1) Hangup
[Jun 16 15:38:17] NOTICE[30434]: pbx_spool.c:375 attempt_thread: Queued call to DAHDI/g0/09711590094 expired without completion after 0 attempts
-- Attempting call on DAHDI/g0/09711590094 for 4759509#outgoing1:1 (Retry 1)
-- Attempting call on DAHDI/g0/09716927126 for 4759509#outgoing1:1 (Retry 1)
-- Requested transfer capability: 0x00 - SPEECH
-- Requested transfer capability: 0x00 - SPEECH
-- Span 1: Channel 0/2 got hangup request, cause 31
-- Hungup 'DAHDI/i1/09716927126-103d'
my .call file
Channel: DAHDI/g0/09711590094
MaxRetries: 1
RetryTime: 600
WaitTime: 30
Context: outgoing1
Extension: 10
Priority: 1
The call could not be connected.Anybody knows what would be the possible reason for that?
Thanks in advance
This error mean you can't call as requested via dahdi/g0
Very likly you have configure correctly your dahdi card.

Resources