Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] The machine id change caused the license to become a trial version #1484

Closed
zssyqpgdll opened this issue Sep 19, 2023 · 27 comments
Closed
Labels

Comments

@zssyqpgdll
Copy link

I am using the windows system of a physical device and do not use docker. The machine code change causes the license of the original group version to be changed to the trial version.
How should I solve this problem?

$ pyarmor -d reg pyarmor-device-regfile-6095.1.zip
DEBUG    group license for machines: ['tokens/i6d409f0e5bd1df35ab1c28fe1cb26d86']
DEBUG    got machine id: i41b1f5b538782f9ebcf4ec8e90a8d8e4
DEBUG    got machine id: k9c085e4bd3f718a18dc97d3f94c9a2d5
DEBUG    got machine id: g9c085e4bd3f718a18dc97d3f94c9a2d5
DEBUG    got machine id: b46015f70851edb20cebb3cb47ee0a33e
ERROR    could not get docker host machine id

@zssyqpgdll zssyqpgdll added the bug label Sep 19, 2023
@zssyqpgdll
Copy link
Author

Why is there more than one machine id and is there a way to clear the machine id?

@jondy
Copy link
Contributor

jondy commented Sep 20, 2023

For compatible with old Pyarmor versions, there are many machine ids, the first char is version flag of machine id.

What's your Python version and platform (x86_64 or x86)? I'll build a debug version to print more information to check why machine id is changed.

@jondy
Copy link
Contributor

jondy commented Sep 20, 2023

By the way, if there are multiple platforms in one machine, each system should generate its own device file.

Are they same system?

If they're same systems, try to download extension pytransform3 with corresponding Python version. For example, if using Python 3.11

https://pyarmor.dashingsoft.com/downloads/temp/win64/cp3.11/pytransform3.pyd

Next check the output

python3.11
>>> from pytransform3 import get_hd_info
>>> get_hd_info(18)

Then reboot machine, and run the above commands and check output.

Compare the output, and report what's changed.

@zssyqpgdll
Copy link
Author

I'm using windows x86_64, python version 3.7.13.
All actions are implemented in one machine, one platform.

@jondy
Copy link
Contributor

jondy commented Sep 21, 2023

If they're same systems, try to download extension with corresponding Python version. For example, if using Python 3.7
https://pyarmor.dashingsoft.com/downloads/temp/win64/cp3.7/pytransform3.pyd

Next check the output

    python3.7                                                       
    >>> from pytransform3 import get_hd_info                         
    >>> get_hd_info(18)                                              

Then reboot machine, and run the above commands and check output.

Compare the output, and report what's changed.

@zssyqpgdll
Copy link
Author

After using the extension pack, the id still changed after the reboot, and my license became the trial version again.

image

`>>> from pyarmor.cli.core.pytransform3 import get_hd_info

print(get_hd_info(18))`

pre:
b'i1c954ce0b7c2948d7d9e26b770a64d23'
after reboot:
b'i41b1f5b538782f9ebcf4ec8e90a8d8e4'

@zssyqpgdll
Copy link
Author

How to do? I can't activate a new license every time I reboot the device, and the license has a limit on the number of offline devices.

@jondy
Copy link
Contributor

jondy commented Sep 21, 2023

Could you report what're changed of the hardware information?

If you use the downloaded pytransform3.pyd, it should print more information.

@jondy
Copy link
Contributor

jondy commented Sep 21, 2023

Please do not paste snapshot image, it's better to paste text directly.

@zssyqpgdll
Copy link
Author

I did print some more information when I used the downloaded pytransform3.pyd, but the printed information was confusing.

`

from pyarmor.cli.core.pytransform3 import get_hd_info
print(get_hd_info(18))
01:錘YQ : 00ffqa0a9d2
02:,g0W迯
: hecc5cb1e99
03:,g0W迯* : jecc5cb1e98
04:W : hecc5cb1e98
05:錘*YQ : 00ff!037f.
06:輨YrQ軂迯 : hecc5cb1e9c
07:disk : WD-WXT1EA7A0YHN
b'i55ddcd6d7cc78b41a35bf383287680d2'

`

@jondy
Copy link
Contributor

jondy commented Sep 21, 2023

It doesn't matter, just paste the output. But at least twice for 2 different machine id

@jondy
Copy link
Contributor

jondy commented Sep 21, 2023

I need check which hardware information is changed by comparing the output log.

@jondy
Copy link
Contributor

jondy commented Sep 21, 2023

This is a bug, I have found the problem. It will be fixed in next release v8.3.8

@jondy
Copy link
Contributor

jondy commented Sep 22, 2023

Fixed in v8.3.8, note that it need generate new device file for this device by Pyarmor 8.3.8

@jondy
Copy link
Contributor

jondy commented Sep 22, 2023

@BenjaminYde
Please upgrade Pyarmor to the latest v8.3.8, it fix a group license reboot doesn't work issue (if there are multiple network cards).

Note that it need generate new device file for this device by Pyarmor 8.3.8

@jondy jondy closed this as completed Sep 22, 2023
@BenjaminYde
Copy link

@jondy, tested with pyarmor 8.3.8 with reboot. Seems to be fixed now. Thanks! 👍

Did the following

pip install pyarmor==8.3.8
pyarmor --version

Did the following twice (with reboot in between)

pyarmor reg -g 5
pyarmor reg -g 5 ./pyarmor-regfile-6054.zip
cat .pyarmor/group/pyarmor-group-device.5

pyarmor reg ./pyarmor-device-regfile-6054.5.zip
pyarmor-auth pyarmor-device-regfile-6054.5.zip

@BenjaminYde
Copy link

BenjaminYde commented Sep 26, 2023

@jondy, Now I have another problem. using pyarmor 8.3.8
It is not possible to register inside the container using the device-regfile.

Step 1: Start the pyarmor-auth on the host:

pyarmor-auth pyarmor-device-regfile-6054.5.zip

Works fine.

Step 2: Activate pyarmor using the device regfile in the container:

  • copied pyarmor-group-device in container
  • copied pyarmor-device-regfile in container
  • activate pyarmor using regfile:
pyarmor reg pyarmor-device-regfile-6054.5.zip

This gives the following error:

INFO     Python 3.10.6
INFO     Pyarmor 8.3.8 (trial), 000000, non-profits
INFO     Platform linux.x86_64
INFO     register "pyarmor-device-regfile-6054.5.zip"
ERROR    could not get docker host machine id
Traceback (most recent call last):
  File "/home/vintecc/.local/lib/python3.10/site-packages/pyarmor/cli/register.py", line 200, in _get_docker_hostname
    machid = (flag + data).decode('utf-8')
UnboundLocalError: local variable 'data' referenced before assignment
ERROR    could not get docker host machine id

As you can see on the following picture, the request was received (from container >> host) and send back (host >> container):
image

Here a diagram I made :) :
Can help people to understand.

pyarmor_group_license

@jondy
Copy link
Contributor

jondy commented Sep 26, 2023

@BenjaminYde

Please upgrade Pyarmor to 8.3.9, the newest flag is missed in 8.3.8

@BenjaminYde
Copy link

BenjaminYde commented Sep 27, 2023

@jondy, tested with pip install pyarmor==8.3.9

  • Now i can register inside the docker container. It prints everything about the license being successfully activated.
  • But now i have the problem that when i run an obfuscation command, the pyarmor-auth server on the host is complaining about the license not being valid?

On the host (pyarmor-auth):
image

In the container (register regfile):
image

In the container (obfuscate pacakge):
image

  • The pyarmor license automatically changes to trail version after license failure.

On the host (pyarmor-auth):
image

@BenjaminYde
Copy link

BenjaminYde commented Sep 27, 2023

pyarmor 8.3.9 is released on pypi.org but no release has been made on this repo

@jondy
Copy link
Contributor

jondy commented Sep 28, 2023

@BenjaminYde

It changed a little, so it did not released in github.com

@BenjaminYde
Copy link

@jondy, do you have an idea when this would be fixed?
We want to use pyarmor group license for months but cannot because of the license issues.
We really look forward to using it.

@jondy
Copy link
Contributor

jondy commented Oct 3, 2023

@BenjaminYde

Please check #1511, maybe they're same issue. I'm researching this.

BTW, it's better to paste the log text instead image, because github cli could not show image.

@jondy
Copy link
Contributor

jondy commented Oct 3, 2023

@BenjaminYde

Sorry, it should check #1502, not 1511

@BenjaminYde
Copy link

Just curious, are there any more updates on this @jondy?

@jondy
Copy link
Contributor

jondy commented Oct 18, 2023

@BenjaminYde

Please upgrade Pyarmor to 8.4.0, and generate new device file by 8.4.0

Make sure machine id could keep same

@dashingsoft dashingsoft locked as resolved and limited conversation to collaborators Oct 18, 2023
@jondy
Copy link
Contributor

jondy commented Oct 19, 2023

@BenjaminYde

Please check issue #1542, it need extra settings if docker host is Windows or MacOS.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants
@jondy @BenjaminYde @zssyqpgdll and others