Can't delete user with name include '?' (and may be other special characters)

agdsign

Active Member
Sep 10, 2020
9
3
43
42
Hello.
I was create new user with unique name via API – 6lUs3WcD0?9%@pve, but now i can't delete him…
On creation process was not any errors, but on delete i have:

Parameter verification failed. (400)
9%@pve
: property is not defined in schema and the schema does not allow additional properties
userid: invalid format - value '6lUs3WcD0' does not look like a valid user name


How i can delete him now?
 
I was delete user from "/etc/pve/user.cfg" and "/etc/pve/priv/shadow.cfg", but think that ProxmoxVE need check userid on creation
 
probably not related - after all

did you create the user via GUI or via API call (curl or similar)?
if you used the API you need to uriencode the username before sending the DELETE request!

(creation works since the POST sends the data in the body and not in the url)
 
I'am using PHP API (curl)

this code create user with any userid
PHP:
$result = $px->post('/access/users', [
          'userid' => '6lUs3WcD?0%9@pve',
          'groups' => $param['user_group'],
          'password' => $param['user_password'],
        ]);

this dosn't work. can't create user:
PHP:
$result = $px->post('/access/users', [
          'userid' => urlencode('6lUs3WcD?0%9@pve'),
          'groups' => $param['user_group'],
          'password' => $param['user_password'],
        ]);

and this:
PHP:
$result = $px->post('/access/users', [
          'userid' => urlencode('6lUs3WcD@pve'),
          'groups' => $param['user_group'],
          'password' => $param['user_password'],
        ]);
 
Last edited:
encode the part before the '@pve'

also try deleting the user with encoded userid
 
I can create user with this code:
PHP:
$param = array(
  'user_group' => 'Users',
  'userid' => '6lUs3WcD0?9%',
  'user_password' => '1234567890',
);
$result = $px->post('/access/users', [
          'userid' => urlencode($param['userid']).'@pve',
          'groups' => $param['user_group'],
          'password' => $param['user_password'],
        ]);

in result i have user with name: 6lUs3WcD0%3F9%25@pve (in GUI)

but i can't delete him. Now is error 500:
delete user failed: error during cfs-locked 'file-user_cfg' operation: user '6lUs3WcD0?9%@pve' not found (500)