apache / apache/openwhisk

Namespaces with a leading '_' character result in cloudant failures

Open
#2,830 6 comments 0 reactions 0 assignees View on GitHub
bug controller
Dominant language
Scala
Stars
6.8k
Forks
1.2k
Avg merge
2d 14h
Merged PRs (30d)
2

Description

When creating an action (or any other entity) in a namespace having a name that has a `_` as the leading character, the controller encounters the following error when saving the entity document in cloudant
```
[ERROR] [#tid_385] [CouchDbRestStore] [PUT] 'whisks' failed to put document: 'id: _xyz/abc, rev: null'; http status: '400 Bad Request' [marker:database_saveDocument_error:18:3]
```
As shown, the cloudant document id is based off of the entity's fully qualified name - which starts with the namespace name; in this example, the namespace is `_xyz`. According to https://console.bluemix.net/docs/services/Cloudant/api/document.html#documents cloudant document `_id` values may not have a leading `_` character, resulting in the cloudant request failure.

Possible solutions:
- Do not allow namespaces with leading `_` characters
- Escape any leading `_` character in the `_id` field

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.