Comments (3)
It doesn't check the master key and accepts any value, so I think there is another problem. Can you share the code and/or error logs if possible?
from cosmosdb-server.
Hello!
Here it is my code
from pydocumentdb import document_client
client = document_client.DocumentClient(
'https://localhost:3000/', {'masterKey': 'test key'})
print("creating database")
db = client.CreateDatabase({'id': 'test_database'})
print("creating collection")
collection = client.CreateCollection(
db['_self'], {'id': 'my_collection'})
input()
And here it is the exception log
C:\Users\Renato\repos\bliive-api-python\venv\Scripts\python.exe "C:\Program Files\JetBrains\PyCharm Community Edition 2019.1.2\helpers\pydev\pydevd.py" --multiproc --qt-support=auto --client 127.0.0.1 --port 51549 --file C:/Users/Renato/repos/bliive-api-python/api_local.py
pydev debugger: process 20748 is connecting
Connected to pydev debugger (build 191.7479.30)
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.1.2\helpers\pydev\pydevd.py", line 1758, in <module>
creating database
main()
File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.1.2\helpers\pydev\pydevd.py", line 1752, in main
globals = debugger.run(setup['file'], None, None, is_module)
File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.1.2\helpers\pydev\pydevd.py", line 1147, in run
pydev_imports.execfile(file, globals, locals) # execute the script
File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.1.2\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "C:/Users/Renato/repos/bliive-api-python/api_local.py", line 7, in <module>
db = client.CreateDatabase({'id': 'test_database'})
File "C:\Users\Renato\repos\bliive-api-python\venv\lib\site-packages\pydocumentdb\document_client.py", line 213, in CreateDatabase
return self.Create(database, path, 'dbs', None, None, options)
File "C:\Users\Renato\repos\bliive-api-python\venv\lib\site-packages\pydocumentdb\document_client.py", line 2130, in Create
options)
File "C:\Users\Renato\repos\bliive-api-python\venv\lib\site-packages\pydocumentdb\base.py", line 168, in GetHeaders
headers)
File "C:\Users\Renato\repos\bliive-api-python\venv\lib\site-packages\pydocumentdb\auth.py", line 56, in GetAuthorizationHeader
document_client.master_key)
File "C:\Users\Renato\repos\bliive-api-python\venv\lib\site-packages\pydocumentdb\auth.py", line 85, in __GetAuthorizationTokenUsingMasterKey
key = base64.b64decode(master_key)
File "C:\Python36\lib\base64.py", line 87, in b64decode
return binascii.a2b_base64(s)
binascii.Error: Incorrect padding
Thanks
from cosmosdb-server.
I put no key and it worked
client = document_client.DocumentClient( 'https://localhost:3000/', {'masterKey': ''})
Thank you @nkzawa
from cosmosdb-server.
Related Issues (20)
- Is this compatible with CosmosClient on an ASP.net Core application? HOT 3
- Query to //addresses/?$resolveFor=dbs&$filter=protocol%20eq%20rntbd HOT 3
- Support for C# SDK v3 HOT 5
- Docker image HOT 11
- Upsert responding with "Resource with specified id or name already exists."
- Project has no license file HOT 2
- Bad Request when GET request includes document header x-ms-documentdb-isquery
- Exception in read-document.ts getCollectionPartitionKeys when collection has no partitionKey saved
- Feature request: add externalized configuration for certificates and logging
- Support .NET client HOT 2
- read-meta hardcoded to port 3000 HOT 1
- GetItemLinqQueryable ... ToFeedIterator invalid response from queryDocuments HOT 3
- Query triggers `Unexpected token '.'` HOT 2
- Query triggers `"Invalid destructuring assignment target"`
- Gremlin/Graph support
- When using in azure function, it always tries calls https even when --no-ssl is set HOT 2
- When running cosmosdb-server alongside a azure function in a docker project, the function app wont connect to the server
- When querying from a azure function using input binding, a query plan request is made that is not mapped HOT 1
- Is server do not support patch operation? HOT 1
- GROUP BY
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cosmosdb-server.