denshoproject / ddr-cmdln

Command-line tools for automating the Densho Digital Repository's various processes.
Other
0 stars 2 forks source link

Error when creating new collection #52

Closed gjost closed 6 years ago

gjost commented 6 years ago

When creating a new collection the collection gets written to disk but UI shows an error.

NOTE: this is 1_12_2018_newobjerror in slack.

gjost commented 6 years ago

Phillip: collection creation error_additional info

Traceback

Environment:

Request Method: GET
Request URL: http://192.168.56.101/ui/collection/ddr-testing/new-idservice/

Django Version: 1.7.11
Python Version: 2.7.13
Installed Applications:
('django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'bootstrap_pagination',
 'djcelery',
 'gunicorn',
 'rest_framework',
 'sorl.thumbnail',
 'ddrlocal',
 'storage',
 'webui')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware')

Traceback:
File "/opt/ddr-local/venv/ddrlocal/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  111.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/opt/ddr-local/ddrlocal/webui/decorators.py" in wrapper
  24.         return f(*args, **kwargs)
File "/opt/ddr-local/ddrlocal/webui/views/decorators.py" in inner
  19.         return func(request, *args, **kwargs)
File "/opt/ddr-local/ddrlocal/storage/decorators.py" in inner
  84.         return func(request, *args, **kwargs)
File "/opt/ddr-local/ddrlocal/webui/views/collections.py" in new_idservice
  287.     collection = _create_collection(request, cidentifier, git_name, git_mail)
File "/opt/ddr-local/ddrlocal/webui/views/collections.py" in _create_collection
  227.     exit,status = Collection.new(cidentifier, git_name, git_mail, settings.AGENT)
File "/opt/ddr-local/venv/ddrlocal/lib/python2.7/site-packages/ddr_cmdln-0.9.4b0-py2.7.egg/DDR/models/__init__.py" in new
  727.             agent=agent
File "/opt/ddr-local/venv/ddrlocal/lib/python2.7/site-packages/ddr_cmdln-0.9.4b0-py2.7.egg/DDR/commands.py" in wrapper
  51.         return f(*args, **kwargs)
File "/opt/ddr-local/venv/ddrlocal/lib/python2.7/site-packages/ddr_cmdln-0.9.4b0-py2.7.egg/DDR/commands.py" in wrapper
  33.         return f(*args, **kwargs)
File "/opt/ddr-local/venv/ddrlocal/lib/python2.7/site-packages/ddr_cmdln-0.9.4b0-py2.7.egg/DDR/commands.py" in create
  308.     dvcs.annex_set_description(repo, dvcs.annex_status(repo), drive_label=drive_label)
File "/opt/ddr-local/venv/ddrlocal/lib/python2.7/site-packages/ddr_cmdln-0.9.4b0-py2.7.egg/DDR/dvcs.py" in annex_set_description
  900.     annex_description = annex_get_description(repo, annex_status)
File "/opt/ddr-local/venv/ddrlocal/lib/python2.7/site-packages/ddr_cmdln-0.9.4b0-py2.7.egg/DDR/dvcs.py" in annex_get_description
  864.     return _annex_parse_description(annex_status, uuid)
File "/opt/ddr-local/venv/ddrlocal/lib/python2.7/site-packages/ddr_cmdln-0.9.4b0-py2.7.egg/DDR/dvcs.py" in _annex_parse_description
  844.     for key in annex_status.iterkeys():

Exception Type: AttributeError at /ui/collection/ddr-testing/new-idservice/
Exception Value: 'NoneType' object has no attribute 'iterkeys'
gjost commented 6 years ago

Phillip:

densho@ddreditor:/var/www/media/ddr/ddr-testing-40040$ cat .git/config | grep uuid
        uuid = b414aaea-23e8-472b-b1d8-4ffbfec4824c
densho@ddreditor:/var/www/media/ddr/ddr-testing-40040$ git annex version
git-annex version: 6.20170101.1
build flags: Assistant Webapp Pairing Testsuite S3(multipartupload)(storageclasses) WebDAV Inotify DBus DesktopNotify ConcurrentOutput TorrentParser MagicMime Feeds Quvi
key/value backends: SHA256E SHA256 SHA512E SHA512 SHA224E SHA224 SHA384E SHA384 SHA3_256E SHA3_256 SHA3_512E SHA3_512 SHA3_224E SHA3_224 SHA3_384E SHA3_384 SKEIN256E SKEIN256 SKEIN512E SKEIN512 SHA1E SHA1 MD5E MD5 WORM URL
remote types: git gcrypt p2p S3 bup directory rsync web bittorrent webdav tahoe glacier ddar hook external
local repository version: 5
supported repository versions: 3 5 6
upgrade supported from repository versions: 0 1 2 3 4 5
operating system: linux x86_64
densho@ddreditor:/var/www/media/ddr/ddr-testing-40040$ git annex info
git-annex: .git/annex/misctmp/mergedrefs.0: createDirectory: permission denied (Permission denied)
failed
git-annex: info: 1 failed
densho@ddreditor:/var/www/media/ddr/ddr-testing-40040$ sudo git annex info
[sudo] password for densho:
repository mode: indirect
trusted repositories: 0
semitrusted repositories: 3
        00000000-0000-0000-0000-000000000001 -- web
        00000000-0000-0000-0000-000000000002 -- bittorrent
        b414aaea-23e8-472b-b1d8-4ffbfec4824c -- ddr@ddreditor:/media/qnfs/kinkura/gold/ddr-testing-40040 [here]
untrusted repositories: 0
transfers in progress: none
available local disk space: 18.19 terabytes (+1 megabyte reserved)
local annex keys: 0
local annex size: 0 bytes
annexed files in working tree: 0
size of annexed files in working tree: 0 bytes
bloom filter size: 32 mebibytes (0% full)
backend usage:
densho@ddreditor:/var/www/media/ddr/ddr-testing-40040$
gjost commented 6 years ago

The specific problem is that dvcs.annex_status is returning None and dvcs._annex_parse_description is running annex_status.iterkeys() on None.

Why is dvcs.annex_status returning None?

pkikawa commented 6 years ago

is there anything i can do to check?

gjost commented 6 years ago

Might be problem with git-annex version. git annex version reports version as 6.20170101.1 but DDR.dvcs.annex_status only checks for versions 3 or 5.

I'm still running debian8 so my git-annex is still version 5 so I haven't seen this error condition.

gjost commented 6 years ago

Should be fixed as of commit 98dc3a8.

Converted the git-annex major version (e.g. 3, 5, 6) into an int. The if/elif allows for a change in git-annex's UI for getting version info, so choices are now v3 or v5 or above.