[GH-ISSUE #10] My API don't work #9

Closed
opened 2026-02-27 23:03:21 +03:00 by kerem · 2 comments
Owner

Originally created by @amonhk on GitHub (Jul 21, 2021).
Original GitHub issue: https://github.com/simonmicro/Pritunl-Fake-API/issues/10

Originally assigned to: @simonmicro on GitHub.

thanks for the work you did,
I tried to setup api on my server but even if it writes me "License activated." the activation fails and I find this error in the logs

ERROR] Failed to check subscription status
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/pritunl-1.30.2817.44-py3.8.egg/pritunl/subscription.py", line 59, in update
settings.local.sub_active = data['active']
TypeError: 'NoneType' object is not subscriptable

tested with /notification the page responds correctly in https
while with your address it works

can you give me some advice?
thank you.

Originally created by @amonhk on GitHub (Jul 21, 2021). Original GitHub issue: https://github.com/simonmicro/Pritunl-Fake-API/issues/10 Originally assigned to: @simonmicro on GitHub. thanks for the work you did, I tried to setup api on my server but even if it writes me "License activated." the activation fails and I find this error in the logs ERROR] Failed to check subscription status Traceback (most recent call last): File "/usr/lib/python3.8/site-packages/pritunl-1.30.2817.44-py3.8.egg/pritunl/subscription.py", line 59, in update settings.local.sub_active = data['active'] TypeError: 'NoneType' object is not subscriptable tested with /notification the page responds correctly in https while with your address it works can you give me some advice? thank you.
kerem 2026-02-27 23:03:21 +03:00
Author
Owner

@simonmicro commented on GitHub (Jul 21, 2021):

Hi,
the faked api must respond with a JSON-response. This response must contain the key active. Somehow the answer of your api does not contain this information. Try to capture the network communication or (even better) modify github.com/Simonmicro/Pritunl-Fake-API@8a8602d7f8/www/index.php (L125) to be enabled. This will create an access.log file, containing both Pritunls request and the apis answer. Please remove then any identifying information and post it here for further analysis.

But I guess somehow your PHP execution is broken... Meaning the server reacts with an empty response - commonly triggered by a 5XX error on your webserver... Please also take a look into his logs!

<!-- gh-comment-id:884271803 --> @simonmicro commented on GitHub (Jul 21, 2021): Hi, the faked api must respond with a JSON-response. This response must contain the key `active`. Somehow the answer of your api does not contain this information. Try to capture the network communication or (even better) modify https://github.com/Simonmicro/Pritunl-Fake-API/blob/8a8602d7f8e34a7cd2c2febaf889ee8b7d8f3bd5/www/index.php#L125 to be enabled. This will create an `access.log` file, containing both Pritunls request and the apis answer. Please remove then any identifying information and post it here for further analysis. But I _guess_ somehow your PHP execution is broken... Meaning the server reacts with an empty response - commonly triggered by a 5XX error on your webserver... Please also take a look into his logs!
Author
Owner

@amonhk commented on GitHub (Jul 21, 2021):

found the problem, this function does not work on my web server
file_get_contents('php://input')

<!-- gh-comment-id:884389572 --> @amonhk commented on GitHub (Jul 21, 2021): found the problem, this function does not work on my web server file_get_contents('php://input')
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Pritunl-Fake-API#9
No description provided.