ansible tower "msg": "ntlm: Bad HTTP response returned from server. Code 403", - email

I have ansible version 2.9.18. Trying to send the email notification when deployment job completed. When I execute the template, it will call the mail module .yaml file.
But getting below error while executing the mail module:
Below is the mail module configuration for reference:
However I'm able to execute other tasks on the same server like installing the chrome or other agents. I'm wondering whats wrong while calling the mail module.

We were using only host name alone and tried with IP address as well.
Solution:
We have to use server name with full fqdn name (Ex: servername.sampledomain.com)
This helped us to overcome this error.
The other issue was "ansible_shell_type: powershell" was mentioned in the code level. After committing that line helped us to over come power shell related error.

Related

Unable to invoke web-request for script called in scheduled task for service account

We have a Powershell script which downloads some zip files from a website and we have called the script in a scheduled task.
The problem is we are not getting the zip files even after the scheduled task is finished successfully. We are using a service account for that. Running the script manually downloads the zip file without any issues. Also, for another user which we use to login into the server, the task is working fine.
The issue started after our service account got locked out because of too many failed attempts in some other system.
I have tried bypassing the execution policy but no luck.
I have tried creating a similar new task but no luck.
I tried Start-in option to provide the task the location of the script but no luck.
After too much troubleshooting, I found the error in the Powershell logs in Event Viewer. Please find the error below:
Error Message = Unable to connect to the remote server
Fully Qualified Error ID = WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
This shows that the task is unable to invoke the web request. Can this be a permission issue? If yes, then how can I provide the required access?
I troubleshooted a bit more and found that the issue is with the proxy. Can somebody tell me how can I resolve this issue? For the local user it is working fine. Even I am able to access the webpage manually through IE. Shall I import proxy settings from IE? If yes then how to do that?
I finally figured out the solution for this. I added proxy details in the script which will force the Invoke web request command to send the request to that proxy server. This thing has resolved my issue.
Regards,
Mitesh Agrawal

Web Deploy not working. Timeout on client. Schannel 1203 on server

I'm trying to deploy an application via web deploy to a windows 2012 r2 server.
First tried installing iis, web deploy using the msi. After getting an unreachable error I saw somewhere that I needed wmsvc to be installed and installed it via powershell command Install-WindowsFeature Web-Mgmt-Service.
I stopped getting the unreachable error and started getting this error ->
Error: Could not complete the request to remote agent URL 'http://xx.x.xx.xx:8172/MSDEPLOYAGENTSERVICE'.
Error: The operation has timed out
On the server's event viewer under system I get the following error ->
A fatal alert was generated and sent to the remote endpoint. This may result in termination of the connection. The TLS protocol defined fatal error code is 10. The Windows SChannel error state is 1203.
Any idea of what could be going on? Did I miss something on the installation?
After this I also tried installing everything but without iis and I get the same error.
So, this is really not a PoSH issue.
Maybe you should consider movin gthis question to another forum.
Anyway, you have either real server config issues (this can sometimes mean wipe and rebuild - very ugly option - but if it's a virtual machine and you have a snapshot, just roll back), or an app causing this.
Typically for Schannel type of error, it has to do with application or service in machine not able to complete any SSL connection sort of connection.
The error state parameter of 1203 means client error connecting to server, ie invalid ClientHello from the client
See if you can collect more data by...
https://support.microsoft.com/en-us/help/260729/how-to-enable-schannel-event-logging-in-iis
I realized this is an old question, but in case somebody ran into the same issue, here are my solution.
I had to follow this guidelines : https://learn.microsoft.com/en-us/aspnet/web-forms/overview/deployment/configuring-server-environments-for-web-deployment/configuring-a-web-server-for-web-deploy-publishing-web-deploy-handler
Copy the resulting publishsetting file. In the Publish/Profile page import it.
In the Publish/Connection page, change the server to the server address with the 8172 port. Add the password. Change the Destination URL to the site to go to after the publish is completed.
Then after Validate connection was completed, go ahead and publish it!

Internal Server Error in PowerShell cmdlets for Microsoft Dynamics CRM

On Windows Server 2012 Datacenter with Microsoft Dynamics CRM 2016 installed, I want to run a deployment command but for every commands I get this error: "(500) Internal Server Error".
I first run this:
Add-PSSnapin Microsoft.Crm.PowerShell
and it will work fine and when I check it with get-pssnapin and Get-Help *Crm*, every thing is fine and every thing that I need is registered. but when I want to run a cmdlets command like these, I face the error: Get-CrmSetting or Get-CrmCertificate or ...
For example for Get-CrmSetting TraceSettings it give me this error:
How can I solve this problem and error?
Thanks
According to this article, you might want to try:
Get-CrmSetting –SettingType TraceSettings
Here are a couple more items to investigate, from this article:
To use the XRM tooling cmdlets, you need PowerShell version 3.0 or
later. To check the version, open a PowerShell window and run the
following command: $Host
Set the execution policy to run the signed PowerShell scripts. To do
so, open a PowerShell window as an administrator and run the
following command: Set-ExecutionPolicy -ExecutionPolicy AllSigned
Verify the (CRMDeploymentServiceAppPool Application Pool identity) has SQL SEVER SysAdmin permission. This is needed to perform any CRM configuration changes and organizational operations.
Note: it does not matter if the account executing the PowerShell is a system admin or SQL server sysadmin because these operations are executed via the deployment web service.
Deployment Web Service (CRMDeploymentServiceAppPool Application Pool identity)
....Sysadmin permission on the instance of SQL Server to be used for the configuration and organization databases.
....
(500) Internal Server Error, refers to a HTTP response status code. This means that the Powershell command is calling a URL and the URL is reporting a error.
You need to know the URL to really find out what the problem is. One way you can get the URL, is downloading Fiddler Classic. Once installed, you have to enable HTTPS decryption.
In my case the URL was...
https://<my-crm-domain>/XrmDeployment/2011/deployment.svc?wsdl
When I ran this URL on the server where CRM is installed, I got an exception stating...
Could not load file or assembly 'Microsoft.Crm.Application.Components.Application'
All this meant, I needed to copy a file, Microsoft.Crm.Application.Components.Application.dll, from C:\Program Files\Dynamics 365\CRMWeb\bin into folder C:\Program Files\Dynamics 365\CRMWeb\XRMDeployment\bin.
Once this was done, the URL worked and therefor my PowerShell command as well.

Visual studio release management - deploy with ps/dsc encountered error with server certificate

I'm trying to run a simple ps script on a target computer (my local machine) from our RM server through the RM client. However the release falls over when it reaches deploy using ps/dsc. The error message reads:
Connecting to remote server ### failed with the following error message : The server certificate on the destination computer (###:5985) has the following errors:
Encountered an internal error in the SSL library.
However as you can see by the winrm port number, I'm using HTTP not HTTPS to communicate with my machine, so surely SSL should not come into it. So has anyone else come across this or have any idea what I could be doing wrong?
UPDATE: the machines are part of the same domain.
In the deploy using DSC action keep UseHTTPS variable to false and skipCACheck to true, just in case.
BTW, how long does it take for the action to show this error message in the logs? Also, as someone mentioned in the comments, are you able to manually run the script using PS remoting?
If none of the above helps, we would need more details. Try looking into the event logs for the target machine right after your deployment failed and check for any errors.
I came across same issue ,On installing Azure service certification VM tailed,Resolved issue.

Azure deployment with PowerShell, "New-AzureDeployment : There was no endpoint listening at https://management.core.windows.net/..."

Following the guide and powershell script from this article,
https://www.windowsazure.com/en-us/develop/net/common-tasks/continuous-delivery/
I've run into an extremely odd error:
9/4/2012 9:02 PM - Creating New Deployment: In progress
New-AzureDeployment : There was no endpoint listening at https://management.core.windows.net/5921d8af-88a1-4f63-9673-5e1ae1df7e8a/services/storageservices/Build_2012-09-04_02-27.1/dist/LNEC_Admin.Azure.cspkg/keys that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
It's odd because we're on build "Build_2012-09-04_08-16.1", not the one mentioned in the URL above (which no longer even exists on the filesystem). This is under Jenkins CI which runs under the NETWORK SERVICE account. If I run it by hand with my own account the same error results, but with a lnecint in place of the build directory: https://management.core.windows.net/5921d8af-88a1-4f63-9673-5e1ae1df7e8a/services/storageservices/lnecint/keys
That keyword "lnecint" isn't mentioned anywhere in any config (I've searched every file on the entire machine and TFS server). It was the name of a storage account, but it's long ago been deleted.
VS 2012, Azure SDK 1.7.1
There's definitely an issue with your endpoint. Can you check what parameters you're passing to the "New-AzureDeployment" Cmdlet?