CouchDB throws conflict error after immediate update

I'm using CouchDB 1.5 and trying to fix some values in documents with a rather simple request. I simply get a document, modify a value in it and then put it back immediately. Given that my database has low usage, I don't expect this simple operation to produce a conflict. And yet, the 85 documents belonging to 85 different users all fail to update with conflict errors, with no apparent reasons.

Here's the code I'm using:

var PouchDB = require('pouchdb');  var couchdbUrl = 'https://USER:[email protected]';  var usersDb = new PouchDB(`${couchdbUrl}/_users`, {     skip_setup: true });  usersDb.query('faulty_users/object_username', {     include_docs: true }) .then(function(userDocs) {     userDocs.rows         .forEach(function(userDoc) {             userDb = new PouchDB(`${couchdbUrl}/user%2F${userDoc.doc.hoodieId}`);              userDb.get('accountvalues/default', {                     conflicts: true                 })                 .then((doc) => {                     console.log(doc._id, doc._rev, doc._conflicts);                      doc.values.accountValues.username = userDoc.doc.name.replace(/^user\//, '');                      userDb.put(doc)                         .catch((e) => {                             console.log(userDoc.doc.hoodieId, e);                         });                 });         }); }); 

Replay

Category: couchdb Time: 2016-07-28 Views: 0
Tags: couchdb

Related post

  • Files in zipped static resource return 404 errors after being updated 2015-08-28

    After saving a change to a file in a zipped static resource, all of the files in that static resource return 404 errors. If the changed files that caused the problem are added to another zipped static resource, all of its contents also become inacces

  • 'The Controls collection cannot be modified error-' after devexpress update 2016-02-02

    Today I updated the devexpress version from 14.1 to 15.2. I'm getting this error after the update when trying to access pages with devexpress controls in it. "The Controls collection cannot be modified because the control contains code blocks (i.e. &

  • Would applying a lock help to prevent a Save Conflict Error when simultaneously updating a list item? 2014-06-18

    I have a scenario where users may update a list item at the same time and this causes a Save Conflict error. I could catch the exception and reload the list item as suggested in http://adrianhenke.wordpress.com/2010/08/20/sharepoint-error-save-confli

  • $wpdb- prepare error after Wordpress update 2012-12-16

    Possible Duplicate: $wpdb->prepare() warning in WordPress 3.5 Im facing with a error after updated Wordpress to 3.5, Im aware of error but I cant fix it. This is code: $wpdb->prepare("INSERT INTO $orders_table ( theme_name, user_id, order_statu

  • Error after dp3 update MySQL server has gone away 2013-08-12

    Hi I have a 2 server setup server1 contains ispconfig , mail,mysql and dns and the server2 is simply ftp and web. server1 appears to be fine but server2 will not show any new websites created After performing the update I noticed in the server monito

  • WCF service throws an error after application pool recycling until loading any page 2014-03-03

    I've a WCF service that uses MultipleBaseAddressBasicHttpBindingServiceHostFactory to create service instances. I noticed a strange behavior - if I recycle the application pool (or it is recycled automatically) and then call the service (via console

  • Biber error after MiKTeX update 2014-04-14

    After having updated Biber from 1.5 version to 1.8, while the build time, I'm getting errors on the \begin{document} of my latex code telling that File ended while scanning use of \field.. I've tried to compile the same full code on this site, and th

  • Virtual Box giving error after ubuntu update 2014-11-21

    I am using Ubuntu 14.04 and have installed windows 7 using virtual box. After Ubuntu update, when I try to power on windows 7, the following error message comes: Failed to open a session for the virtual machine Windows 7 x64. The virtual machine 'Win

  • Replication throw an error after failover mirror partner is down in SQL Server 2015-03-23

    Received an error mentioned below after failover when mirror partner is down. Error : to fail over to a database which is not configured for database mirroring. code: 22037, text: 'Invalid connection string attributeCannot open database "DBName"

  • Salesforce Lightning afterRender method throws an error after refresh 2015-08-31

    I have a main component, which contains two more components. They render instead of each other dynamically, using $A.createComponent(), depending on user actions. Both of these components have <ui:inputDate> elements. First time the component is loa

  • XeLaTeX with fontspec gives "Undefined control sequence" error after MiKTeX update 2013-04-13

    Every once in a while after updating MiKTeX, the installation gets into an inconsistent state. This might be a problem with the packages (an example is described in this question), but sometimes packages are split or renamed. The cases I remember are

  • wp-admin throwing 500 errors after update to 4.2.1 2015-04-28

    Site owner updated her multisite yesterday via the dashboard. The site itself is still running, but the network and primary site dashboard both return a 500 error. However, the wp-admin for two subdomain sites can be accessed just fine. The related P

  • Package throwing errors after asystem update 2015-11-05

    I was running a finite element analysis package named Bison and it was running fine until yesterday when I installed system updates on my Ubuntu 14.04 desktop. Since the update, I am getting the following error when I include mpiexec. I discussed wit

  • Fatal error after brew update interrupted 2013-08-27

    While my system was performing a $ brew update && brew upgrade we had a power failure and my iMac shut down while updating packages/dependancies. After rebooting I tried to run $ brew update && brew upgrade again and encountered the follow

  • JVM memory initializazion error after windows update 2010-03-15

    We have three Windows Server 2003 with 2 GB RAM. Server1 tomcat 5.5.25 jvm version SUN 1.6.0_11-b03 Server2 tomcat 5.5.25 jvm version SUN 1.6.0_14-b08 Server3 tomcat 6.0.18 jvm version SUN 1.6.0_14-b08 For the three servers JVM parameters are: -XX:Ma

  • Grub Boot Error After Ubuntu Update 2010-12-29

    I've installed Ubuntu 10.04 with dual boot to Windows XP. I put it on auto-update. It was updating grub and after a restart all it says is; error:no such device: <hex number> With a grub rescue prompt. I'm in panic mode right now as it's my mother's

  • IIS error after Windows update 2011-05-09

    A Windows 2003 update messed up my server bad, so I had to reinstall .net v2. Now I can't access any .aspx pages (html load fine). When I try, I get the following error: Server Error in '/' Application. System.ServiceModel.Diagnostics.DiagnosticTrace

  • /dev/sda2 contains a filesystem with error after partitioning (updated) 2012-12-17

    I just wanted to create a separate home partition on my Ubuntu 12.10 system. I booted the liveDVD, resized the sda2 partition (28gb of data resized to 30gb based on MiB [originally on a 100gb partition]) and made a new ext4 partition for the home fol

  • How to solve these errors after running update.php? 2013-05-15

    I´ve updated my D6 site to Drupal 7. Even after running several times the update.php script, there are two errors still out there: The following updates returned messages: system module Update #7061 Failed: DatabaseSchemaObjectExistsException: Table

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.770 (s). 13 q(s)