denshoproject / ddr-local

Web UI used for interacting with DDR collections and entities on a local machine.
Other
3 stars 0 forks source link

Can't add objects #178

Closed gjost closed 10 years ago

gjost commented 10 years ago

Clicked "Add object", got these alert messages:

Error: Could not get new object IDs from workbench. ×
Could not get object IDs (not found in page http://partner.densho.org/workbench/kiroku/ddr-janm-7/)
Environment:

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

Django Version: 1.6.2
Python Version: 2.7.3
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',
 '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 "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
  114.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/src/ddr-local/ddrlocal/webui/decorators.py" in wrapper
  22.         return f(*args, **kwargs)
File "/usr/local/src/ddr-local/ddrlocal/webui/views/decorators.py" in inner
  19.         return func(request, *args, **kwargs)
File "/usr/local/src/ddr-local/ddrlocal/storage/decorators.py" in inner
  74.         return func(request, *args, **kwargs)
File "/usr/local/src/ddr-local/ddrlocal/webui/views/entities.py" in new
  309.     entity_ids = api.entities_next(request, repo, org, cid, 1)
File "/usr/local/src/ddr-local/ddrlocal/webui/api.py" in entities_next
  191.         raise Exception('Could not get object IDs (not found in page %s)' % new_eid_url)

Exception Type: Exception at /ui/ddr-testing-246/new/
Exception Value: Could not get object IDs (not found in page http://partner.densho.org/workbench/kiroku/ddr-testing-246/)
gjost commented 10 years ago

Here's a fragment of the HTML returned by the POST in webui.api.entities_next in line 81:

<!DOCTYPE html>
<html lang="en"><head><meta charset="utf-8"/><title>Log in | Densho Digital Repository</title><meta content="width=device-width, initial-scale=1.0" name="viewport"/><

It looks like while the user is logged in to the local VM, they are not logged in to the workbench server. After logging out and logging back in (note: as a different user) I was able to create a new object. For now it looks like it's not a code problem.

gjost commented 10 years ago

The fix is to alert the user that they are not logged in to the workbench server and that they should log in and try again.