paramiko / paramiko/paramiko

Using Fabric, When put() is called, some files are failing upload with size mismatch.

Open
#1,133 14 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
9.9k
Forks
2.1k
PR merge metrics
No merged PRs in 30d

Description

I'm trying to upload simple text file to a remote server
and it fails

Using Python 2.7
Paramiko 2.4.0 (from within Fabric)
On Mac OSX Sierra
To (target machine): Ubunto 14.04 on Amazon EC2

Other templates pass, so there is some kind of an inconsistency.

Warning: put() encountered an exception while uploading '<StringIO.StringIO instance at 0x105ef15a8>'

Traceback (most recent call last):
  File "/Users/ccc/.virtualenvs/py2.7/lib/python2.7/site-packages/fabric/operations.py", line 399, in put
    mode, local_is_path, temp_dir)
  File "/Users/xxx/.virtualenvs/py2.7/lib/python2.7/site-packages/fabric/sftp.py", line 256, in put
    rattrs = putter(local_path, remote_path)
  File "/Users/xxx/.virtualenvs/py2.7/lib/python2.7/site-packages/paramiko/sftp_client.py", line 692, in putfo
    'size mismatch in put!  {} != {}'.format(s.st_size, size))
IOError: size mismatch in put!  16753 != 16747

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with paramiko/sftp_client.py at the putfo() call shown in the traceback, then reproduce the upload through Fabric using the reported StringIO input. Compare the local and remote sizes involved in the check and review the existing issue comments for context. Done means the reported upload no longer produces a size mismatch and the behavior is covered by an appropriate regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.