Hello,
Normally you can remote debug it using the remote debugging tool. You will need to change the path for things like Enterprise server to the path in the source (C:gitv1.0SolidCPSourcesSolidCP.EnterpriseServer)
Are you still getting the same error?
Kind Regards,
Trevor Robinson
Okay, so it fails there, I added values to comment, probably some value should not be null.
SqlHelper.ExecuteNonQuery(ConnectionString, CommandType.StoredProcedure,
ObjectQualifier + "AddUser", prmUserId,
new SqlParameter("@ActorId ", actorId), // 2
new SqlParameter("@OwnerID ", ownerId), // 1
new SqlParameter("@RoleID ", roleId), // 2
new SqlParameter("@StatusId ", statusId), // 1
new SqlParameter("@SubscriberNumber ", subscriberNumber), // null
new SqlParameter("@LoginStatusId ", loginStatusId), // 0
new SqlParameter("@IsDemo ", isDemo), // false
new SqlParameter("@IsPeer ", isPeer), // false
new SqlParameter("@Comments ", comments), // null
new SqlParameter("@username ", username), // example
new SqlParameter("@password ", password), // wdJ7UG4m1hrkK4vsMPq2DxweLJnn2eQPYXI6lmwg3TM=
new SqlParameter("@firstName ", firstName), // FirstName
new SqlParameter("@lastName ", lastName), // null
new SqlParameter("@email ", email), // example@example .com
new SqlParameter("@secondaryEmail ", secondaryEmail), // ""
new SqlParameter("@address ", address), // null
new SqlParameter("@city ", city), // null
new SqlParameter("@country ", country), // null
new SqlParameter("@state ", state), // null
new SqlParameter("@zip ", zip), // null
new SqlParameter("@primaryPhone ", primaryPhone), // null
new SqlParameter("@secondaryPhone ", secondaryPhone), // null
new SqlParameter("@fax ", fax), // null
new SqlParameter("@instantMessenger ", instantMessenger), // null
new SqlParameter("@htmlMail ", htmlMail), // true
new SqlParameter("@CompanyName ", companyName), // null
new SqlParameter("@EcommerceEnabled ", ecommerceEnabled)); // false
EDIT: looking to DB.. why is fax not allowed to be null? :O
EDIT 2: FINALLY FOUND why -2!
In DB StoredProcedures -> AddUser
-- check actor rights
IF dbo.CanCreateUser(@ActorID , @OwnerID ) = 0
BEGIN
SET @UserID = -2
RETURN
END
Hello,
That's some great work on the debugging the problems so far.
Looking at the problem you have found can you confirm if the user whmcs is a reseller or peer account in SolidCP?
Thanks,
Trevor Robinson
I found where problem was and now its working.
In solidCP I have reseller account "whmcs_module" which had active plan, from that plan I created new hosting spaces, hosting space I used in WHMCS was 8 but I was using spaceID for active plan which had "whmcs_module" account and not the one with hosting space 8.
So main problem: spaceID
Suggestions to improve error debugging:
- If createAccount throws -2 from DB it should say "wrong spaceID" or something like that on: https://git.key4ce.com/SolidCP/v1.0/blob/1.1.x/SolidCP/Sources/SolidCP.EnterpriseServer.Code/Wizards/UserCreationWizard.cs#L134
- If mail server is not configured or not installed on machine it should say something like that on instead of error -19xx on https://git.key4ce.com/SolidCP/v1.0/blob/1.1.x/SolidCP/Sources/SolidCP.EnterpriseServer.Code/Wizards/UserCreationWizard.cs#L343