giftless icon indicating copy to clipboard operation
giftless copied to clipboard

Error when pulling, after push worked fine

Open NeatNit opened this issue 4 years ago • 4 comments

Hi, I'm trying to get Git LFS working using local storage on a Raspberry Pi. Just Git was so easy - just set up SSH - but LFS is proving annoyingly hard. Seems like Giftless is just what I need!

I installed giftless from Pypi using these instructions, and I'm running it with the uwsgi command listed there, not with the flask development server from the Getting Started guide. I'm also using 192.168.0.35:5000 instead of 127.0.0.1:8080, but I don't think that should make a difference. (should it?)

I'm following the "Getting Started" guide and thought everything was going relatively smoothly, I was able to push two PNG files (instead of bin) and see similarly-sized files appear in storage. However, when I tried pulling from a different clone this happened:

2021-07-05 23:12:51,917 giftless.app    ERROR Exception on /neatnit/hello/objects/storage/bf6d84c4eb78fce5b34ef70a74a492227783328301096ee375b77cdf30d844b8 [GET]
Traceback (most recent call last):
  File "/srv/git-lfs-server/giftless/venv/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/srv/git-lfs-server/giftless/venv/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/srv/git-lfs-server/giftless/venv/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/srv/git-lfs-server/giftless/venv/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/srv/git-lfs-server/giftless/venv/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/srv/git-lfs-server/giftless/venv/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/srv/git-lfs-server/giftless/venv/lib/python3.7/site-packages/flask_classful.py", line 301, in proxy
    response = view(**request.view_args)
  File "/srv/git-lfs-server/giftless/venv/lib/python3.7/site-packages/giftless/auth/__init__.py", line 90, in decorated_function
    return f(*args, **kwargs)
  File "/srv/git-lfs-server/giftless/venv/lib/python3.7/site-packages/flask_classful.py", line 269, in inner
    return fn(*args, **kwargs)
  File "/srv/git-lfs-server/giftless/venv/lib/python3.7/site-packages/giftless/transfer/basic_streaming.py", line 85, in get
    filename = safe_filename(filename)
  File "/srv/git-lfs-server/giftless/venv/lib/python3.7/site-packages/giftless/util.py", line 84, in safe_filename
    return ''.join(c for c in original_filename if c in valid_chars)
TypeError: 'NoneType' object is not iterable
[pid: 1949|app: 0|req: 63/63] 192.168.0.35 () {28 vars in 1277 bytes} [Mon Jul  5 23:12:51 2021] GET /neatnit/hello/objects/storage/bf6d84c4eb78fce5b34ef70a74a492227783328301096ee375b77cdf30d844b8?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImtpZCI6ImdpZnRsZXNzLWludGVybmFsLWp3dC1rZXkifQ.eyJleHAiOjE2MjU1MTYwMzEsImlhdCI6MTYyNTUxNTk3MSwibmJmIjoxNjI1NTE1OTcxLCJzdWIiOm51bGwsIm5hbWUiOiJhbm9ueW1vdXMiLCJzY29wZXMiOiJvYmo6bmVhdG5pdC9oZWxsby9iZjZkODRjNGViNzhmY2U1YjM0ZWY3MGE3NGE0OTIyMjc3ODMzMjgzMDEwOTZlZTM3NWI3N2NkZjMwZDg0NGI4OnJlYWQifQ.y5IduY4eMS5XT4Jts6SjgXXYlDt3x8lSPL7Nhp5vJ_M => generated 196 bytes in 4 msecs (HTTP/1.1 500) 2 headers in 103 bytes (1 switches on core 0)

This is repeated over and over as the client tries again and again to get the file.

For reference:

neatnit@neatberrypi:~/Documents $ ls -lA /srv/git-lfs-server/giftless/lfs-storage/neatnit/hello
total 28
-rw-r--r-- 1 neatnit neatnit 12815 Jul  5 22:59 b7a90a039c6b38b403d01ffb84d5ba0b969bfbe4fad7246eeff9c0783a9d1b14
-rw-r--r-- 1 neatnit neatnit  9438 Jul  5 22:33 bf6d84c4eb78fce5b34ef70a74a492227783328301096ee375b77cdf30d844b8

I don't think I did any step wrong when following the guide.

Sorry that this might be more of a support request than a bug/issue! I didn't know where else to ask (and for all I know it might actually be a bug).

NeatNit avatar Jul 05 '21 20:07 NeatNit

Thought this version information might be relevant:

neatnit@neatberrypi:~ $ git lfs version
git-lfs/2.7.1 (GitHub; linux arm; go 1.11.6)
neatnit@neatberrypi:~ $ git version
git version 2.20.1

NeatNit avatar Jul 06 '21 11:07 NeatNit

I just realised this is exactly what #92 is supposed to solve.

NeatNit avatar Jul 06 '21 11:07 NeatNit

Hi @NeatNit, #92 is now merged, please test and close if this is now fixed.

shevron avatar Jul 09 '21 17:07 shevron

Thanks, I'm trying it out now. It did work before you merged by editing that file and adding the fix manually.

FYI: pip install giftless is out of date (do you need to do a version bump or something?), so currently installing from source with git clone. Also, pip install -r requirements.txt fails at some point with error: invalid command 'bdist_wheel' (regardless of whether giftless is installed from pip or from source). To fix/avoid this I had to run pip install wheel before pip install -r requirements.txt. So presumably you can add wheel to the requirements to fix this, can you do that? (I don't actually know anything about pip)

NeatNit avatar Jul 17 '21 18:07 NeatNit