livenson/vcdm — Issue #13: ERROR: CDMI Server gives an error trying to write in database
Author: rrafanell
Created: 2011-11-02 11:50:59+00:00
State: open

CDMI Server gives an error trying to write, list, delete files.

All tests performed through debug port without security, and with strict security flag, but happens the same using security.

In old CDMI server versions all works properly

Correct log creating a "/test" folder:

2011-11-02 12:38:13+0100 [HTTPChannel,14,IP] Request path received: /test//, parameters: {}
2011-11-02 12:38:13+0100 [HTTPChannel,14,IP] Container create/update: /test
2011-11-02 12:38:13+0100 [HTTPChannel,14,IP] Authorizing None to perform write_container on /. ACLs: None
2011-11-02 12:38:13+0100 [HTTPChannel,14,IP] Writing to CouchDB. UID: None, data: {'parent_container': '/', 'name': 'test', 'object': 'container', 'ctime': '2011-11-02 12:38:13.894797', 'fullpath': '/test', 'children': {}, 'metadata': {}}
2011-11-02 12:38:13+0100 [HTTPChannel,14,IP] Appending child 32f3658b5a3d4223b6fda29cc479be15:test/ to a container /
2011-11-02 12:38:13+0100 [HTTPChannel,14,IP] Writing to CouchDB. UID: 83d36db05a3f4984a82ee326f1785def, data: {'children': {u'4f3f329682284ce0a567831e5220f25b': u'venuscolb/', u'32f3658b5a3d4223b6fda29cc479be15': u'test/', u'3e4f8bcec07f408fb6f1f0c3265514ca': u'venusupv/', u'fea2959f73e344c8974aa92d37532996': u'openvpn-2.1.4/'}}
2011-11-02 12:38:14+0100 [HTTPChannel,14,IP] IP - - [02/Nov/2011:11:38:13 +0000] "PUT /test// HTTP/1.1" 201 - "-" "Apache-HttpClient/4.1.1 (java 1.5)"

Incorrect log creating a folder in CDMI Server last version:

2011-11-02 12:06:58+0100 [HTTPChannel,2,IP] Request path received: /venusupv//, parameters: {}
2011-11-02 12:06:58+0100 [HTTPChannel,2,IP] Container create/update: /venusupv
2011-11-02 12:06:58+0100 [HTTPChannel,2,IP] Unhandled Error
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/twisted/protocols/basic.py", line 564, in dataReceived
why = self.lineReceived(line)
File "/usr/lib/python2.7/dist-packages/twisted/web/http.py", line 1551, in lineReceived
self.allContentReceived()
File "/usr/lib/python2.7/dist-packages/twisted/web/http.py", line 1619, in allContentReceived
req.requestReceived(command, path, version)
File "/usr/lib/python2.7/dist-packages/twisted/web/http.py", line 773, in requestReceived
self.process()
--- ---
File "/usr/lib/python2.7/dist-packages/twisted/web/server.py", line 127, in process
self.render(resrc)
File "/usr/lib/python2.7/dist-packages/twisted/web/server.py", line 147, in render
body = resrc.render(self)
File "/usr/lib/python2.7/dist-packages/twisted/web/resource.py", line 216, in render
return m(request)
File "/home/storage/cdmi/vcdm/src/vcdm/server/cdmi/container.py", line 115, in render_PUT
status, _, __ = container.create_or_update(self.avatarID, name, container_path, fullpath, {})
File "/home/storage/cdmi/vcdm/src/vcdm/container.py", line 40, in create_or_update
acl = cvals['metadata'].get('cdmi_acl', None)
exceptions.TypeError: 'NoneType' object is not subscriptable

The vcdm.conf file of server:

[general]
# Comma separated list of blob backends. Each entry must correspond to a
# separate section with configuration
blob.backends = bsc

# Choose default blob backend to use if a user did not specify her desire.
blob.default.backend = bsc

# (EXPERIMENTAL) Add support for message queues
support_mq = no

# (Optional - only if support_mq is set to 'yes').
# Choose which backend to use for message queue operations. Available options are listed below.
# options: amqp, aws, azure
mq.backend = amqp

# Pick backend for datastore. Datastore is used for storing all kinds of metadata.
# It is also used for implementing support of CDMI containers.
# options: couchdb
ds.backend = couchdb

# Choose interface and port for production (TLS + AuthN) endpoint.
server.endpoint = localhost:8082

# Debug endpoint is used to provide unencrypted and unauthenticated access to resources.
server.use_debug_port = yes

# Port where to run debug interface (listens on all interfaces).
server.debug_port = 2364

# Authorization mechanism
server.authz = strict

#############################################################
### BACKEND CONFIGURATION ###
#############################################################

# blob backend 1
[bsc]
# options: aws, local, azure, cdmi
type = local
blob.datadir = /commonpool/cdmistorage

# blob backend 2
[office_1]
# options: aws, local, azure, cdmi
type = local
blob.datadir = data2

[amqp]
# If MQ with AMQP backend is turned on, provide credentials for accessing AMQP-compatible engine.
mq.endpoint = localhost:5672
mq.username = guest
mq.password = guest

[couchdb]
# Datastore implementation on top of CouchDB.
datastore.endpoint = http://localhost:5984/

#############################################################
### BACKEND TEMPLATES ###
#############################################################

[local]
# If local backend for blob was chosen, specify path to
# the folder where blob's content shall be stored.
blob.datadir = /commonpool/cdmistorage

[aws]
# For blob and mq backends also Amazon Web Services could be used.
# Provide your access key and secret access key to be able to use the service.
credentials.username = ACCESSKEYID
credentials.password = SECRETACCESSKEY
aws.bucket_name = cdmi-proxy

[azure]
# To be able to use MS Azure cloud for MQ and blob backends, provide your Azure data credentials.
credentials.account = ACCOUNTNAME
credentials.password = SECRETACCESSKEY
credentials.blob_url = blob.core.windows.net
credentials.table_url = table.core.windows.net
credentials.queue_url = queue.core.windows.net
azure.bucket_name = cdmi-proxy

[cdmi]
# CDMI-backends
credentials.username = aaa
credentials.password = aaa
cdmi.endpoint = http://localhost:8082/

Of course, ports 8082: 2364, 2365 are open ;)

Thank's!

Roger