Question

Terraform - Testing User Creation


Badge +4

I’ve been plugging away at testing Terraform with Commvault, but I keep hitting a wall with authentication. For the sake of testing I created a user called terraform. At first, I received an error in the WebServer.log which was helpful:

Exception Message:[The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.]

Error when running terraform apply:

│ Error: User creation failed with Error: Access denied

│   with commvault_user.user1,
│   on main.tf line 15, in resource "commvault_user" "user1":
│   15: resource "commvault_user" "user1" {

I used https://www.base64encode.org/ to convert the password to Base64 based on an article that I found in this community.

Reran terraform apply and received this error in WebServer.log:

39968 37    05/02 16:24:12 37  ###  - WEBAPI-STARTED processing [POST]:[/login] request.AdditionalInfo[ ConsoleType[Unknown]]
39968 37    05/02 16:24:12 37  ### DoLogin - Processing login request for terraform
39968 37    05/02 16:24:12 37  ### FillLoginResponseWithError - errorCode: [1116], [errorString: [Username/Password are incorrect], [userName: terraform]

 

I tested logging into the Commcell with the terraform ID with master privileges and it works no problem using the new Base64 password.

Quite a head scratcher… I opened a support case but curious if anyone has had any luck with Terraform and 11.28.44


7 replies

Userlevel 6
Badge +12

It looks like this?

 

 

Badge +4

 

Userlevel 6
Badge +12

 

i havent forgot about this… ill reply to this tomorrow

Badge +4

All good! I just updated the case with my findings from above.

Userlevel 6
Badge +12

So i was getting 404 in my lab for some reason on the searchsvc endpoint.  I look at my prior calls and my web_service_url for this lab box was:

web_service_url = "https://commserve.vcloud.lab/commandcenter/” 

 

After changing the URL I did an init and apply and everything was working (I swapped to a locally created account too, you mirror your “terraform” account)

 

 

Badge +4

I changed my URL to http://servername/commandcenter, did an init and then an apply but this time I receive this:

 

Error without a reason…?

 

WebServer.log:

7852  1516  05/04 19:02:44 1516 ###  - WEBAPI-STARTED processing [POST]:[/getDomains] request.AdditionalInfo[ ConsoleType[Unknown]]
7852  1516  05/04 19:02:44 1516 ### Invoke - WEBAPI-FINISHED processing [POST]:[/CVWebService.svc/getDomains] in [15] ms;  HTTP code 'OK'
7852  1516  05/04 19:02:45 1516 ###  - WEBAPI-STARTED processing [POST]:[/getDomains] request.AdditionalInfo[ ConsoleType[Unknown]]
7852  1516  05/04 19:02:45 1516 ### Invoke - WEBAPI-FINISHED processing [POST]:[/CVWebService.svc/getDomains] in [5] ms;  HTTP code 'OK'
7852  38    05/04 19:02:57 38  ###  - WEBAPI-STARTED processing [POST]:[/getDomains] request.AdditionalInfo[ ConsoleType[Unknown]]
7852  38    05/04 19:02:57 38  ### Invoke - WEBAPI-FINISHED processing [POST]:[/CVWebService.svc/getDomains] in [15] ms;  HTTP code 'OK'
7852  38    05/04 19:02:58 38  ###  - WEBAPI-STARTED processing [POST]:[/getDomains] request.AdditionalInfo[ ConsoleType[Unknown]]
7852  38    05/04 19:02:58 38  ### Invoke - WEBAPI-FINISHED processing [POST]:[/CVWebService.svc/getDomains] in [5] ms;  HTTP code 'OK'
7852  38    05/04 19:02:58 38  ###  - WEBAPI-STARTED processing [POST]:[/getDomains] request.AdditionalInfo[ ConsoleType[Unknown]]
7852  38    05/04 19:02:58 38  ### Invoke - WEBAPI-FINISHED processing [POST]:[/CVWebService.svc/getDomains] in [5] ms;  HTTP code 'OK'
7852  38    05/04 19:02:58 38  ###  - WEBAPI-STARTED processing [POST]:[/getDomains] request.AdditionalInfo[ ConsoleType[Unknown]]
7852  38    05/04 19:02:58 38  ### Invoke - WEBAPI-FINISHED processing [POST]:[/CVWebService.svc/getDomains] in [5] ms;  HTTP code 'OK'

Badge +4

I changed the resource to company following your example and it completed; however, it didn’t actually create the resource within Commvault. I’ll try to dig into that a bit on the side.

Can you try creating a user to see if you run into the same problem?

Reply