Skip to content
This repository has been archived by the owner on Jan 30, 2019. It is now read-only.

error with status code 422 when trying to import to saas #51

Open
lucamaf opened this issue Aug 8, 2017 · 3 comments
Open

error with status code 422 when trying to import to saas #51

lucamaf opened this issue Aug 8, 2017 · 3 comments
Labels

Comments

@lucamaf
Copy link
Contributor

lucamaf commented Aug 8, 2017

When trying to execute the following:
3scale-cli import swagger -f json_vcc.json

I received the following error:```

[ 3scale-cli ] Loading Profiles API37 swagger definition.
[ 3scale-cli ] Service with id 2555417747254 created on 3scale
[ 3scale-cli ] Hits metric with id 2555418049462 found on 3scale
[ 3scale-cli ] Method ndefined_about_assembly_version_GET with system_name ndefined_about_assembly_version_GET created on 3scale.
[ 3scale-cli ] Method ndefined_self_GET with system_name ndefined_self_GET created on 3scale.
[ 3scale-cli ] Method ndefined_self_PUT with system_name ndefined_self_PUT created on 3scale.
[ 3scale-cli ] Method ndefined_settings_market_GET with system_name ndefined_settings_market_GET created on 3scale.
[ 3scale-cli ] Method ndefined_settings_fields_GET with system_name ndefined_settings_fields_GET created on 3scale.
[3scale-cli] ERROR encountered on creating Mapping rule: undefined
/usr/lib/node_modules/node-3scale-cli/node_modules/q/q.js:155
throw e;
^

Error: Server responded with status code 422 undefined
at /usr/lib/node_modules/node-3scale-cli/lib/mappingrules.js:29:13
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickCallback (internal/process/next_tick.js:104:9)
From previous event:
at createMappingRulePromise (/usr/lib/node_modules/node-3scale-cli/lib/swagger.js:131:116)
at /usr/lib/node_modules/node-3scale-cli/node_modules/delay-promise/index.js:15:18
at delay.then (/usr/lib/node_modules/node-3scale-cli/node_modules/delay-promise/index.js:8:33)
From previous event:
at threescale_waterfall (/usr/lib/node_modules/node-3scale-cli/lib/swagger.js:92:4)
at /usr/lib/node_modules/node-3scale-cli/lib/swagger.js:40:11


the swagger definition is attached.
[swagger.json.txt](https://github.com/3scale/3scale-cli/files/1207820/swagger.json.txt)
@lucamaf lucamaf added the bug label Aug 8, 2017
@picsoung
Copy link
Contributor

@lucamaf this issue comes because the property basePath is not defined in the spec.
I would recommend to define it basePath even if it's just / and it will work.

@lucamaf
Copy link
Contributor Author

lucamaf commented Nov 6, 2017

is it possible to catch this specific error and provide the indication in the error stack?

@picsoung
Copy link
Contributor

picsoung commented Nov 7, 2017

there are many reasons why this could throw a 422 error.

in the last version the 422 undefined is replaced with 422 <details of the error

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants