What is unknown api error

«Unknown API level» error when trying to run instrumentation test

I tried to run a test on a device(non-handheld) that is connected over ethernet, but all I see is a failure. I use the Gradle task connectedAndroidTest to run the instrumentation tests and is working fine on a handheld device connected over USB directly to my PC. However, the same test could not be even started on the remote device. The error shown is «No tests found». Previously I have seen the same error if I start the instrumentation test without any device connected, but Android Studio as well as the output from adb devices showed that the remote device is seen by the toolchain. Then I tried to run the same Gradle task but on the command line, with more info. So I entered:
gradlew connectedAndroidTest —stacktrace —debug

In the bunch of debug output I found a better description of the error:

[INFO] [org.gradle.api.Project] Skipping device ‘DEVICE_IP:5555’ for ‘AppNameHere:’: Unknown API Level
[WARN] [org.gradle.api.Project]
_FoundCompatibleDevices[TestRunner] FAILED

I searched this error in google and I stumbled upon the source code that prints it. So I downloaded the android’s platform tools source code to be able to more easily navigate through it and it seems to me that the API level is detected by reading property IDevice.PROP_BUILD_API_LEVEL, which seems to be equal to «ro.build.version.sdk». After some more googling I found that it should be defined in /system/build.prop. The content of this file on the device showed me that it has the correct API level 19. And actually the same API level is shown in Android Studio, the android tab that shows the current connected devices (and their logcat output, open processes etc). However, it seems that in some cases this value is not getting correct.

Any idea where things could get wrong? Where should I look for the real problem here? In Android’s toolchain, Android on the device, something was done wrong during my investigation?

I am currently using:
— Windows 7
— Android Studio 1.1 Preview 1
— Android SDK Tools 24.0.2
— Android SDK Platform-tools 21
— Android SDK Build-tools 19.1

Источник

Keycloak Admin Rest API unknown_error for update user API

I am trying to add a custom attribute to a user using Admin Rest API. When i try with default master realm, its working fine. But when i try it with another realm that i created, it yields «unknown_error».

I have attached the screenshot of request below.

5 Answers 5

You haven’t granted related permissions to your realm.

Go to ‘Clients’ -> select your client -> ‘Service Account Roles’:

  • In the client roles dropdown box, click realm-management
  • In Available Roles box, select related roles. Try manage-users and view-users .
READ  Java xml parse error

Then get a new access token and try your API call again.

Apparently the Admin API needs to be accessed via the admin-cli client.

I got a 403 <"error":"unknown_error">when I wanted to use a copy of the default admin-cli client.

I found that I had to use the admin-cli client in the master realm to use the admin REST API. When you look at the master realm, there is an admin role that does not exist in sub-realms. That admin role seems to be necessary to access the admin REST API successfully.

My suggestion is that you can create a client in the master realm as a service account, then assign the admin role to that client. You can then use that unique admin service account for API access by other programs.

Источник

Unknown API Error when attempting to contact the remote system

4u123

Well-Known Member

I’m having this same problem on four new servers. When we initially tried this, using API tokens from the DNS cluster servers we got an error so we set them up using the remote access keys instead and this worked fine.

Ideally I would like to switch all of these to using the API keys instead.

When we try to add or edit a nameserver using an API key we receive the error «Unknown API Error when attempting to contact the remote system». The cpanel log says
Server Error from ip.ip.ip.ip: HTTP/1.1 403 Forbidden Access denied

This immediately made me think it was the hosts.allow file but it isn’t. The cluster works fine when using remote access keys and I can telnet to the port from the servers.

So I checked the login log on the nameserver. The log says.

root «GET /json-api/version? HTTP/1.1» FAILED LOGIN whostmgrd: login attempt to WHM with bad accesshash or API token

However, the API token is correct and works fine with other servers.

The solution mentioned above relating to the username isn’t relevant to my situation as I’m already using root as the user.

I have set up six other new servers recently using the API key without any issues — but these four are all the same and will not work.

I presume that we can still use the remote access keys indefinitely if they are already set up this way?

Источник

I get «Http failure response for (unknown url): 0 Unknown Error» instead of actual error message in Angular

I’m using Angular 4 HttpClient to send requests to external service. It is a very standard setup:

The problem is, when the request fails I see a generic Http failure response for (unknown url): 0 Unknown Error message in console. Meanwhile, when I inspect the failed request in chrome I can see the response status is 422, and in the «preview» tab I see the actual message desribing failure cause.

How do I access the actual response message I can see in chrome dev tools?

READ  Internal xmlhttprequest error что это такое

Here’s a screenshot demonstrating the problem:

25 Answers 25

The problem was related to CORS. I noticed that there was another error in Chrome console:

No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://localhost:4200’ is therefore not allowed access. The response had HTTP status code 422.`

This means the response from backend server was missing Access-Control-Allow-Origin header even though backend nginx was configured to add those headers to the responses with add_header directive.

However, this directive only adds headers when response code is 20X or 30X. On error responses the headers were missing. I needed to use always parameter to make sure header is added regardless of the response code:

add_header ‘Access-Control-Allow-Origin’ ‘http://localhost:4200’ always;

Once the backend was correctly configured I could access actual error message in Angular code.

In case anyone else ends up as lost as I was. My issues were NOT due to CORS (I have full control of the server(s) and CORS was configured correctly!).

My issue was because I am using Android platform level 28 which disables cleartext network communications by default and I was trying to develop the app which points at my laptop’s IP (which is running the API server). The API base URL is something like http://[LAPTOP_IP]:8081. Since it’s not https, android webview completely blocks the network xfer between the phone/emulator and the server on my laptop. In order to fix this:

Add a network security config

New file in project: resources/android/xml/network_security_config.xml

NOTE: This should be used carefully as it will allow all cleartext from your app (nothing forced to use https). You can restrict it further if you wish.

Reference the config in main config.xml

That’s it! From there I rebuilt the APK and the app was now able to communicate from both the emulator and phone.

Источник

MT API: unknown errors

Добрый день,
при попытке открыть ордер, MT API возвращал странные номера ошибок.
Например:

Error sending order: unknown error(75)
Error sending order: unknown error(55)
Error sending order: unknown error(-119)
Error sending order: unknown error(65)
Error sending order: unknown error(-14)
Error sending order: unknown error(124)
Error sending order: unknown error(63)
Error sending order: unknown error(-88)
Error sending order: unknown error(-58)

Как это расшифровать? Конкретней меня интересует такой вопрос: несмотря на то что были возвращены ошибки — некоторые из запросов сработали и ордера были открыты, как определять по номеру ошибки, какие из запросов всё таки сработали?

API 3.0, сервер у alpari 217.74.32.254,
сам пример работает нормально
да и мой код работает хорошо,
единственный раз когда это произошло когда курс очень круто пошёл вниз — вероятно очень быстро менялся,
скорей всего это было связано с этим, но меня смущает тот факт что несмотря на то что были возвращены ошибки на самом деле открылось аж 3 ордера, вместо одного.

do
<
pCur->GetOrderInfo(&soi);
err=MtSendOrder(handle,&soi);
if (err!=RET_OK)
<
CString s;
s.Format(«Error sending order: %s(%d)\n»,MtGetErrorDescription(err),err);
Audit(_T(«OpenOrder»),s,NIIF_ERROR);

if (err==RET_NO_CONNECT)
<
RenewConnections();
>
else if (err==RET_NO_MONEY || err==RET_ERROR)
return -1;
else
Sleep(5000);

READ  Ritmix rbk 617 прошивка

if (pCur->m_bBuy)
pCur->m_dPrice=r[pCur->m_nSymbol].ask;
else
pCur->m_dPrice=r[pCur->m_nSymbol].bid;
>
else
break;
>
while (true);

Похоже что Вы получили реквот (или отказ от обслуживания) и не обработали его.

Что Вы могли получить:
RET_PRICE_CHANGED — реквот
RET_TOO_FREQUENT — слишком частые запросы

Вы показали просто какой-то кусок кодов возврата из общего лога или именно это список кодов с начала?
Сделайте детальный лог, как подключались, как посылали запрос на сделку, что получили в ответ и тд.

RET_TOO_FREQUENT появлялись, но после выдерживалась пауза в 5 секунд (код был немного другой Sleep(5000) вызывался только при появлении RET_TOO_FREQUENT) и опять появлялись загадочные коды возврата.
Если было бы RET_PRICE_CHANGED — то в логе бы тогда именно это и отразилось. Да и цены я своевременно в Pumping mode получаю. Коннект хороший и все цены приходят быстро.
Меня смущает первая ошибка «symbol is in instant execution mode but not selected(24)», может ли всё остальное быть следствием этого. Раньше у меня такой никогда не появлялось.

Вот как всё было:

12/03/04 16:31:03 OpenOrder-Error sending order: symbol is in instant execution mode but not selected(24)
12/03/04 16:31:03 OpenOrder-Error sending order: too frequent requests(21)
12/03/04 16:31:08 OpenOrder-Error sending order: unknown error(115)
12/03/04 16:31:08 OpenOrder-Error sending order: too frequent requests(21)
12/03/04 16:31:13 OpenOrder-Error sending order: unknown error(104)
12/03/04 16:31:13 OpenOrder-Error sending order: too frequent requests(21)
12/03/04 16:31:19 OpenOrder-Error sending order: unknown error(-111)
12/03/04 16:31:19 OpenOrder-Error sending order: too frequent requests(21)
12/03/04 16:31:24 OpenOrder-Error sending order: unknown error(-19)
12/03/04 16:31:24 OpenOrder-Error sending order: too frequent requests(21)
12/03/04 16:31:29 OpenOrder-Error sending order: unknown error(124)
12/03/04 16:31:30 OpenOrder-Error sending order: too frequent requests(21)
12/03/04 16:31:35 OpenOrder-Error sending order: unknown error(63)
12/03/04 16:31:35 OpenOrder-Error sending order: too frequent requests(21)
12/03/04 16:31:41 OpenOrder-Error sending order: unknown error(-14)
12/03/04 16:31:41 OpenOrder-Error sending order: too frequent requests(21)
12/03/04 16:31:46 OpenOrder-Error sending order: unknown error(63)
12/03/04 16:31:46 OpenOrder-Error sending order: too frequent requests(21)
12/03/04 16:31:52 OpenOrder-Error sending order: unknown error(-88)
12/03/04 16:31:52 OpenOrder-Error sending order: too frequent requests(21)
12/03/04 16:31:58 OpenOrder-Error sending order: unknown error(-58)
12/03/04 16:31:58 OpenOrder-Error sending order: too frequent requests(21)
12/03/04 16:32:04 OpenOrder-Error sending order: unknown error(75)
12/03/04 16:32:04 OpenOrder-Error sending order: too frequent requests(21)
12/03/04 16:32:09 OpenOrder-Error sending order: unknown error(55)
12/03/04 16:32:09 OpenOrder-Error sending order: too frequent requests(21)
12/03/04 16:32:14 OpenOrder-Error sending order: unknown error(-119)
12/03/04 16:32:14 OpenOrder-Error sending order: too frequent requests(21)
12/03/04 16:32:20 OpenOrder-Error sending order: unknown error(65)
12/03/04 16:32:20 OpenOrder-Error sending order: too frequent requests(21)
12/03/04 16:32:26 OpenOrder-Error sending order: unknown error(-14)
12/03/04 16:32:26 OpenOrder-Error sending order: too frequent requests(21)
12/03/04 16:32:32 OpenOrder-Error sending order: unknown error(63)
12/03/04 16:32:32 OpenOrder-Error sending order: too frequent requests(21)

12/03/04 16:32:38 OpenOrder-Error getting trades: some error(2)
12/03/04 16:32:43 OpenOrder-Error getting trades: some error(2)
12/03/04 16:32:48 OpenOrder-Error getting trades: some error(2)
12/03/04 16:32:53 OpenOrder-Error getting trades: some error(2)
12/03/04 16:32:58 OpenOrder-Error getting trades: some error(2)
12/03/04 16:33:03 OpenOrder-Error getting trades: some error(2)
12/03/04 16:33:08 OpenOrder-Error getting trades: some error(2)
12/03/04 16:33:13 OpenOrder-Error getting trades: some error(2)
12/03/04 16:33:18 OpenOrder-Error getting trades.

Источник

Smartadm.ru