Cloudant case_clause error when requesting document with certain revision - couchdb

When replicating or requesting a document with a certain revision I am getting the following error ->
{
"error": "case_clause",
"reason": "{ok,[{ok,{doc,<<\"a8fa021299855487fde50e6ccf70a976\">>,\n.......}}]}
}
See full error in gist below:
https://gist.github.com/paulJordaan/6f83d5fb9519453f87e78ddd192040e3
When doing a get request for the document without supplying the rev I get the correct response:
GET -> https:CLOUDANT/DB/a8fa021299855487fde50e6ccf70a976
However when supplying the revision for this latest version of the stored doc I get the error mentioned above:
GET -> https:CLOUDANTDB/a8fa021299855487fde50e6ccf70a976?rev=3801-65391644310798d8b5970504ed9b9ca3
I've tried updating the document to get a new revision but the problem persists. I've also checked that the document in question contains no conflicts.
This error is causing my replication to mobile devices to fail which is a major issue. Does anyone have some information as to what could be causing the error.

I have received a response from Cloudant's support team.
This is apparently a known issue.
https://issues.apache.org/jira/browse/COUCHDB-3193
If you encounter the same issue the Support team can run the necessary steps to resolve the problem.

Related

Custom Connector for PowerBI issues connecting to Microsoft Graph

OData: The feed's metadata document appears to be invalid. Error: The metadata document could not be read from the message content.
unexpectedxmlelement : the schema element 'navigationproperty' was not expected in the given context. : (1, 4841)
I am getting the following error when running my code through Visual Studio 2019 Community.
This happens right after I log in with OAuth2 and set credentials in debug, then run the release... error.
Full Code: https://pastebin.com/raw/B8vXRmc1
MyGraphConnector.Feed()
I have tried searching for various different solutions online but nothing is working.

RestTemplate API call between microservice is Not working

I have 2 microservices based on SAP SDK 3.0 archetype binded by the same xsuaa service.From the first microservice A, I wanted to call the second microservice B by using rest template. It fails to call, as it is not able to authenticate. Can you find my approach is right?
Sharing the code below along with the error screenshot
Error:
<200,document.cookie="fragmentAfterLogin="+encodeURIComponent(location.hash)+";path=/";document.cookie="locationAfterLogin="+encodeURIComponent(location.href.split('#')[0].split(location.host)1)+";path=/";document.cookie="signature=pim93tQhbcWCYYAiFxYkwrHBY%2Fs%3D;path=/";location="https://xxxxx.hana.ondemand.com/oauth/authorize?response_type=code&client_id=sb-Ledify!t7251&redirect_uri=http%3A%2F%2Flocalhost%3A5000%2Flogin%2Fcallback",{x-request-id=[k8h8rf33], x-frame-options=[SAMEORIGIN], Cache-Control=[no-cache, no-store, must-revalidate], Content-Type=[text/html], Content-Security-Policy=[script-src 'self' 'unsafe-inline'], Date=[Wed, 01 Apr 2020 11:23:01 GMT], Connection=[keep-alive], Content-Length=[620]}>
Note : localhost:5000 is my local approuter port and it is configured to call the second microservice which I have tested it in browser
Updated:
I have updated with getToken() but I am getting the below error in my local approuter.
Error Response:
xsapp.json Route
{
"source": "/notif-mock/(.*)",
"authenticationType": "xsuaa",
"destination": "notif-mock",
"csrfProtection": true
}
FYI, I have used the local approuter setup as per this post Link here
In the following line, you are concatenating a String with DecodedJWT:
String encodedAuth = "Bearer " + getJWTTokenDetails();
But DecodedJWT does not implement a toString() method. You must use getToken() instead.
Hint: For easier support handling please copy/paste your code, because text in screenshot cannot efficiently be referenced.
Arun,
Thanks for providing all the additional details. I recommend updating to SDK Version 3.16.1 and testing if it solves your issue.
I do it because version 3.9.0 which you're using at the moment has an incomplete implementation of security scenarios invoked by XSUAA.
We fixed many issues related to the handling of XSUAA and JWT validation in release 3.15.1. Please, check release notes for details..
If even after update your issue persists, we'll have to see how we can reproduce it or get more logs data from you as a response only doesn't provide enough clue on where it fails.
Hope it helps!

Authorize.net Error when adding new paymentProfile - code: E00114, Invalid OTS Token

we're trying to add a new customerPaymentProfile for an existing customerProfile. we're patterning our code on the github sample provided
https://github.com/AuthorizeNet/sample-code-node/blob/master/CustomerProfiles/create-customer-payment-profile.js
the only difference is that, we don't pass CC details to our servers. instead, we pass opaqueData from frontend. on Initial customerProfile creation(with a single payment profile) it works w/c is good. but if we try to add a new paymentProfile(using a new opaqueData) we get the error code: E00114, Invalid OTS Token.
the official documentation regarding error code doesn't say much
And it seems like there's a few different cases, where it throws this error code
Using Accept.js
https://community.developer.authorize.net/t5/Integration-and-Testing/E00114-Invalid-OTS-Token/td-p/58879
https://community.developer.authorize.net/t5/Integration-and-Testing/E00114-Invalid-OTS-Token/td-p/59314
Our Case(node.js SDK)
https://community.developer.authorize.net/t5/Integration-and-Testing/Error-while-adding-new-paymentProfile-quot-code-quot-quot-E00114/td-p/69872
Others
https://community.developer.authorize.net/t5/Integration-and-Testing/Intermittent-Invalid-OTS-Token-Errors-E00114/td-p/57509
https://community.developer.authorize.net/t5/Integration-and-Testing/E00114-Invalid-OTS-Token-error-generates-while-creating-ARB/td-p/68685
We also tried to delay the transaction at least 7 seconds, before using the opaqueData maybe to allow their systems to sync as suggested here to receive the same error message.
Anyone ever encountered something like this before?
Any form of help would be highly appreciated.
We were doing something wrong, by doing trial and error(via API) to determine if a customer exists or not. hence hitting api once or twice resulting to an invalid token (error on 2nd call)
So we tried to create a customerProfile, w/ customerPaymentProfile & this will throw error if customerProfile already exist(if its a duplicate email). Whats good here, is that customerProfileId comes with the error payload.
We though of using customerProfileId from error payload, to create a new payment profile for the customer, giving us some edge by reducing one DB call on our system.
The issue with our strategy though, is that opaqueData will expire, when we use it to create customerProfile(w/ payment profile) even though the request failed.
So resolution is to save customer info in our system, and check if it's a returning customer or not. If it is, then get customerProfileId from db, and create new customerPaymentProfile on authorize.net
One could also create customerProfile first, w/o the customerPaymentProfile. if this transaction fails, then at least you haven't used the opaqueData yet and you get the customerProfileId w/o doing any query on your db. So when you try to create a new customerPaymentProfile, you won't get error code E00114 since opaqueData isn't used yet.
lessons learned the hard way for us, but hopefully it helps someone.

OData service can be called in Browsers but in Excel 2016

I got a sample servlet using Olingo lib: https://odata-demoservice.run.aws-usw02-pr.ice.predix.io/DemoService.svc/Products. It works fine in Chrome/IE/FF or in Postman. But when I query in Excel 2016/OS Windows 10 with the steps like:
New Query
From Other Sources
From OData Feed
Got the error like: "We encountered an error while trying to connect. Details: Invalid URI: The hostname could not be parsed"
Any ideas are appreciated.
Thanks
#RodolfoOliveira: yes, I resolved this issue. the reason is that when I deployed it to Cloud, the uri in metadata is still http. What I did is implement a CustomProcessor and correct the url.
More detail is here: https://issues.apache.org/jira/browse/OLINGO-758
just need to do the custom Processor. Do the same as the original source but change a bit about the url. Detail in here: https://olingo.apache.org/javadoc/odata4/org/apache/olingo/server/api/processor/DefaultProcessor.html
Register it with the Handler at first, then the issue should be solved.
ODataHttpHandler handler = odata.createHandler(edm);
handler.register(new CustomDefaultProcessor());
Hope this help.

php library for flickr API

I am banging my head trying to use Flickr API...
My goal is to be able to upload images and create albums in my Flickr account from my website...
I tried the phpFlickr library but apparently it needs updates for getting authenticated tokens...It keeps giving me "Invalid auth token".
I did some reading on how to get tokens and using DPZFlickr managed to get oauth_token & oauth_verifier but failed to exchange that with an access token...It also failed in uploading any photo to my account using the included upload.php example (Giving me an "empty" error!).
After digging in DBZ flickr.php code, I managed to get this error when trying to upload to Flickr: "oauth_problem=signature_invalid&"
So I began to search how to create a valid signature to eventually get a valid access token...and concluded that it is quite some work to be done here if I am going to build everything from scratch.
So my question is: Are there any updated php libraries that I can use to successfully create albums and upload photos to my Flickr account? Or should I go ahead and try building one?
OK..I finally got it to work with the DPZ library.
For future reference anybody facing the same problem as I had:
I managed to create an album using DPZFlickr by changing the method in auth.php to flickr.photosets.create....which indicated that the library correctly generates an access token with write permission..
However, the upload example kept giving me the "Invalid signature" error....
I checked the code. Flickr.php correctly unsets the photo parameter before signing the request then adds it back and submits the request which is exactly as indicated in: www.flickr.com/services/api/upload.api.html
I found a discussion in https://www.flickr.com/groups/51035612836#N01/discuss/72157650261711318/ that cleared out that the error was not actually a signature problem, but rather the 'photo' parameter that is being sent is the problem. It's just that Flickr doesn't know what to do with the photo parameter so it sends the signature error.
So what' wrong with the photo parameter?
Flickr API requires that the image has to be sent in binary form...The DBZ library, Flickr.php script line 677, does the hard work for us using the cURL function in php (http://au.php.net/manual/en/function.curl-setopt.php).
It sends the $parameters (which includes the uploaded photo) to the post field of the http request which should do the upload in binary format for us.
However, a brilliant comment I found in CURL PHP send image
states that:
"CURLOPT_SAFE_UPLOAD defaulted to true in 5.6.0... so you will need to add curl_setopt($ch, CURLOPT_SAFE_UPLOAD, false); before setting CURLOPT_POSTFIELDS"
Checking the manual: http://au.php.net/manual/en/function.curl-setopt.php
it says:
"Added in PHP 5.5.0 with FALSE as the default value. PHP 5.6.0 changes the default value to TRUE."
So if your php version is 5.5.0 the library will work just fine whilst if using version PHP 5.6.0 you need to add a line before 677 in Flickr.php to change the CURLOPT_SAFE_UPLOAD to false (that's why the library works with some and others not).
To solve the issue...Just add this line before line 677 in Flickr.php:
curl_setopt($curl, CURLOPT_SAFE_UPLOAD, false);
That's it. (-:

Resources