Comments (7)
@jfloff Are you always facing this issue ?
Could you give us more details on this (requests and responses, execution time) ?
from mangopay2-ruby-sdk.
I haven't done this in a while because I started using VCR gem for my specs, but if I force new requests I'm still facing that. The pattern is what I described above, it works fine then after multiple specs running it stops workings and returns that error. To me it seems a throttling issue, but the error message does not match that.
from mangopay2-ruby-sdk.
Hi @jfloff
As many times as I ran the tests, not even once I got an error...
from mangopay2-ruby-sdk.
I will try to get a full log the next time I can replicate this issue. We can close for now and reopen when I get that log.
from mangopay2-ruby-sdk.
Yesterday running tests I found the error yet again:
Failure/Error:
mangopay_operation = MangoPay::NaturalUser.create({
Email: self.email,
FirstName: self.first_name,
LastName: self.last_name,
Address: address,
Birthday: self.birth_date.to_time.to_i,
Nationality: self.country,
CountryOfResidence: address[:Country],
})
MangoPay::ResponseError:
The authorization credentials are not valid
# /app/heroku/ruby/bundle/ruby/2.6.6/gems/mangopay-3.0.32/lib/mangopay.rb:148:in `request'
# /app/heroku/ruby/bundle/ruby/2.6.6/gems/mangopay-3.0.32/lib/mangopay/http_calls.rb:13:in `create'
# ./app/models/user.rb:709:in `block in mangopay_create_natural_user'
EDIT
This was the VCR that got recorded today when I faced this issue yet again:
- request:
method: post
uri: https://api.sandbox.mangopay.com/v2.01/<REDACTED>/wallets
body:
encoding: UTF-8
string: '{"Owners":[83945627],"Description":"owner wallet for user [email protected]","Currency":"EUR"}'
headers:
User-Agent:
- MANGOPAY V2 RubyBindings/3.0.32
Authorization:
- bearer <REDACTED>
Content-Type:
- application/json
X-Mangopay-Client-User-Agent:
- '{"bindings_version":"3.0.32","lang":"ruby","lang_version":"2.6.6 p146 (2020-03-31)","platform":"x86_64-linux","uname":"Linux
d76f32f75be0 4.19.0-8-amd64 #1 SMP Debian 4.19.98-1 (2020-01-26) x86_64 x86_64
x86_64 GNU/Linux"}'
Accept-Encoding:
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
Accept:
- "*/*"
response:
status:
code: 401
message: Unauthorized
headers:
Date:
- Mon, 13 Jul 2020 10:56:53 GMT
Content-Type:
- application/json; charset=utf-8
Content-Length:
- '175'
Connection:
- keep-alive
Set-Cookie:
- __cfduid=d9dc1d231712140d0c77d6bd88edd371e1594637813; expires=Wed, 12-Aug-20
10:56:53 GMT; path=/; domain=.mangopay.com; HttpOnly; SameSite=Lax
Cache-Control:
- no-cache
Pragma:
- no-cache
Expires:
- "-1"
Www-Authenticate:
- Basic realm=MangopayAuthentication
- Bearer
- Bearer realm="MangopayAuthentication"
Cf-Cache-Status:
- DYNAMIC
Cf-Request-Id:
- 03e96b20630000da8246b0f200000001
Expect-Ct:
- max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Server:
- cloudflare
Cf-Ray:
- 5b227ae09b5bda82-LIS
body:
encoding: UTF-8
string: '{"Message":"The authorization credentials are not valid","Type":"invalid_credentials","Id":"a8e5bb05-5517-436f-af75-9da7212f1b75#1594637813","Date":1594637814.0,"errors":null}'
http_version: null
recorded_at: Mon, 13 Jul 2020 10:56:53 GMT
from mangopay2-ruby-sdk.
I've updated the previous message with the VCR I recorded on my tests with this exact problem
from mangopay2-ruby-sdk.
For future reference this is due to MGP oauth/token
request. What happens is that on a first run VCR records the oauth/token
request. But when you record new episodes at a later date (VCR=new_episodes
) that token is expired, and since that token is replayed by VCR you get an unauthorized reply.
As a solution, either reply the whole spec or manually remove the token request from your VCR tape and record let VCR record new episodes (hence recording both the new token and the new request)
from mangopay2-ruby-sdk.
Related Issues (20)
- Can't send headers in update request HOT 1
- Can't create a user: The requested resource does not support http method 'POST'. (MangoPay::ResponseError) HOT 1
- FilterParameters.response doesnt handle cases when the response is not valid json HOT 3
- Test
- NoMethodError undefined method `body' for nil:NilClass on Net::ReadTimeout error HOT 2
- Error avec le compte production HOT 5
- Effectuer un refund sur un payin HOT 2
- The requested resource does not support http method 'POST' on MangoPay::KycDocument.create_page HOT 5
- Backward-compatibility HOT 7
- Error instead of payment form on api.sandbox.mangopay.com/Content/PaylineTemplateWidget HOT 5
- Not all classes supports headers options and recurring pay in registratoin get endpoint is missing HOT 1
- Missing fetching of recurring pay in registration object HOT 1
- Which version to use? v3 or v4? HOT 1
- Allow setting http open_timeout
- Allow setting max_retries
- HTTP request defaults HOT 1
- Can't access "consult_url" in sandbox HOT 1
- MultiJson::ParseError is thrown on HTTP error 5XX HOT 1
- Improve error handling when logging is enabled HOT 1
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 mangopay2-ruby-sdk.