본문 바로가기
SW Developer/Iot ThingsBoard

Thingsboard log4j upgrade &license key error solve 해결 INVALID_LICENSE_CHECK_SECRET(107) INVALID_LICENSE_SECRET(101) INSTANCE_NOT_FOUND(105)

by ashespia 2022. 2. 3.
SMALL

 

Thingsboard log4j upgrade & license key error solve 해결 INVALID_LICENSE_CHECK_SECRET(107) INVALID_LICENSE_SECRET(101) INSTANCE_NOT_FOUND(105)

 

최근 log4j 보안 이슈가 큰 이슈로 발생했다. 이로 인해 사용하고 있는 서버들의 log 관련 라이브러리들을 업데이트해줘야 했다. Thingsboard도 관련해서 v3.3.3에 관련 패치 작업이 적용되었다. 이로 인해 사용하고 있는 Thingsboard 서버들을 업그레이드해줘야 했다. 

 

Thingsboard log4j 이슈 해결 버전 v3.3.3 (January 27, 2022)

Everything from TB CE v3.3.3 with the following improvements.

Main features:

·        Core & Rule Engine:

·        Added ‘Propagation Entity Types’ parameter to ‘Alarm Count’ rule node;

·        Added ‘Queue Name’ parameter to aggregation rule nodes;

·        Added REST_API_RULE_ENGINE_CALL to the audit logs;

·        Additional alarm read permission checks;

·        UI:

·        Added entity details page support;

·        Added persistent page link for scheduler events page;

·        CSS variables support for the white-labeling feature;

·        Added ability for tenant administrators to ignore the white-labeling settings configured on a system level;

·        Validation to maximum length of the group names;

·        “Delete” button in Self-registration form;

·        Integrations:

·        Additional automatic tests for remote integrations;

·        Custom domain support for LORIOT integration;

·        API Version to TTI integration;

·        Build scripts:

·        Docker images check for ARM64;

·        K8S scripts moved to separate repository;

·        Log4j -> Slf4j annotation due to typo;

·        Edge:

·        Added missing labels for assigned-to-edge/unassigned-from-edge;

·        Send notification event in case change owner of edge to edge session;

·        Improved integration tests;

Bug fixes:

·        Core & Rule Engine:

·        Fix in deprecated alarm count query;

·        Fix sending RPC response from integration downlink rule node

·        Use correct service id in rest api call reply method to send messages to correct services;

·        Integrations:

·        Fix reconnect for OPC UA integration;

·        Update converter details autocomplete;

·        UI:

·        Multiple fixes to self-registration form;

·        Fixed ability to create entity groups with white spaces instead of names;

·        Fixed show edit button in default dashboard without fullscreen mode;

·        Fixed close details after create/update/delete permission;

·        Fixed display of Audit Logs for Device Profile;

 

 

현재 사용하고 있는 Thingsboard 서버들은 Microservice architecture가 아닌 Monolithic architecture 구조로 되어 있다. 

License  또한 Subscription plans이 아닌 Perpetual Fallback License를 사용 중이다. 그래서 upgrade나 migration 시에 심적인 부담이 된다. 

 

저번 마이그레이션에 실수로 사용하지 않는 라이선스가 결제되어 고생했다.

그래서 이번 이전 작업에는 작업계획서를 만들어서 실수하지 않도록 진행했다.

Thingsboard upgrade Plan

1. 현재 사용중인 AWS thingsboard 3.2.2 서버 스냅샷

2. 생성된 스냅샷 스케일 업

3. 최신 버전까지 순차적으로 4번 업그레이드 진행

    Upgrading to 3.2.2PE ->

    Upgrading to 3.3PE ->

    Upgrading to 3.3.1PE ->

    Upgrading to 3.3.2PE ->

   Upgrading to 3.3.3PE

잠깐 기존 서버 연결 이슈 발생 시점 4에서번 절차에서 대략 5~30분 예상

4.    License 키 신규 이미지에 할당

5.    공인 IP 신규 이미지에 연결

 

Thingsboard PE license errors

1. Your instance is rebooted (인스턴스가 재부팅된 경우) 

2. Closed network & Proxy issue (폐쇄망 프락시 문제)

3. Violation of the license agreement (라이선스 계약위반)

 

 

License error occurred during migration

이번 migration 중에는 2개의 error 가 발생했다. 

 

ERROR o.t.license.client.TbLicenseClient - License Error: INVALID_LICENSE_CHECK_SECRET(107) - Invalid secret request sequence num
ERROR o.t.license.client.TbLicenseClient - License Error: INVALID_LICENSE_SECRET(101) - Invalid license secret!

[ERROR] License Error: INSTANCE_NOT_FOUND(105) - Instance not found!

[ERROR] Failed to initialize ThingsBoard License Client!

[ERROR] Failed to init license client

Terminating application due to critical License Error INSTANCE_NOT_FOUND(105), exit code [-1]...

 

solve errors

License portal에서 Perpetual licenses 메뉴 하위에 있는 Instances에 status 상태에 Active 되어 있는 라이선스를 삭제한다.

삭제하고 나면 상위 메뉴인 Perpetual licenses에 0/1로 표시된다. 

 

만약 INSTANCE_NOT_FOUND(105) error이 발생했다면 instance-license.data도 삭제해야 한다. 

 

 

rm -rf /usr/share/thingsboard/bin/instance-license.data

AWS에서 Instance 2개가 같은 라이선스로 구동되기 때문에 이전 서버의 Thingsboard는 stop 해서 멈추고

신규 Instance에서 instance-license.data도 삭제

License Portal 하위에서도 Instances를 삭제

 

이 상태에서 신규 마이그레이션 Thingsboard 인스턴스를 restart 재기동한다. 

 

정상적으로 error 없이 재기동되면 삭제되었던 라이선스가 새로 생성된다.

 

LIST

댓글