cPanel & WHM Version
106.0.11
Feb 22, 2017
14
4
53
Colombia
cPanel Access Level
Root Administrator
Twitter
Hello Guys,

I am testing the package edit API Update hosting plan as root using cURL and it shows an error message as follows:

(XID sxaa59) “_modpkg” requires a package name that you have permission to access.

Don't try to use the CLI API call, that one works just fine. It is the URL API call that shows this behavior. The package name has no "root_" prefix (and it shouldn't), do you know what is going on there?, i have seen a post from 2020 that does not help and everyone just went silent on it without an answer.


If anybody knows how to avoid this, workaround or fix, that would be great. I expected that the CLI call and URL call would behave the same, but here i am.
 
Last edited by a moderator:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
13,329
2,102
363
cPanel Access Level
Root Administrator
Running that worked well on my end - I used this command in an active session:

Code:
https://172.105.107.152:2087/cpsess4498069613/json-api/editpkg?api.version=1&name=testing&bwlimit=1000
and I received this output:

Code:
{"data":{"pkg":"testing"},"metadata":{"command":"editpkg","reason":"OK","version":1,"result":1}}
I also tried with the "&quota" option as well, and that worked fine for me also.

I did an addition test since you note your package is named "Personal" and did confirm that the package name is case-sensitive, so maybe that is related to the issue? But at this time, I can't reproduce the problem on my end.

You're always welcome to create a ticket with our team so we can check this directly on your system.
 
Feb 22, 2017
14
4
53
Colombia
cPanel Access Level
Root Administrator
Twitter
I am using a token (root user) and sending the authentication info on the "Authorization" header to execute the command, it may be related to the authentication method, it works just fine on CLI too.

If possible try creating a token and then using curl from the command line as suggested on the post mentioned on the first message, like this:

curl -XGET -H 'Authorization: whm root:MYTOKEN' -d 'api.version=1&name=testing&bwlimit=1000' 'https://172.105.107.152:2087/json-api/editpkg'
 
Last edited:
Feb 22, 2017
14
4
53
Colombia
cPanel Access Level
Root Administrator
Twitter
Guess i found the cause, did you checked the "Everything->All Features" privileges for the token, right?, uncheck it and try again (keep the remaining privileges checked).

The question is, why do you have to give the token access to all privileges if you have a "Packages Standard Privileges->Add/Remove Packages add-pkg" and "Packages Standard Privileges->Edit Packages edit-pkg" section on the permission list?. It may be misleading.