API v2 regression broke user creation

Description

Hi, using the same exact code which worked fine in FN 11 after upgrading to TrueNAS core user creation fails and returns this:

["user_create.shell"]=>
array(1) {
[0]=>
array(2) {
["message"]=>
string(28) "Please select a valid shell."
["errno"]=>
int(22)
}
}

So, okay thats weird because it worked fine previously...

So when I tried to curl /api/v2.0/user/shell_choices to figure out what it wants since it no longer wants "/sbin/nologin" like it did 20 minutes ago before I upgraded.

So this:

[user@nessie nas]# curl -X POST -H "Content-Type: application/json" -H "Authorization: Basic root:pass" " http://10.0.0.18/api/v2.0/user/shell_choices "
500 Internal Server Error

Problem/Justification

None

Impact

None

SmartDraw Connector

Katalon Manual Tests (BETA)

Activity

Bug Clerk 
November 3, 2020 at 4:46 PM

Bug Clerk 
November 3, 2020 at 4:42 PM

Drew W 
October 28, 2020 at 7:25 PM

It looks like you guys moved nologin from /sbin/nologin to /usr/sbin/nologin and I had to update the path to the shell...

 

 

Drew W 
October 28, 2020 at 7:22 PM

 attached as private per your request.

Drew W 
October 28, 2020 at 7:18 PM

 I copied that cURL directly from your documentation so if it's the wrong command that's why it's the wrong command.

The payload for the create user command is exactly the same as it was under 11.3U4 and it worked flawlessly then.

URL: api/v2.0/user
JSON:
{"username":"wtfman","password":"stableapiforkplease","group_create":true,"full_name":"wtfman","uid":1027,"shell":"\/sbin\/nologin","home":"\/mnt\/Pool\/wtfman"}

 

Complete

Details

Assignee

Reporter

Labels

Components

Affects versions

Priority

More fields

Katalon Platform

Created October 27, 2020 at 4:23 PM
Updated July 1, 2022 at 5:00 PM
Resolved November 3, 2020 at 4:46 PM