MarketSquare / SSHLibrary

Robot Framework test library for SSH and SFTP
http://marketsquare.github.io/SSHLibrary/
Other
156 stars 137 forks source link

SSHLibrary.Put Directory: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb7 in position 18: invalid start byte #226

Closed Aufschlauer closed 5 years ago

Aufschlauer commented 6 years ago

From time to time we've problems using the SSHLibrary.Put Directory keyword. Last time putting a directory structure stops at a PNG file. At that time it was easy to solve by deleting the PNG image. But right now Copying the directory structure stops at a shared library - a binary file.

In both cases I get an encoding issue:

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb7 in position 18: invalid start byte

This time a don't know a solution - I can't continue.

Also to mention: Pythons run in venv environment.

Here comes the trace of the operations:

DEB [20180424-15:59:47.628] thr=2   paramiko.transport.sftp: [chan 1] stat(b'/tmp/VNE/modules/pcan/libpcanbasic.so.4.2.0')
DEB [20180424-15:59:47.629] thr=2   paramiko.transport.sftp: [chan 1] stat(b'/')
DEB [20180424-15:59:47.631] thr=2   paramiko.transport.sftp: [chan 1] stat(b'/tmp')
DEB [20180424-15:59:47.632] thr=2   paramiko.transport.sftp: [chan 1] stat(b'/tmp/VDA')
DEB [20180424-15:59:47.633] thr=2   paramiko.transport.sftp: [chan 1] stat(b'/tmp/VDA/modules')
DEB [20180424-15:59:47.634] thr=2   paramiko.transport.sftp: [chan 1] stat(b'/tmp/VDA/modules/pcan')
DEB [20180424-15:59:47.636] thr=2   paramiko.transport.sftp: [chan 1] open(b'/tmp/VDA/modules/pcan/libpcanbasic.so.4.2.0', 'wb')
DEB [20180424-15:59:47.637] thr=2   paramiko.transport.sftp: [chan 1] open(b'/tmp/VDA/modules/pcan/libpcanbasic.so.4.2.0', 'wb') -> b'00000000'
DEB [20180424-15:59:47.637] thr=2   paramiko.transport.sftp: [chan 1] chmod(b'/tmp/VDA/modules/pcan/libpcanbasic.so.4.2.0', 484)
DEB [20180424-15:59:47.693] thr=3   paramiko.transport.sftp: [chan 1] close(b'00000000')
DEB [20180424-15:59:47.693] thr=3   paramiko.transport: Dropping user packet because connection is dead.
DEB [20180424-15:59:47.706] thr=3   paramiko.transport: [chan 0] EOF sent (0)
DEB [20180424-15:59:47.706] thr=3   paramiko.transport: Dropping user packet because connection is dead.
DEB [20180424-15:59:47.706] thr=3   paramiko.transport: Dropping user packet because connection is dead.

This looks like a encoding issue, but both sides (source and target) use

LANG=en_US.UTF-8

Steps to reproduce

Well, here I can't actually provide steps. Copying libpcanbasic.so.4.2.0 worked for weeks, but as of today it stopped working.

Current behavior

Copying the directory structure stopped at copying libpcanbasic.so.4.2.0 with the error

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb7 in position 18: invalid start byte

Expected behavior

I expect that the libpcanbasic.so.4.2.0 is copied as any other file.

Version

DEB [20180424-16:33:30.409] thr=1   paramiko.transport: Local version/idstring: SSH-2.0-paramiko_2.0.4
DEB [20180424-16:33:30.543] thr=1   paramiko.transport: Remote version/idstring: SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu1
INF [20180424-16:33:30.543] thr=1   paramiko.transport: Connected (version 2.0, client OpenSSH_7.2p2)

SSH Library 2.1.2 commit 6735654a82f24d067eb8200584e5aad84b83b1c0
mihaiparvu commented 6 years ago

This sounds like a Paramiko issue. There is a similar issue opened on their GitHub page.

BeniGroza commented 5 years ago

Hi

I tried to reproduce this error but without succeeding. I got the UnicodeDecodeError only with RIDE, and it seems it comes from RIDE code. If you are using another environment like intelliJ or command line, can you provide your list of packages (pip freeze)? BR

Aufschlauer commented 5 years ago

Well, we've encountered the problem on a linux shell.

But, the truth is we've moved on: We couldn't find a fix for the root cause and so we switched to a recent version of the SSHLibrary. So, I'am no longer able to reproduce this issue.

BeniGroza commented 5 years ago

I'll close this issue for now. It can be re-opened in case someone still get this error. If this happen, providing a concrete example and steps to reproduce will help us a lot to fix it. BR