Api error 200 entry not found occurred

Hello everyone, I past my morning with tech support at boston. Excellent service. We did try to find out wy archicad 18 upgrade 5100 don't want to start. It seems that code meter have a problems with IPV6. Executing Broadcast for CodeMeter License Servers 2015-04-08 13:52:07: Entry (101074:63:13447...

Hi All, please see the answer from wibu support below:
«CodeMeter does indeed support IPv6. The error only means, that they don’t have this entry on any of their CmContainer.
This can happen for example when your customer tries to use a module of your application, which requires an additional license, which the customer does not own.
In a CmDust.log you could see, that the customer does not have this license entry. (101074:63:134478911)

To generate a CmDust.log file, please follow the steps below:

1. Plug in your CmDongle
2. Start CmDust via “Start -> All Programs -> CodeMeter -> Tools -> CmDust”
3. A command prompt window will be opened automatically and also will be closed automatically after a few seconds
4. Now you will find the file «CmDust-Result.log» in your user directory which opens automatically in a new explorer window. If you like, you can open this file with a usual text editor (e.g. notepad) to see contents of the collected data»
If further questions remain, let us know! Best

Hello All,

I’m getting a CodeMeter error when I try to open SBPro the text of the error is:

“CodeMeter error: Please ensure your CM stick is securely in a USB port”

Everything was fine this afternoon but this evening this error appeared.

I did some research in this forum and found some post similar but not exactly the same. It looks like there is no license information on the CM stick.

Any help would be much appreciated since I can’t run SBPro.

Eric

Here’s some info from CodeMeter that might help diagnose this problem:

Events from CodeMeter Control Center:

2012-09-05 01:05:20: Logging activated.

2012-09-05 01:05:20: CodeMeter for Windows (B4.40.698.501.32.150)

2012-09-05 01:05:20: Running on Microsoft Windows 7 Business Edition, 64-bit Service Pack 1 (build 7601)

2012-09-05 01:05:20: Execution path: C:Program Files (x86)CodeMeterRuntimebin

2012-09-05 01:05:20: Found IPv4 address: 127.0.0.1 | 192.168.0.135

2012-09-05 01:05:20: Found IPv6 address: ::1 | fe80::4d34:3a62:ca8e:ef3%10

2012-09-05 01:05:20: Used Communication Mode: IPv6 IPv4 SharedMemory

2012-09-05 01:05:20: Used IP address: default address

2012-09-05 01:05:20: Used IP port: 22350

2012-09-05 01:05:20: Multicast server search: not available

2012-09-05 01:05:20: Run as network server: no

2012-09-05 01:05:20: Run as system service: yes

2012-09-05 01:05:20: Box Access: use direct access mode

2012-09-05 01:05:24: Detecting CmContainer with Serial Number 2-1638848

2012-09-05 01:05:24: Box Event HW59-507 (1638848) occurred.

2012-09-05 01:05:24: API Event HW0059 (RC) occurred.

2012-09-05 01:05:24: API Event WB0059 (MEMORY DAMAGED) occurred (returned to caller)

2012-09-05 01:05:24: Removable Device state has been changed!

2012-09-05 01:05:24: Removable Device state has been changed!

2012-09-05 01:05:42: Access from ::1 to SubSystem (Handle 16)

2012-09-05 01:05:42: Using security library version (US) 4.40.698.500

2012-09-05 01:05:42: Handle 16 released

2012-09-05 01:07:26: Executing Broadcast for CodeMeter License Servers

2012-09-05 01:07:27: Entry (100146:11081) not found — Event WB0200 (ENTRY NOT FOUND), Request IP-Address ::1

2012-09-05 01:07:27: API Error 200 (ENTRY NOT FOUND) occurred!

From the ‘Content’ page of ‘CodeMeter WebAdmin’:

“ERROR 201 The specified CmContainer () cannot be found.”

(Windows does recognize the CodeMeter.)

From the “Home” page of ‘CodeMeter WebAdmin’:

Host Name: My pc’s name

IP Address: 192.168.0.135

Operating System: Microsoft Windows 7 Business Edition, 64-bit Service Pack 1 (build 7601)

Server Startup: Sep/05/2012 01:05:20

Runtime Version: 4.40b

Server Version: Version 4.40a of Mar/15/2012 (Build 698)

WebAdmin Version: Version 4.40 of Mar/15/2012

From the ‘Server’ page of ‘CodeMeter WebAdmin’:

The name of my PC is shown and then there is no information other than the date of the last update (which is the time I rebooted)

From the ‘Configuration’ page of ‘CodeMeter WebAdmin’:

Bind AddressAll (Default)

Network Port: 22350

UDP Waiting Time: 1000ms

Server Search List: is empty

From the “Diagnosis” page:

2012-09-05 01:05:20: Logging activated.

2012-09-05 01:05:20: CodeMeter for Windows (B4.40.698.501.32.150)

2012-09-05 01:05:20: Running on Microsoft Windows 7 Business Edition, 64-bit Service Pack 1 (build 7601)

2012-09-05 01:05:20: Execution path: C:Program Files (x86)CodeMeterRuntimebin

2012-09-05 01:05:20: Found IPv4 address: 127.0.0.1 | 192.168.0.135

2012-09-05 01:05:20: Found IPv6 address: ::1 | fe80::4d34:3a62:ca8e:ef3%10

2012-09-05 01:05:20: Used Communication Mode: IPv6 IPv4 SharedMemory

2012-09-05 01:05:20: Used IP address: default address

2012-09-05 01:05:20: Used IP port: 22350

2012-09-05 01:05:20: Multicast server search: not available

2012-09-05 01:05:20: Run as network server: no

2012-09-05 01:05:20: Run as system service: yes

2012-09-05 01:05:20: Box Access: use direct access mode

2012-09-05 01:05:24: Detecting CmContainer with Serial Number 2-1638848

2012-09-05 01:05:24: Box Event HW59-507 (1638848) occurred.

2012-09-05 01:05:24: API Event HW0059 (RC) occurred.

2012-09-05 01:05:24: API Event WB0059 (MEMORY DAMAGED) occurred (returned to caller)

2012-09-05 01:05:24: Removable Device state has been changed!

2012-09-05 01:05:24: Removable Device state has been changed!

2012-09-05 01:05:42: Access from ::1 to SubSystem (Handle 16)

2012-09-05 01:05:42: Using security library version (US) 4.40.698.500

2012-09-05 01:05:42: Handle 16 released

2012-09-05 01:07:26: Executing Broadcast for CodeMeter License Servers

2012-09-05 01:07:27: Entry (100146:11081) not found — Event WB0200 (ENTRY NOT FOUND), Request IP-Address ::1

2012-09-05 01:07:27: API Error 200 (ENTRY NOT FOUND) occurred!

Challeee

Posts: 64
Joined: 22 May 2017
Location: Sweden
Contact:

Hello!
Am I the only one having problem with opening stuff into Avenger with Reason 12?


User avatar

Loque

Moderator
Posts: 10381
Joined: 28 Dec 2015

01 Sep 2021

What does «opening stuff into Avenger» mean? Drag&Drop samples? Patches?

Reason12, Win10


Challeee

Posts: 64
Joined: 22 May 2017
Location: Sweden
Contact:

01 Sep 2021

Opening patches makes Reason freeze!


User avatar

Loque

Moderator
Posts: 10381
Joined: 28 Dec 2015

01 Sep 2021

Challeee wrote: ↑

01 Sep 2021


Opening patches makes Reason freeze!

A dialog in the background somewhere?

Reason12, Win10


Challeee

Posts: 64
Joined: 22 May 2017
Location: Sweden
Contact:

01 Sep 2021

Loque wrote: ↑

01 Sep 2021

Challeee wrote: ↑

01 Sep 2021


Opening patches makes Reason freeze!

A dialog in the background somewhere?

What do you mean? The whole DAW and VST freezes!
And this only happens with Reason 12. It works fine in Reason 11.


User avatar

Loque

Moderator
Posts: 10381
Joined: 28 Dec 2015

01 Sep 2021

Challeee wrote: ↑

01 Sep 2021

Loque wrote: ↑

01 Sep 2021

A dialog in the background somewhere?

What do you mean? The whole DAW and VST freezes!
And this only happens with Reason 12. It works fine in Reason 11.

Sometimes error messages or other dialogs appear and are hidden by some windows, and those dialogs are blocking the application.

Reason12, Win10


User avatar

LABONERECORDINGS

RE Developer
Posts: 366
Joined: 16 Jan 2015
Location: UK
Contact:

01 Sep 2021

About to install R12 parallel to R11, we’ll let you know if we have any issues.

We also virtually plug in our elicensers / iloks / codemeters / Waves USB dongles remotely so we know how far we can push our connections when we’re away from base camp :D


User avatar

Despondo

Posts: 1002
Joined: 15 Jan 2015
Location: Charlotte, NC
Contact:

01 Sep 2021

I’m experiencing problems even loading Avenger in Reason 12. It works fine in Reason 10 and 11+.

In Reason 12, it gives the following error. I can dismiss the dialog, but it locks up Reason and I have to Force Quit the application.

I’m going to submit a support ticket.

Image


User avatar

Loque

Moderator
Posts: 10381
Joined: 28 Dec 2015

02 Sep 2021

Uhg… Maybe they uninstalled it? Can’t believe. Tried Avenger and it worked. Must check it again.

Reason12, Win10


User avatar

andre.k

Posts: 18
Joined: 02 Sep 2021

02 Sep 2021

Despondo wrote: ↑

01 Sep 2021


I’m experiencing problems even loading Avenger in Reason 12. It works fine in Reason 10 and 11+.

In Reason 12, it gives the following error. I can dismiss the dialog, but it locks up Reason and I have to Force Quit the application.

I’m going to submit a support ticket.

Image

this error is a codemeter error. are you sure that you installed Codemeter Runtime ?


User avatar

andre.k

Posts: 18
Joined: 02 Sep 2021

02 Sep 2021

hi @all

its may the wrong thread but since this is a VPS Avenger thread i think it should be fine for me to ask.
Are here also Support guys online in this Forum ?

I am Andre from Keilwerth Audio and i need a contact email where i dont need to wait one week for an awnser.

My Problem is that it seems that Reason 12 and the VPS Avenger are not working together. I got some reported issues now that Reason 12 and the Avenger are both Crahsing. I also tested the VPS Aenger with REason 12 on Windows 10 and it also Crashes the VPS Avenger and also Reason 12, i need to kill the reason 12 process and then i can restart Reason.

so if anyone may can help me to get in direct contact with the devs i would really appreciate it.


User avatar

Despondo

Posts: 1002
Joined: 15 Jan 2015
Location: Charlotte, NC
Contact:

02 Sep 2021

andre.k wrote: ↑

02 Sep 2021


hi @all

its may the wrong thread but since this is a VPS Avenger thread i think it should be fine for me to ask.
Are here also Support guys online in this Forum ?

I am Andre from Keilwerth Audio and i need a contact email where i dont need to wait one week for an awnser.

My Problem is that it seems that Reason 12 and the VPS Avenger are not working together. I got some reported issues now that Reason 12 and the Avenger are both Crahsing. I also tested the VPS Aenger with REason 12 on Windows 10 and it also Crashes the VPS Avenger and also Reason 12, i need to kill the reason 12 process and then i can restart Reason.

so if anyone may can help me to get in direct contact with the devs i would really appreciate it.

Try Mattias: memberlist.php?mode=viewprofile&u=5379


User avatar

Despondo

Posts: 1002
Joined: 15 Jan 2015
Location: Charlotte, NC
Contact:

02 Sep 2021

andre.k wrote: ↑

02 Sep 2021


this error is a codemeter error. are you sure that you installed Codemeter Runtime ?

Yup, it’s installed. It runs fine in Reason 10 and 11+ on the same machine that I have 12 on. In 12 it does not load properly and gives the error shown in my post above.


User avatar

Despondo

Posts: 1002
Joined: 15 Jan 2015
Location: Charlotte, NC
Contact:

02 Sep 2021

andre.k wrote: ↑

02 Sep 2021

Despondo wrote: ↑

01 Sep 2021


I’m experiencing problems even loading Avenger in Reason 12. It works fine in Reason 10 and 11+.

In Reason 12, it gives the following error. I can dismiss the dialog, but it locks up Reason and I have to Force Quit the application.

I’m going to submit a support ticket.

Image

this error is a codemeter error. are you sure that you installed Codemeter Runtime ?

FYI,

Here are the last few entries from the CodeMeter app log. Not sure if this means anything or not, but wanted to share.

Code: Select all

2021-09-02 20:52:33: API Event WB200 (ENTRY NOT FOUND) occurred (returned to caller)
2021-09-02 20:52:33: Handle 110 released
2021-09-02 20:52:36: Access from local(IPV4) to SubSystem (Handle 111) 
2021-09-02 20:52:36: API Event WB200 (ENTRY NOT FOUND) occurred (returned to caller)
2021-09-02 20:52:36: API Event WB200 (ENTRY NOT FOUND) occurred (returned to caller)
2021-09-02 20:52:36: Handle 111 released
2021-09-02 20:52:36: Access from local(IPV4) to SubSystem (Handle 112) 
2021-09-02 20:52:36: API Event WB200 (ENTRY NOT FOUND) occurred (returned to caller)
2021-09-02 20:52:36: Handle 112 released
2021-09-02 20:52:38: Access from local(IPV4) to FC:PC:FC=6000977:10000:1 with NoUserLimit (Handle 113) 
2021-09-02 20:52:38: Handle 113 released


User avatar

joeyluck

Moderator
Posts: 10249
Joined: 15 Jan 2015

02 Sep 2021

And just a reminder that ReasonTalk is a user run forum that happens to have involvement from some employees at Reason Studios. So while you can try sending a PM to someone here, understand that it is not the official line of communication with anybody at Reason Studios.


User avatar

andre.k

Posts: 18
Joined: 02 Sep 2021

03 Sep 2021

Despondo wrote: ↑

02 Sep 2021

andre.k wrote: ↑

02 Sep 2021


this error is a codemeter error. are you sure that you installed Codemeter Runtime ?

Yup, it’s installed. It runs fine in Reason 10 and 11+ on the same machine that I have 12 on. In 12 it does not load properly and gives the error shown in my post above.

Can you please tell me what Codemeter version is installed ?

I also checked again.
I drag and droped the VPS Avenger into the rak, then i clicked on Open. Avenger opened but if i close Avenger again it will crash the Reason GUI. If i double click the VPS Avenger to open it will crash Resaon.

I also know that this is no Official Support Forum for Reason. But as Dev for the vPS Avenger i want to check if Customers got some Information about the Reason 12 crashes that are not reported to me yet via email.

This all can be a Codemeter problem but i dont know yet.

kind regards
Andre


Challeee

Posts: 64
Joined: 22 May 2017
Location: Sweden
Contact:

03 Sep 2021

I can open avenger and get sound, then I try to zip through presets and it works but after the third or fourth preset Im changing to Reason and Avenger crashes.


User avatar

andre.k

Posts: 18
Joined: 02 Sep 2021

03 Sep 2021

Challeee wrote: ↑

03 Sep 2021


I can open avenger and get sound, then I try to zip through presets and it works but after the third or fourth preset Im changing to Reason and Avenger crashes.

Thank you for this Information. I tryed this and it also happens to me.

We are getting right into it. Please stay tunded.


DNGmaestro

Posts: 93
Joined: 20 Jan 2015

03 Sep 2021

Reason 12 is crashing a lot with one of my most used vst’s, Vengeance Avenger. It crashes 90% of the time i use it and when i’m using it, i hear clicking.
This did not happen in Reason 11, where it would run perfectly. Anyone else have this issue?


User avatar

andre.k

Posts: 18
Joined: 02 Sep 2021

03 Sep 2021

DNGmaestro wrote: ↑

03 Sep 2021


Reason 12 is crashing a lot with one of my most used vst’s, Vengeance Avenger. It crashes 90% of the time i use it and when i’m using it, i hear clicking.
This did not happen in Reason 11, where it would run perfectly. Anyone else have this issue?

tbh i think everyone got this problem atm. I am already in direct contact with the devs, so please stay tuned for more updates.


User avatar

Despondo

Posts: 1002
Joined: 15 Jan 2015
Location: Charlotte, NC
Contact:

03 Sep 2021

andre.k wrote: ↑

03 Sep 2021


Can you please tell me what Codemeter version is installed ?

Not sure if you still need an answer to this, but I have Version 6.90a installed.


User avatar

LABONERECORDINGS

RE Developer
Posts: 366
Joined: 16 Jan 2015
Location: UK
Contact:

03 Sep 2021

Just to throw in another spanner to your preverbial works….. Avenger works fine here on 12.2d36, we upgraded the Codemeter Runtime to what VPS Avenger site recommended.

Just ran R12 in demo, added Avenger, no problems whatsoever. Added Avenger, played notes, deleted Avenger, added a new one, played notes…. flawless, so something seems to be an issue with your system perhaps?

Win10x64 (21H1), ASUS FX705GM.


Challeee

Posts: 64
Joined: 22 May 2017
Location: Sweden
Contact:

03 Sep 2021

LABONERECORDINGS wrote: ↑

03 Sep 2021


Just to throw in another spanner to your preverbial works….. Avenger works fine here on 12.2d36, we upgraded the Codemeter Runtime to what VPS Avenger site recommended.

Just ran R12 in demo, added Avenger, no problems whatsoever. Added Avenger, played notes, deleted Avenger, added a new one, played notes…. flawless, so something seems to be an issue with your system perhaps?

Win10x64 (21H1), ASUS FX705GM.

No it doesn’t work. Try open Avenger and change through the presets of ARPS in the factory folder. Then it will crash.


User avatar

LABONERECORDINGS

RE Developer
Posts: 366
Joined: 16 Jan 2015
Location: UK
Contact:

03 Sep 2021

Challeee wrote: ↑

03 Sep 2021


No it doesn’t work. Try open Avenger and change through the presets of ARPS in the factory folder. Then it will crash.

Yep — done all that, creted Avenger, loaded up an ARP, played it, and even changed preset with keys down, next ARP preset worked no problem. Deleted Avenger, added another one, tried again, no issues.

Tried Factory ARPs as well as Synthstruments library

Running Codemeter 7.30 too if that’s a pointer


User avatar

Despondo

Posts: 1002
Joined: 15 Jan 2015
Location: Charlotte, NC
Contact:

03 Sep 2021

LABONERECORDINGS wrote: ↑

03 Sep 2021


Just to throw in another spanner to your preverbial works….. Avenger works fine here on 12.2d36, we upgraded the Codemeter Runtime to what VPS Avenger site recommended.

Thanks for the heads up. I updated to Codemeter 7.30 per instructions on the developer website, but I still get the crash upon loading the plugin on my Mac. Hopefully they get this sorted out with Reason Studios.


This post has already been read 8830 times!

Starting with VISSIM v8,  the CodeMeter dongle stores more licensing data in its flash RAM than earlier VISSIM versions. This may result in an issue called USB pass-through timeout,  particularly, when running VISSIM from within a VMWare virtual machine.

In this article,  let’s address this issue,  and present a documented fix.

In a previous post, we have discussed how to run VISSIM in a VMWare Workstation  virtual environment:

2016-02-15_18-28-32

https://blog.wupingxin.net/2015/05/21/vmware-usb-passthrough-running-vissim-in-a-virtual-machine/

This should be working fine until recently when PTV released VISSIM 8.0.  It is a great upgrade from v7 with a lot of enhancements, especially the mesoscopic traffic simulation, to name just the most note-worthy.

For existing users of VISSIM v7,  the upgrade to V8 requires one unusual step, i.e., to update the contents of the CodeMeter key flash.  Vissim V8 now apparently has more licensing-related data to enter the dongle than old Vissim versions.  As a result,  after upgrading to VISSIM v8 with the “re-flushed” CodeMeter key,  you might have problem launching VISSIM in a VMWare virtual machine.

The symptom is  something like this – first the code meter icon shows up in a yellowish-green color different than the normal color, and then VISSIM complains “CmContainer entry not find Error 200”:

2016-02-15_12-44-04

It is even more perplexing that there will be no problem running VISSIM with the same CodeMeter dongle, but on a direct physical computer. The virtual machine that you might encounter this issue includesWindows Server 2012 R2, Windows 10 x64 Pro. However, Windows 7 x64 virtual machine has no problem.

And you might see CodeMeter log output as follows:

2016-02-15 15:16:57: CodeMeter for Windows (B6.10.2018.501.32.180)
2016-02-15 15:16:57: Running on Microsoft Windows 10 Pro, 64-Bit
2016-02-15 15:16:57: Execution path: C:Program Files (x86)CodeMeterRuntimebin
2016-02-15 15:16:57: Found IPv4 address: 127.0.0.1 | 192.168.11.130
2016-02-15 15:16:57: Found IPv6 address: ::1 | fe80::a45b:71d5:41d1:150%3
2016-02-15 15:16:57: Used Communication Mode: IPv6 IPv4 SharedMemory
2016-02-15 15:16:57: Used IP address: default address
2016-02-15 15:16:57: Used IP port: 22350
2016-02-15 15:16:57: Used CmWAN port: 22351
2016-02-15 15:16:57: Multicast server search: not available
2016-02-15 15:16:57: Run as network server: no
2016-02-15 15:16:57: Run as CmWAN server: no
2016-02-15 15:16:57: Run as system service: yes
2016-02-15 15:16:57: Service startup delay:  0:08 minutes
2016-02-15 15:16:57: Box Access: use direct access mode
2016-02-15 15:16:59: Detecting CmContainer with Serial Number 2-2573687
2016-02-15 15:17:16: Runtime Event RT410-535 (2573687) occurred.
2016-02-15 15:17:46: Runtime Event RT410-535 (2573687) occurred.
2016-02-15 15:17:46: EBL-Trace: I1P1CX1CX1
2016-02-15 15:17:48: Event WB0407 (REPLUG) occurred: RePlug(2)
2016-02-15 15:17:48: Access from local(IPV6) to SubSystem (Handle 16)
2016-02-15 15:17:48: API Event WB218 (NO LICENSE AVAILABLE) occurred (returned to caller)
2016-02-15 15:17:48: Handle 16 released
2016-02-15 15:17:48: Access from local(IPV6) to SubSystem (Handle 17)
2016-02-15 15:17:48: API Event WB218 (NO LICENSE AVAILABLE) occurred (returned to caller)
2016-02-15 15:17:48: Handle 17 released
2016-02-15 15:17:48: Access from local(IPV6) to SubSystem (Handle 18)
2016-02-15 15:17:48: API Event WB218 (NO LICENSE AVAILABLE) occurred (returned to caller)
2016-02-15 15:17:48: Handle 18 released
2016-02-15 15:17:48: Box Event HW04-529 (2573687) occurred.
2016-02-15 15:17:49: API Error 105 (INVALID PARAMETER) occurred!
2016-02-15 15:17:49: Access from local(IPV6) to SubSystem (Handle 22)
2016-02-15 15:17:49: API Error 105 (INVALID PARAMETER) occurred!
2016-02-15 15:17:49: Access from local(IPV6) to SubSystem (Handle 26)
2016-02-15 15:17:49: Access from local(IPV6) to SubSystem (Handle 27)
2016-02-15 15:17:49: API Event WB218 (NO LICENSE AVAILABLE) occurred (returned to caller)
2016-02-15 15:17:49: Handle 27 released
2016-02-15 15:17:49: API Error 115 (WRONG HANDLE TYPE) occurred!
2016-02-15 15:17:49: Access from local(IPV6) to SubSystem (Handle 31)
2016-02-15 15:17:49: API Event WB218 (NO LICENSE AVAILABLE) occurred (returned to caller)
2016-02-15 15:17:49: Handle 31 released
2016-02-15 15:17:55: API Error 105 (INVALID PARAMETER) occurred!
2016-02-15 15:17:55: Access from local(IPV6) to SubSystem (Handle 35)
2016-02-15 15:17:55: Access from local(IPV6) to SubSystem (Handle 36)
2016-02-15 15:17:55: API Event WB218 (NO LICENSE AVAILABLE) occurred (returned to caller)
2016-02-15 15:17:55: Handle 36 released
2016-02-15 15:17:55: API Error 115 (WRONG HANDLE TYPE) occurred!
2016-02-15 15:17:55: API Error 105 (INVALID PARAMETER) occurred!
2016-02-15 15:17:55: Access from local(IPV6) to SubSystem (Handle 40)
2016-02-15 15:17:55: API Event WB218 (NO LICENSE AVAILABLE) occurred (returned to caller)
2016-02-15 15:17:55: Handle 40 released

The problem  is really caused by USB timeouts when reading a large quantity of licenses.  This happens when CmStick uses the VMWare USB pass-through communication mode between CodeMeter Run-time Server (that is running inside the virtual machine) and CM-Stick (that is plugged via the host physical computer’s USB port).   That is why I believe that PTV has added a lot more license items into the CmStick than earlier versions, since this didn’t happen before.  The solution (thanks to the heads up from Mr. John Battista from WiBu USA) is to use the “File I/O” communication mode (UseUmsDA = 0) :

CodeMeter communication mode (on the virtual machine) can be changed  as follows:

1. In the virtual machine Guest OS, open the windows registry using regedit.exe

2. Go To: HKEY_LOCAL_MACHINESOFTWAREWIBU-SYSTEMSCodeMeterServerCurrentVersion

3. Set the “UseUmsDA” variable to 0

4. Restart CodeMeter Service, or restart the virtual machine directly

Then everything is working again.  Have fun!

This post has already been read 8830 times!

Время прочтения
6 мин

Просмотры 13K

Почти все разработчики так или иначе постоянно работают с api по http, клиентские разработчики работают с api backend своего сайта или приложения, а бэкендеры «дергают» бэкенды других сервисов, как внутренних, так и внешних. И мне кажется, одна из самых главных вещей в хорошем API это формат передачи ошибок. Ведь если это сделано плохо/неудобно, то разработчик, использующий это API, скорее всего не обработает ошибки, а клиенты будут пользоваться молчаливо ломающимся продуктом.

За 7 лет я как поддерживал множество legacy API, так и разрабатывал c нуля. И я поработал, наверное, с большинством стратегий по возвращению ошибок, но каждая из них создавала дискомфорт в той или иной мере. В последнее время я нащупал оптимальный вариант, о котором и хочу рассказать, но с начала расскажу о двух наиболее популярных вариантах.

№1: HTTP статусы

Если почитать апологетов REST, то для кодов ошибок надо использовать HTTP статусы, а текст ошибки отдавать в теле или в специальном заголовке. Например:

Success:

HTTP 200 GET /v1/user/1
Body: { name: 'Вася' }

Error:

HTTP 404 GET /v1/user/1
Body: 'Не найден пользователь'

Если у вас примитивная бизнес-логика или API из 5 url, то в принципе это нормальный подход. Однако как-только бизнес-логика станет сложнее, то начнется ряд проблем.

Http статусы предназначались для описания ошибок при передаче данных, а про логику вашего приложения никто не думал. Статусов явно не хватает для описания всего разнообразия ошибок в вашем проекте, да они и не были для этого предназначены. И тут начинается натягивание «совы на глобус»: все начинают спорить, какой статус ошибки дать в том или ином случае. Пример: Есть API для task manager. Какой статус надо вернуть в случае, если пользователь хочет взять задачу, а ее уже взял в работу другой пользователь? Ссылка на http статусы. И таких проблемных примеров можно придумать много.

REST скорее концепция, чем формат общения из чего следует неоднозначность использования статусов. Разработчики используют статусы как им заблагорассудится. Например, некоторые API при отсутствии сущности возвращают 404 и текст ошибки, а некоторые 200 и пустое тело.

Бэкенд разработчику в проекте непросто выбрать статус для ошибки, а клиентскому разработчику неочевидно какой статус предназначен для того или иного типа ошибок бизнес-логики. По-хорошему в проекте придется держать enum для того, чтобы описать какие ошибки относятся к тому или иному статусу.

Когда бизнес-логика приложения усложняется, начинают делать как-то так:

HTTP 400 PUT /v1/task/1 { status: 'doing' }
Body: { error_code: '12', error_message: 'Задача уже взята другим исполнителем' } 

Из-за ограниченности http статусов разработчики начинают вводить “свои” коды ошибок для каждого статуса и передавать их в теле ответа. Другими словами, пользователю API приходится писать нечто подобное:

if (status === 200) {
  // Success
} else if (status === 500) {
  // some code
} else if (status === 400) {
  if (body.error_code === 1) {
    // some code
  } else if (body.error_code === 2) {
    // some code
  } else {
    // some code
  }
} else if (status === 404) {
  // some code
} else {
  // some code
}

Из-за этого ветвление клиентского кода начинает стремительно расти: множество http статусов и множество кодов в самом сообщении. Для каждого ошибочного http статуса необходимо проверить наличие кодов ошибок в теле сообщения. От комбинаторного взрыва начинает конкретно пухнуть башка! А значит обработку ошибок скорее всего сведут к сообщению типа “Произошла ошибка” или к молчаливому некорректному поведению.

Многие системы мониторинга сервисов привязываются к http статусам, но это не помогает в мониторинге, если статусы используются для описания ошибок бизнес логики. Например, у нас резкий всплеск ошибок 429 на графике.  Это началась DDOS атака, или кто-то из разработчиков выбрал неудачный статус?

Итог:  Начать с таким подходом легко и просто и для простого API это вполне подойдет. Но если логика стала сложнее, то использование статусов для описания того, что не укладывается в заданные рамки протокола http приводит к неоднозначности использования и последующим костылям для работы с ошибками. Или что еще хуже к формализму, что ведет к неприятному пользовательскому опыту.

№2: На все 200

Есть другой подход, даже более старый, чем REST, а именно: на все ошибки связанные с бизнес-логикой возвращать 200, а уже в теле ответа есть информация об ошибке. Например:

Вариант 1:

Success:
HTTP 200 GET /v1/user/1
Body: { ok: true, data: { name: 'Вася' } }

Error:
HTTP 200 GET /v1/user/1
Body: { ok: false, error: { code: 1, msg: 'Не найден пользователь' } }

Вариант 2:

Success:
HTTP 200 GET /v1/user/1
Body: { data: { name: 'Вася' }, error: null }

Error:
HTTP 200 GET /v1/user/1
Body: { data: null, error: { code: 1, msg: 'Не найден пользователь' } }

На самом деле формат зависит от вас или от выбранной библиотеки для реализации коммуникации, например JSON-API.

Звучит здорово, мы теперь отвязались от http статусов и можем спокойно ввести свои коды ошибок. У нас больше нет проблемы “впихнуть невпихуемое”. Выбор нового типа ошибки не вызывает споров, а сводится просто к введению нового числового номера (например, последовательно) или строковой константы. Например:

module.exports = {
  NOT_FOUND: 1,
  VALIDATION: 2,
 // ….
}

module.exports = {
  NOT_FOUND: ‘NOT_AUTHORIZED’,
  VALIDATION: ‘VALIDATION’,
 // ….
}

Клиентские разработчики просто основываясь на кодах ошибок могут создать классы/типы ошибок и притом не бояться, что сервер вернет один и тот же код для разных типов ошибок (из-за бедности http статусов).

Обработка ошибок становится менее ветвящейся, множество http статусов превратились в два: 200 и все остальные (ошибки транспорта).

if (status === 200) {
  if (body.error) {
    var error = body.error;
    if (error.code === 1) {
      // some code
    } else if (error.code === 2) {
      // some code
    } else {
      // some code
    }
  } else {
    // Success
  }
} else {
  // transport erros
}

В некоторых случаях, если есть библиотека десериализации данных, она может взять часть работы на себя. Писать SDK вокруг такого подхода проще нежели вокруг той или иной имплементации REST, ведь реализация зависит от того, как это видел автор. Кроме того, теперь никто не вызовет случайное срабатывание alert в мониторинге из-за того, что выбрал неудачный код ошибки.

Но неудобства тоже есть:

  • Избыточность полей при передаче данных, т.е. нужно всегда передавать 2 поля: для данных и для ошибки. Это усложняет чтение логов и написание документации.

  • При использовании средств отладки (Chrome DevTools) или других подобных инструментов вы не сможете быстро найти ошибочные запросы бизнес логики, придется обязательно заглянуть в тело ответа (ведь всегда 200)

  • Мониторинг теперь точно будет срабатывать только на ошибки транспорта, а не бизнес-логики, но для мониторинга логики надо будет дописывать парсинг тела сообщения.

В некоторых случаях данный подход вырождается в RPC, то есть по сути вообще отказываются от использования url и шлют все на один url методом POST, а в теле сообщения передают все параметры. Мне кажется это не правильным, ведь url это прекрасный именованный namespace, зачем от этого отказываться, не понятно?! Кроме того, RPC создает проблемы:

  • нельзя кэшировать по http GET запросы, так как замешали чтение и запись в один метод POST

  • нельзя делать повторы для неудавшихся GET запросов (на backend) на реверс-прокси (например, nginx) по указанной выше причине

  • имеются проблемы с документированием – swagger и  ApiDoc не подходят, а удобных аналогов я не нашел

Итог: Для сложной бизнес-логики с большим количеством типов ошибок такой подход лучше, чем расплывчатый REST, не зря в проектах c “разухабистой” бизнес-логикой  часто именно такой подход и используют.

№3: Смешанный

Возьмем лучшее от двух миров. Мы выберем один http статус, например, 400 или 422 для всех ошибок бизнес-логики, а в теле ответа будем указывать код ошибки или строковую константу. Например:

Success:

HTTP 200 /v1/user/1
Body: { name: 'Вася' }

Error:

HTTP 400 /v1/user/1
Body: { error: { code: 1, msg: 'Не найден пользователь' } }

Коды:

  • 200 – успех

  • 400 – ошибка бизнес логики

  • остальное ошибки в транспорте

Тело ответа для удачного запроса у нас имеет произвольную структуру, а вот для ошибки есть четкая  схема. Мы избавляемся от избыточности данных (поле ошибки/данных) благодаря использованию http статуса в сравнении со вторым вариантом. Клиентский код упрощается в плане обработки ошибки (в сравнении с первым вариантом). Также мы снижаем его вложенность за счет использования отдельного http статуса для ошибок бизнес логики (в сравнении со вторым вариантом).

if (status === 200) {
  // Success
} else if (status === 400) {
  if (body.error.code === 1) {
    // some code
  } else if (body.error.code === 2) {
    // some code
  } else {
    // some code
  }
} else {
  // transport erros
}

Мы можем расширять объект ошибки для детализации проблемы, если хотим. С мониторингом все как во втором варианте, дописывать парсинг придется, но и риска “стрельбы” некорректными alert нету. Для документирования можем спокойно использовать Swagger и ApiDoc. При этом сохраняется удобство использования инструментов разработчика, таких как Chrome DevTools, Postman, Talend API.

Итог:  Использую данный подход уже в нескольких проектах, где множество типов ошибок и все крайне довольны, как клиентские разработчики, так и бэкендеры. Внедрение новой ошибки не вызывает споров, проблем и противоречий. Данный подход объединяет преимущества первого и второго варианта, при этом код более читабельный и структурированный.

Самое главное какой бы формат ошибок вы бы не выбрали лучше обговорить его заранее и следовать ему. Если эту вещь пустить на “самотек”, то очень скоро обработка ошибок в проекте станет невыносимо сложной для всех.

P.S. Иногда ошибки любят передавать массивом

{ error: [{ code: 1, msg: 'Не найден пользователь' }] }

Но это актуально в основном в двух случаях:

  • Когда наш API выступает в роли сервиса без фронтенда (нет сайта/приложения). Например, сервис платежей.

  • Когда в API есть url для загрузки какого-нибудь длинного отчета в котором может быть ошибка в каждой строке/колонке. И тогда для пользователя удобнее, чтобы ошибки в приложении сразу показывались все, а не по одной.

В противном случае нет особого смысла закладываться сразу на массив ошибок, потому что базовая валидация данных должна происходить на клиенте, зато код упрощается как на сервере, так и на клиенте. А user-experience хакеров, лезущих напрямую  в наше API,  не должен нас волновать?HTTP

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Apache error log где найти
  • Api client error что это значит
  • Api client error voka
  • Apache error log ubuntu
  • Apache error log command

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии