Skip to content

[BUG] A Group license cannot be used to register the same device consecutively immediately after the initial registration. #2368

Description

@bluems

There is a bug when registering a group license on an internet-connected device if you complete the initial registration steps and self-registration are performed consecutively.

Env

OS: Ubuntu 24.04
Arch: x86_64
PyArmor: 9.2.6

Reproduce

Register the license file for initial registration, which you received via email, as follows.

$ pyarmor reg -p XXX pyarmor-regcode-xxx.txt
...
Are you sure to continue? (yes/no) yes
...
INFO     the registration file "pyarmor-regfile-xxx.zip" has been generated
INFO     this license has been activated sucessfully
...

Afterward, a file named pyarmor-regfile-xxx.zip is created, followed by a series of related prompts. You are then immediately guided through the device registration process with the message, “Do you want to register Pyarmor on this machine?

At this point, if you register the device, the license will not be registered correctly because the product argument is not provided.

...
Show group license usage in webbrowser? (n)
Yes (y), No (n), Quit (q): n
Do you want register Pyarmor in this machine? (n)
Yes (y), No (n), Quit (q): y
Please assign one unused device no. to this device, starts from 1
Type device no. (default is 1): 1
---------------- 1. generate device info
INFO     generating device file ".pyarmor/group/pyarmor-group-device.1"
INFO     current machine id is "**********"
---------------- 2. request device regfile
INFO     request device regfile ".pyarmor/group/pyarmor-group-device.1" (v3)
INFO     use group license "pyarmor-regfile-xxx.zip"
INFO     send request to server
INFO     write registration file "pyarmor-device-regfile-xxx.1.zip"
INFO     please copy deivce regfile to offline device and run
INFO         pyarmor reg pyarmor-device-regfile-xxx.1.zip
---------------- 3. register Pyarmor with device regfile
ERROR    WebRegister.register() missing 1 required positional argument: 'product'
$ 

We have identified the following key deliverables.
./pyarmor/group/pyarmor-group-device.1
pyarmor-device-regfile-xxx.1.zip
pyarmor-regfile-xxx.zip

By checking the list of output files to identify where the process was interrupted, and then running pyarmor reg ./pyarmor-device-regfile-xxx.1.zip again, the device will register itself successfully.

Logs

pyarmor.bug.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions