DoubangoTelecom / ultimateALPR-SDK

World's fastest ANPR / ALPR implementation for CPUs, GPUs, VPUs and NPUs using deep learning (Tensorflow, Tensorflow lite, TensorRT, OpenVX, OpenVINO). Multi-Charset (Latin, Korean, Chinese) & Multi-OS (Jetson, Android, Raspberry Pi, Linux, Windows) & Multi-Arch (ARM, x86).
https://www.doubango.org/webapps/alpr/
Other
617 stars 158 forks source link

WebApplication - Bad Request for Runtime Key activation #282

Closed constantintaivan closed 1 year ago

constantintaivan commented 1 year ago

Hello,

I'm using License manager Portal v1.0 and getting the following: error: Bad Request {"message":"[organisations.model.js] [activate].processMasterData() : Field [9] is null or empty"}

I expect some data is invalid within the runtimekey (master key is not null), can you help indicate which field is required?

Thank you, Kind regards

DoubangoTelecom commented 1 year ago

Hi,

You have to share full logs from the runtimeKey app

constantintaivan commented 1 year ago

Hi,

The runtimekey generates well, without any exception. I just copy that along with he master key and hit Send. I got bad request with above details. Maybe for the REST API is there a different endpoint for Activate? Or it's the same as ok web app. Could not find that in docs.

constantintaivan commented 1 year ago

Or if possible to decode the encrypted runtime key to see what fields are empty. It looks like it's not enough to change from base64 to string.

DoubangoTelecom commented 1 year ago

As already said, you must share the full logs if you want help.

constantintaivan commented 1 year ago

I just have these execution logs. If you need runtimekey let me know.

info: Host.General[337] Host lock lease acquired by instance ID '000000000000000000000000FDD17AAD'. info: Microsoft.Azure.WebJobs.Script.Workers.Rpc.RpcFunctionInvocationDispatcher[0] Worker process started and initialized. info: Function.Anpr[1] Executing 'Functions.Anpr' (Reason='This function was programmatically called via the host APIs.', Id=478559d8-fce3-4bde-9f5a-cffde402cf27) info: Function.Anpr.User[0] Python HTTP trigger function processed a request. info: Host.Function.Console[0] [COMPV INFO]: [UltAlprSdkEngine]Call: init info: Host.Function.Console[0] [COMPV INFO]: [UltAlprSdkEngine]jsonConfig: {"debug_level": "info", "debug_write_input_image_enabled": false, "debug_internal_data_path": ".", "num_threads": -1, "gpgpu_enabled": true, "max_latency": -1, "klass_vcr_gamma": 1.5, "detect_roi": [0, 0, 0, 0], "detect_minscore": 0.1, "car_noplate_detect_min_score": 0.8, "pyramidal_search_enabled": true, "pyramidal_search_sensitivity": 0.28, "pyramidal_search_minscore": 0.3, "pyramidal_search_min_image_size_inpixels": 800, "recogn_rectify_enabled": true, "recogn_minscore": 0.3, "recogn_score_type": "min", "assets_folder": "/ultimateALPR-SDK/assets", "charset": "latin", "car_noplate_detect_enabled": false, "ienv_enabled": false, "openvino_enabled": false, "openvino_device": "CPU", "npu_enabled": false, "klass_lpci_enabled": false, "klass_vcr_enabled": false, "klass_vmmr_enabled": false, "klass_vbsr_enabled": false, "license_token_file": "", "license_token_data": ""} info: Host.Function.Console[0] *[COMPV INFO]: [UltAlprSdkEngine] Copyright (C) 2011-2023 Doubango Telecom https://www.doubango.org info: Host.Function.Console[0] ultimateALPR-SDK https://github.com/DoubangoTelecom/ultimateALPR-SDK version 3.11.1 info: Host.Function.Console[0] info: Host.Function.Console[0] [COMPV INFO]: [CompVBase] Initializing [base] modules (v 1.0.0, nt -1)... info: Host.Function.Console[0] [COMPV INFO]: [CompVBase] sizeof(compv_scalar_t)= #8 info: Host.Function.Console[0] [COMPV INFO]: [CompVBase] sizeof(float)= #4 info: Host.Function.Console[0] [COMPV INFO]: Initializing window registery info: Host.Function.Console[0] [COMPV INFO]: [ImageDecoder] Initializing image decoder... info: Host.Function.Console[0] [COMPV INFO]: [CompVCpu] H: 'GenuineIntel', S: '', M: '61', MN: 'Intel(R) Core(TM) i5-5350U CPU @ 1.80GHz' info: Host.Function.Console[0] [COMPV INFO]: [CompVBase] CPU features: (intel);[x86];[x64];mmx;sse;sse2;sse3;ssse3;sse41;sse42;avx;avx2;fma3;erms;bmi1;bmi2;popcnt;cmov;aes;rdrand; info: Host.Function.Console[0] [COMPV INFO]: [CompVBase] CPU cores: online=#4, conf=#4 info: Host.Function.Console[0] [COMPV INFO]: [CompVBase] CPU cache1: line size: #64B, size :#32KB info: Host.Function.Console[0] [COMPV INFO]: [CompVBase] CPU Phys RAM size: #3870GB info: Host.Function.Console[0] [COMPV INFO]: [CompVBase] CPU endianness: LITTLE info: Host.Function.Console[0] [COMPV INFO]: [CompVBase] Binary type: X86_64 info: Host.Function.Console[0] [COMPV INFO]: [CompVBase] Intrinsic enabled info: Host.Function.Console[0] [COMPV INFO]: [CompVBase] Assembler enabled info: Host.Function.Console[0] [COMPV INFO]: [CompVBase] Code built with option /arch:SSE info: Host.Function.Console[0] [COMPV INFO]: [CompVBase] Code built with option /arch:SSE2 info: Host.Function.Console[0] [COMPV INFO]: [CompVBase] OS name: Generic Linux info: Host.Function.Console[0] [COMPV INFO]: [CompVBase] Math Fast Trig.: true info: Host.Function.Console[0] [COMPV INFO]: [CompVBase] Math Fixed Point: true info: Host.Function.Console[0] [COMPV INFO]: [CompVMathExp] Init info: Host.Function.Console[0] [COMPV INFO]: [CompVBase] Default alignment: #64 info: Host.Function.Console[0] [COMPV INFO]: [CompVBase] Best alignment: #64 info: Host.Function.Console[0] [COMPV INFO]: [CompVBase] Heap limit: #262144KB (#256MB) info: Host.Function.Console[0] [COMPV INFO]: [CompVParallel] Initializing [parallel] module... info: Host.Function.Console[0] [COMPV INFO]: /!\ Code in file '/home/ultimate/compv/base/compv_mem.cxx' in function 'CompVMemZero_C' starting at line #508: Not optimized -> No SIMD implementation found info: Host.Function.Console[0] [COMPV INFO]: [CompVAsyncTask11] run(coreId:requested=0,set=useless, threadId:0x7fb32ccb2700, kThreadSetAffinity:false) - ENTER info: Host.Function.Console[0] [COMPV INFO]: [CompVAsyncTask11] run(coreId:requested=1,set=useless, threadId:0x7fb323fff700, kThreadSetAffinity:false) - ENTER info: Host.Function.Console[0] [COMPV INFO]: [CompVAsyncTask11] run(coreId:requested=2,set=useless, threadId:0x7fb3237fe700, kThreadSetAffinity:false) - ENTER info: Host.Function.Console[0] [COMPV INFO]: [CompVAsyncTask11] run(coreId:requested=3,set=useless, threadId:0x7fb322ffd700, kThreadSetAffinity:false) - ENTER info: Host.Function.Console[0] [COMPV INFO]: [CompVThreadDispatcher] Thread dispatcher created with #4 threads/#4 cores info: Host.Function.Console[0] [COMPV INFO]: [CompVParallel] [Parallel] module initialized info: Host.Function.Console[0] [COMPV INFO]: [CompVBase] [Base] modules initialized info: Host.Function.Console[0] [COMPV INFO]: [CompVCore] Initializing [core] module (v 1.0.0)... info: Host.Function.Console[0] [COMPV INFO]: [CompVFeature] Registering feature factory with id = 1 and name = 'FAST (Features from Accelerated Segment Test)'... info: Host.Function.Console[0] [COMPV INFO]: [CompVFeature] Registering feature factory with id = 8 and name = 'ORB (Oriented FAST and Rotated BRIEF)'... info: Host.Function.Console[0] [COMPV INFO]: [CompVFeature] Registering feature factory with id = 27 and name = 'Sobel edge detector'... info: Host.Function.Console[0] [COMPV INFO]: [CompVFeature] Registering feature factory with id = 28 and name = 'Scharr edge detector'... info: Host.Function.Console[0] [COMPV INFO]: [CompVFeature] Registering feature factory with id = 29 and name = 'Prewitt edge detector'... info: Host.Function.Console[0] [COMPV INFO]: [CompVFeature] Registering feature factory with id = 20 and name = 'Canny edge detector'... info: Host.Function.Console[0] [COMPV INFO]: [CompVFeature] Registering feature factory with id = 30 and name = 'Hough standard (STD)'... info: Host.Function.Console[0] [COMPV INFO]: [CompVFeature] Registering feature factory with id = 31 and name = 'Kernel-based Hough transform (KHT)'... info: Host.Function.Console[0] [COMPV INFO]: [CompVFeature] Registering feature factory with id = 41 and name = 'Standard Histogram of oriented gradients (S-HOG)'... info: Host.Function.Console[0] [COMPV INFO]: [CompVMatcher] Registering matcher factory with id = 0 and name = 'Brute force matcher'... info: Host.Function.Console[0] [COMPV INFO]: [CompVConnectedComponentLabeling] Registering connected component labeling factory with id = 1 and name = 'PLSL (Parallel Light Speed Labeling)'... info: Host.Function.Console[0] [COMPV INFO]: [CompVConnectedComponentLabeling] Registering connected component labeling factory with id = 19 and name = 'LMSER (Linear Time Maximally Stable Extremal Regions)'... info: Host.Function.Console[0] [COMPV INFO]: [CompVGL] Initializing [gl] module (v 1.0.0)... info: Host.Function.Console[0] [COMPV INFO]: [CompVGL] GL module initialized info: Host.Function.Console[0] [COMPV INFO]: [CompVGpu] Initializing [gpu] module (v 1.0.0)... info: Host.Function.Console[0] [COMPV INFO]: [CompVCamera] Initializing [camera] module (v 1.0.0)... info: Host.Function.Console[0] [COMPV INFO]: [CompVDrawing] Initializing [drawing] module (v 1.0.0)... info: Host.Function.Console[0] [COMPV INFO]: [CompVDrawing] /!\ No jpeg decoder found info: Host.Function.Console[0] [COMPV INFO]: [CompVDrawing] Drawing module initialized info: Host.Function.Console[0] [COMPV INFO]: [CompVGpu] GPU enabled: true info: Host.Function.Console[0] [COMPV INFO]: /!\ Code in file '/home/ultimate/ultimateBase/lib/source/ultimate_base_engine.cxx' in function 'init' starting at line #75: Not optimized for GPU -> GPGPU computing not enabled or deactivated info: Host.Function.Console[0] [COMPV INFO]: [UltBaseOpenCL] Trying to load [libOpenCL.so] info: Host.Function.Console[0] [COMPV INFO]: [CompVSharedLib] Loading sharded library from libOpenCL.so fail: Host.Function.Console[0] [COMPV INFO]: [UltBaseOpenCL] Failed to load [libOpenCL.so] info: Host.Function.Console[0] [COMPV INFO]: [UltOcrEngine] Tensorflow version: 1.14.0 info: Host.Function.Console[0] *[COMPV INFO]: [UltAlprSdkEnginePrivate] Copyright (C) 2011-2023 Doubango Telecom https://www.doubango.org info: Host.Function.Console[0] You're using an unlicensed version of ultimateALPR-SDK https://github.com/DoubangoTelecom/ultimateALPR-SDK info: Host.Function.Console[0] without the rights to include the SDK in any form of commercial product. info: Host.Function.Console[0] [COMPV INFO]: [UltAlprSdkEnginePrivate]IC took 9291 millis info: Host.Function.Console[0] [COMPV INFO]: [CompVCpu] Enabling asm code info: Host.Function.Console[0] [COMPV INFO]: [CompVCpu] Enabling intrinsic code info: Host.Function.Console[0] [COMPV INFO]: [UltAlprSdkEnginePrivate]recogn_tf_num_threads: 4, acceleration backend: null info: Host.Function.Console[0] [COMPV INFO]: [UltOcrTensorflowSessionOptions] gpu_memory_alloc_max_percent = 0.100000 info: Host.Function.Console[0] [COMPV INFO]: [UltOcrTensorflowSessionOptions] Alloc session with gpu_memory_alloc_max_percent = 10% info: Host.Function.Console[0] [COMPV INFO]: [UltOcrTensorflowSessionOptions] gpu_memory_alloc_max_percent = 0.100000 info: Host.Function.Console[0] [COMPV INFO]: [UltOcrTensorflowSessionOptions] Alloc session with gpu_memory_alloc_max_percent = 10% info: Host.Function.Console[0] [COMPV INFO]: [UltOcrTensorflowSessionOptions] gpu_memory_alloc_max_percent = 0.250000 info: Host.Function.Console[0] [COMPV INFO]: [UltOcrTensorflowSessionOptions] Alloc session with gpu_memory_alloc_max_percent = 20% info: Host.Function.Console[0] [COMPV INFO]: [UltAlprSdkEngine]Call: requestRuntimeLicenseKey info: Host.Function.Console[0] [COMPV INFO]: [UltBaseEngine]UltBaseEngineReadSystemFile: fopen[0] returned null info: Host.Function.Console[0] [COMPV INFO]: [UltBaseEngine][UltBaseEngineGetXYZ002] Number of partitions found: 0 info: Host.Function.Console[0] [COMPV INFO]: [UltBaseEngine][Activation][S] If you try to activate a license, you'll be in big trouble. On Linux install udev ('apt-get install udev') and try again. info: Host.Function.Console[0] [COMPV INFO]: /!\ Code in file '/home/ultimate/compv/base/compv_mem.cxx' in function 'CompVMemCopy_C' starting at line #985: Not optimized -> No SIMD implementation found. On ARM consider http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka13544.html info: Host.Function.Console[0] [COMPV INFO]: /!\ Code in file '/home/ultimate/ultimateALPR/lib/source/ultimate_alpr_detector.cxx' in function 'process' starting at line #29: Not optimized -> Batching will not be activated for this function info: Host.Function.Console[0] [COMPV INFO]: /!\ Code in file '/home/ultimate/ultimateOCR/lib/source/ultimate_ocr_tensorflow_session_detect.cxx' in function 'processInternal' starting at line #116: Not optimized -> Batching not supported for this function info: Host.Function.Console[0] [COMPV INFO]: /!\ Code in file '/home/ultimate/ultimateText/lib/source/ultimate_text_fuser.cxx' in function 'process' starting at line #189: Is for testing and must not be called -> Fragments should be trimmed info: Host.Function.Console[0] [COMPV INFO]: /!\ Code in file '/home/ultimate/compv/base/math/compv_math_matrix.cxx' in function 'mulAtA' starting at line #881: Contains a TODO: -> Deprecated: use CompVMath::mulAB info: Host.Function.Console[0] [COMPV INFO]: /!\ Code in file '/home/ultimate/compv/base/math/compv_math_matrix.cxx' in function 'transpose' starting at line #619: Not optimized -> No MT implementation could be found info: Host.Function.Console[0] [COMPV INFO]: /!\ Code in file '/home/ultimate/ultimateText/lib/source/ultimate_text_slant.cxx' in function 'applyTransformation' starting at line #90: Not optimized -> Bundle homogenous transformation + transpose + mulABt + homogeneousToCartesian2D info: Host.Function.Console[0] [COMPV INFO]: /!\ Code in file '/home/ultimate/compv/base/math/compv_math_matrix.cxx' in function 'transpose' starting at line #619: Not optimized -> No MT implementation could be found info: Host.Function.Console[0] [COMPV INFO]: /!\ Code in file '/home/ultimate/compv/base/math/compv_math_transform.cxx' in function 'homogeneousToCartesian2D' starting at line #98: Not optimized -> No SIMD or GPU implementation found info: Host.Function.Console[0] [COMPV INFO]: /!\ Code in file '/home/ultimate/compv/base/math/compv_math_matrix.cxx' in function 'invA3x3' starting at line #515: Not optimized -> No SIMD or GPU implementation found. info: Function.Anpr.User[0] {"runtimeKey":"AB...=="} info: Host.Function.Console[0] [COMPV INFO]: [UltAlprSdkEngine]Call: deInit info: Host.Function.Console[0] [COMPV INFO]: [CompVBase] DeInitializing base modules (v 1.0.0)... info: Host.Function.Console[0] [COMPV INFO]: [Thread] Thread with id=0x7fb32ccb2700 will join info: Host.Function.Console[0] [COMPV INFO]: [CompVMem] poolCleanBuffersForCurrentThread(threadId:0x7fb32ccb2700) info: Host.Function.Console[0] [COMPV INFO]: [CompVAsyncTask11] run(threadId:0x7fb32ccb2700) - EXIT info: Host.Function.Console[0] [COMPV INFO]: Thread with id=0x7fb32ccb2700 will join info: Host.Function.Console[0] *[COMPV INFO]: [Thread] Thread with id=0x7fb32ccb2700 destroyed info: Host.Function.Console[0] [COMPV INFO]: [CompVMem] poolCleanBuffersForCurrentThread(threadId:0x7fb323fff700) info: Host.Function.Console[0] [COMPV INFO]: [CompVAsyncTask11] run(threadId:0x7fb323fff700) - EXIT info: Host.Function.Console[0] [COMPV INFO]: [Thread] Thread with id=0x7fb323fff700 will join info: Host.Function.Console[0] [COMPV INFO]: Thread with id=0x7fb323fff700 will join info: Host.Function.Console[0] *[COMPV INFO]: [Thread] Thread with id=0x7fb323fff700 destroyed info: Host.Function.Console[0] [COMPV INFO]: [Thread] Thread with id=0x7fb3237fe700 will join info: Host.Function.Console[0] [COMPV INFO]: [CompVMem] poolCleanBuffersForCurrentThread(threadId:0x7fb3237fe700) info: Host.Function.Console[0] [COMPV INFO]: [CompVAsyncTask11] run(threadId:0x7fb3237fe700) - EXIT info: Host.Function.Console[0] [COMPV INFO]: Thread with id=0x7fb3237fe700 will join info: Host.Function.Console[0] *[COMPV INFO]: [Thread] Thread with id=0x7fb3237fe700 destroyed info: Host.Function.Console[0] [COMPV INFO]: [Thread] Thread with id=0x7fb322ffd700 will join info: Host.Function.Console[0] [COMPV INFO]: [CompVMem] poolCleanBuffersForCurrentThread(threadId:0x7fb322ffd700) info: Host.Function.Console[0] [COMPV INFO]: [CompVAsyncTask11] run(threadId:0x7fb322ffd700) - EXIT info: Host.Function.Console[0] [COMPV INFO]: Thread with id=0x7fb322ffd700 will join info: Host.Function.Console[0] *[COMPV INFO]: [Thread] Thread with id=0x7fb322ffd700 destroyed info: Host.Function.Console[0] [COMPV INFO]: [CompVBase] Base modules deinitialized info: Host.Function.Console[0] [COMPV INFO]: [CompVBase] DeInitializing base modules (v 1.0.0)... info: Host.Function.Console[0] [COMPV INFO]: [CompVBase] Base modules deinitialized info: Host.Function.Console[0] [COMPV INFO]: Drawing module deinitialized info: Host.Function.Console[0] [COMPV INFO]: [CompVBase] DeInitializing base modules (v 1.0.0)... info: Host.Function.Console[0] [COMPV INFO]: [CompVBase] Base modules deinitialized info: Host.Function.Console[0] [COMPV INFO]: [CompVBase] DeInitializing base modules (v 1.0.0)... info: Host.Function.Console[0] [COMPV INFO]: [CompVBase] Base modules deinitialized info: Host.Function.Console[0] [COMPV INFO]: [CompVBase] DeInitializing base modules (v 1.0.0)... info: Host.Function.Console[0] [COMPV INFO]: [CompVBase] Base modules deinitialized info: Host.Function.Console[0] [COMPV INFO]: [CompVBase] DeInitializing base modules (v 1.0.0)... info: Host.Function.Console[0] [COMPV INFO]: [CompVBase] Base modules deinitialized info: Host.Function.Console[0] [COMPV INFO]: [CompVBase] DeInitializing base modules (v 1.0.0)... info: Host.Function.Console[0] [COMPV INFO]: [CompVBase] Base modules deinitialized info: Host.Function.Console[0] [PythonRecognizer] Init: OK -> {} info: Host.Function.Console[0] [PythonRecognizer] Process: OK -> {"duration":5112,"frame_id":0,"plates":[{"confidences":[89.51867,99.70879,90.65949,90.2525,89.55706,90.16195,89.51867,89.57386,91.05566],"text":"FG7IPY*","warpedBox":[21.37371,8.72039,227.2593,8.72039,227.2593,65.6216,21.37371,65.6216]}]} info: Host.Function.Console[0] [PythonRecognizer] DeInit: OK -> {} info: Function.Anpr[2] Executed 'Functions.Anpr' (Succeeded, Id=478559d8-fce3-4bde-9f5a-cffde402cf27, Duration=26248ms)

DoubangoTelecom commented 1 year ago

The runtime key doesn't "generate well" like what you said in your previous messages. Quote from your logs: [COMPV INFO]: [UltBaseEngine][Activation][S] If you try to activate a license, you'll be in big trouble. On Linux install udev ('apt-get install udev') and try again.

DoubangoTelecom commented 1 year ago

Microsoft.Azure

if you install udev as recommended it'll work if you're using a bare metal server. In your logs I see Microsoft.Azure, if you're really using Azure we don't recommend attaching the license to the hardware. read https://github.com/DoubangoTelecom/ultimateALPR-SDK/blob/master/AWS.md#azure

constantintaivan commented 1 year ago

Thank you for the feedback.

I'm running the SDK within an Azure Function by using Docker images. Now looking how to attach the licence to the VM, following the recommended approach: ./runtimeKey --type azure-instance --assets ../../../assets

Please confirm: according to doc, master key can only activate a runtimekey. So this means we can deploy licence only for Azure function in production (not dev or test - these will work with trial).

constantintaivan commented 1 year ago

Hi,

Moving forward when considering Elastic Scale Out plans for the Azure Function: Would it affect the runtimekey if we scale out or even change the Elastic Plan?

image

Thanks

DoubangoTelecom commented 1 year ago

As explained in the documentation, the license will be tied to the instance and remain valid as long as you do not terminate the instance. This said, I'm not familiar with Azure Function and not sure if we support it. Activation will fail if it's not support. Please note that we offer direct support for issues related to license Activation, you should contact the support team via email