Failed to delete user. (400049)

There’s another way of fixing this via the SSH shell.  It won’t affect ANY other user or data.

One can delete the user directly from the user database.

Edit the database via sqlite3:

CloudNAS:~# sqlite3 /usr/local/nas/orion/orion.db
SQLite version 3.8.0.2 2013-09-03 17:11:13
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> SELECT * FROM DeviceUsers;

When you enter that SELECT command, you’ll get output that looks like this:

0|tony||||3|1||1|||
1|peter||||4|1|21|||
1234571|tony|c58f3f854c5cc0409596db5b41|deleted@email.addr||webuser|1|||1|||1399004
1234572|tony|6ea425cb2d545a4e2312035a95|deleted@email.addr|Windows 7|7|1|275822117123759||1|PC|WD My Cloud|139178
1234573|tony|18da458abb8997b9fa347cef60|deleted@email.addr|Windows 7|7|1|801903123757100||1|PC|WD My Cloud|1393893
1234574|tony|c18375d9bca520ce081d5b7ac1||Tonyâs iPad|3|1|3009114123729160||1|iPad|WD My Cloud|139250
1234575|tony|2bb66d923cd8ed98d7aceef8fb|deleted@email.addr|Windows 7|7|1|5091351404019449||1|PC|WD My Cloud|139261
1234576|peter|e35abfbacab02c2b525bb78ca4|deleted@email.addr|deleted@email.addr|4|1|7191231105903420||1|SAMSUNG-SGH-I337|WD My Cloud|139325
1234577|peter|4bf76f8fffa272322f1edbc688|deleted@email.addr|Windows 8|7|1|367429011517269||1|PC|WD My Cloud|13950
1234578|tony|2d296da1a031f38a44a299b157|deleted@email.addr|Windows 7|7|1|725360131366478||1|PC|WD My Cloud|173617
1234579|tony|3760c70d30abbbb8469344a2ec|deleted@email.addr|Windows 7|7|1|1045360125176822||1|PC|WD My Cloud|127444
1234571|tony|5e85c1c9ca4e78759a05f1b50f||Tony's Ipod|2|1|67381201255149581||1|iPod touch|WD My Cloud|140097
1234572|tony|b7f63ae41abcffdc18cc512aed|deleted@email.addr|deleted@email.addr|5|1|92112311711881573||1|ASUS Transformer Pad TF700T|WD My Cloud|1400
1234573|tony|c0f16f0a8da79347bbebf9f730|deleted@email.addr|deleted@email.addr|5|1|58471915132254208||1|ASUS Transformer Pad TF700T|WD My Cloud|14039
1234574|tony|175a5d12e514d9c435c8c3e70f||Tonyâs iPad|3|1|12062112316788458||1|iPad|WD My Cloud|140
1234575|tony|66f0e4ef1a362ded77c551d404||Tony's iPad|3|1|10189151220784231||1|ipad|WD Photos|140

 (note:   I’ve deliberately changed many of those fields to protect my info)

Anyway, you should see some lines that are missing most of the information, and the first number listed will be very small (like 1, 2 or 3) … not the 6-7 digit numbers of the others.

Something like this:

0|tony||||3|1||1|||
1|peter||||4|1|21|||

Note the FIRST NUMBER of the bad entry.  Such as 0 or 1 above.

Then enter the command:

sqlite> DELETE FROM DeviceUsers where device_user_id = XXXX;

 Replace the XXXX with the number you found above.

When done, enter:

sqlite> .exit

 and problem solved!

2 Likes