Setting up user_ctx field on CouchDB Replicator - couchdb

"user_ctx": {
"name": "adminuser",
"role": "[\"_admin\"]"
},
"_replication_state": "error",
"_replication_state_time": "2011-08-30T15:09:03+00:00",
"_replication_id": "08fd9d6dcc5a0882fc9fd0d971b05938"
}
For some reason, I can't get my replicator to work. The log continues to show "unauthorized to access database", referring to my localhost. I know I need to have user_ctx set, but for some reason it just doesn't like to work. I copied the info out of my source. I even created new admin users to try and fix the problem, none worked. Do I need to specify more roles for the user?
The other has a good resource https://gist.github.com/832610, but the user_ctx he set's in the example isn't the admin user, the appear to just be random roles.
Anyone have any experience with the CouchDB replicating to the localhost?

If you create the document as the server admin, then you do not need this field. I think omitting it completely will work.
If you create the document as a normal user, then it should match your name and roles which you can get by querying /_session. In fact, I think you can copy the userCtx field from the session response directly into the user_ctx field of the replication document.

Found out what I did thanks to the CouchDB Apache Mailing Lists. Should have had "roles" instead of "role".

Related

What does it mean "Another object with the same value for property proxyAddresses already exists" during licensing an user in Azure AD?

I'm using the Microsoft Graph API versin 1.0 to update a batch of user and for some I receive the following error message:
Another object with the same value for property proxyAddresses already exists.
This happens with some few user, but not with many others.
However I don't understand what it means and how to workaround it.
Any ideas?
Update1:
This my the JSON payload sent with the request:
{
"addLicenses":[
{
"disabledPlans": [
"76846ad7-7776-4c40-a281-a386362dd1b9",
"54fc630f-5a40-48ee-8965-af0503c1386e",
"c68f8d98-5534-41c8-bf36-22fa496fa792",
"8c7d2df8-86f0-4902-b2ed-a0458298f3b3",
"9e700747-8b1d-45e5-ab8d-ef187ceec156",
"c87f142c-d1e9-4363-8630-aaea9c4d9ae5",
"b8afc642-032e-4de5-8c0a-507a7bba7e5d",
"2078e8df-cff6-4290-98cb-5408261a760a"
],
"skuId":"94763226-9b3c-4e75-a931-5c89701abe66"
}],
"removeLicenses":[]
}
Based on the error message, the property proxyAddresses should be unique.
Please make sure you don't configure the same proxyAddresses for multiple users when updating users.
In theory, this property cannot be updated through the Microsoft Graph API. So if you didn't put proxyAddresses in the body, please share the requests of the updated users which have this issue.
this may be old, I encountered a similar issue. I am doing a graph api call which indirectly updates some of user attributes, so getting this error. The tenant admin should check for duplicate records and remove or update them, they can follow this link

The identity executed in transaction function is system admin?

I start the rest server by multiple user mode .
When I use a participant's business card create a transaction.
In fact the participant doesn't have permission to the resource A,
and in trasaction can update the resource A.
I view the detail of the transaction,It shows
"participantInvoking": "resource:org.hyperledger.composer.system.NetworkAdmin#admin",
Your question is not clear!
Try GET /system/ping to see your current participant and ID.
Also try GET /wallet to see which is the default that you are currently using.
UPDATE
I have just tested the REST api server with this tutorial
I tested with composer v0.19.4. When trying GET /system/ping I see this result:
{
"version": "0.19.4",
"participant": "org.example.trading.Trader#trader1",
"identity": "org.hyperledger.composer.system.Identity#fae5720261eb31a785fe3dcd95f08110148523acfb7c1b75152ca1c0ebcfe989"
}
As far as I can tell it is working OK.
If you have repeatable steps for making it fail I would suggest raising an issue in GutHub.

setCanDeleteDocuments() Lotus Notes ACL

I am trying to delete document,where conditions is...
Where the user is in Group and having the deletion rights & every users in group is able to delete the document.
But problem is when, If the name I specify is also listed explicitly in the ACL and does not have deletion rights.Then it does not check the group rights which is fair enough.
For that i am trying to give deletion rights to those users who are in group by code given below.
var acl:NotesACL=database.getACL();
var entry:NotesACLEntry=acl.getFirstEntry();
if(entry!=null)
{
var user:NotesACLEntry=acl.getEntry(#UserName());
if(user.isCanDeleteDocuments()==false)
{
user.setCanDeleteDocuments(true);
acl.save();
}
}
Where it shows error like,
Exception occurred calling method NotesACL.save() null.
Even explicitly added user is having user type=person & Access= Manager in ACL.
is there any other way to do this?
Any help would be appreciated.
Thanks in advance.
Using database as a starting point means you're getting the database as the user. Unless the user already has Manager access to the database, this will fail because the user doesn't have access to update the ACL.
You can use sessionAsSigner, but bear in mind you cannot use the getCurrentDatabase() method. Instead you must use the getDatabase(server,filePath) method in order to get the database with the signer authority. Obviously the signer also needs rights to modify the ACL.

Remove CouchDB admin user

I accidentaly added admin user in Couch DB and I cant remember password for it. I tried to reinstal CouchDB in local, but admin is still there. Im on mac book.
Is there any way to remove this user?
For server-admins, they are added to your database's local.ini configuration file. Thus, they are accessible via the _config API endpoints:
GET /_config/admins
{
"admin": "<<hashed-password>>"
}
As a result, they can also be deleted via HTTP. (if you're logged in)
DELETE /_config/admins/admin
{
"ok": true
}
Since you specifically mentioned that you forgot the password, you can manually delete the entry in your /etc/couchdb/local.ini file, it'll be listed like:
[admins]
admin=<<hashed-password>>
Simply delete the line starting with admin= and restart your server.
See the docs for more information

CouchApp cannot retrieve key/value pairs from view but Futon can

I create a simple couchapp and deployed it into my CouchDB instance. However, i'm noticing an anomaly. The view created (via couchapp generate view ...) returns data when I view it in CouchDB's Futon administrative interface (logged in as admin), but not when I run the couchapp I wrote. Here's an example of my code:
$.CouchApp(function(app) {
app.view("wine_list", { success: function(json) {
json.rows.map(function(row) {
alert(row.key);
});
}});
});
The result I get out of alert() above is 'null'.
And when I navigate to: http://localhost:5984/winedb/_design/wineapp/_view/wine_list I get:
{"rows":[
{"key":null,"value":null}
]}
But, If I open Futon admin interface and navigate to the design doc/view, I can see records. Now, in Futon i'm logged in as admin. So, my guess is I should specific auth credentials in my couchapp javascript code? If so, how?
If your view has both a map and reduce component, then this might be a user interface bug in Futon.
By default, CouchDB will supply map and reduce results to queries. To see only the map results, you must provide a ?reduce=false parameter.
By default, Futon provides the ?reduce=false parameter, and you have to check the "reduce" checkbox to get the "default" behavior.
In other words, add reduce=false to your query. Does that help?

Resources