Please provide an email address to which the message will be sent error on any update in


(thomas.taege) #1

Hi Octopus Support,

I’ve got an issue with a project that deploys to Azure and has an email notification step where any time we attempt to make a change to to project it says;

There was a problem with your request.
Please provide an email address to which the message will be sent.

We get this issue even when attempting to set the to: address in the email step either as manually entered, from a variable or by setting a team. Attempting to delete the step gives the same error.

We’ve just upgraded to version 2018.9.15-x64 to see if that solved the issue, which it did not. We also had the issue in 2018.8.10-x64.

I’ve attached the json dump of the project and a screenshot of the error. Let me know if i can provide anything else to make troubleshooting this easier.


matter-centre-admin-uk-process.json (5.8 KB)


(Nick Josevski) #3

Hi Thomas,

Thanks for getting in touch, sorry you’re experiencing this issue. Thanks very much for sending the JSON through it let us work it out right away. The deployment process is in a bad state, and across 2 steps. Which means no UI action can get it in a good state, because we save the deployment process as 1 action.

You have 2 steps in the bad state

  • Staging Email Notification
  • Production Email Notification

They both lack an email or a TeamId, we’re not sure how they ended up like that, a deletion of a team would be prevented if it’s used in a deployment process, or it would have happened and the deployment process would still have a team id that no longer exists, but that’s more about what caused the issue not how to fix it.

Is there a chance you were using the API to manipulate this deployment process and supplied bad data that didn’t get properly validated by Octopus? If not it may have been a bug that’s been fixed.

To fix this you’ll need to write code to update the deployment process.

Step 1. Using an API key and the OctopusClient. Fetch the deployment process

Step 2. Modify both steps, and give them any TeamId.
I suggest just using “teams-administrators” which is a known built in team, because once it’s corrected you can go and adjust it how you need it to be via the API

Step 3. Do the POST against the API with the saved data.

I wrote a LinqPad script in C# that will fix any number of broken email steps:

void Main()
{
	var serverUri = "https://my.octopus.installation";
	var apiKey = "API-YOUR_API_KEY";
	var projectName = "REPLACE with your project name"

	var octopusServer = new Octopus.Client.OctopusServerEndpoint(serverUri, apiKey);
	var repo = new Octopus.Client.OctopusRepository(octopusServer);

	var deploymentProcessId = repo.Projects.Get(projectName).DeploymentProcessId;
	var process = repo.DeploymentProcesses.Get(deploymentProcessId);
	
	foreach(var s in process.Steps)
	{
		foreach (var a in s.Actions)
		{
			if (a.ActionType == "Octopus.Email")
			{
				a.Properties["Octopus.Action.Email.ToTeamIds"] = new PropertyValueResource("teams-administrators");
				Console.WriteLine($"updated {s.Name}");
			}
		}
	}
	
	repo.DeploymentProcesses.Modify(process);
}

Let me know how you go.

Regards,
Nick


(thomas.taege) #6

Hi Nick,

That’s done the trick, everything now works

We migrated our master into our cloud environment earlier this year, it was on 4.1.6 and I think something wasn’t quite right with the backup. We had another issue where the fix was just to upgrade Octopus, so i’m guessing we’ve got a couple issues floating around from that original process.

Thanks for the prompt assistance.

Cheers,

Thomas


(Nick Josevski) #7

Hi Thomas,

Good to know you’re up and running, your help would be appreciated in getting more info about what could have gone wrong so we can make sure it doesn’t happen to you or anyone else again when you have some time.

You mentioned you migrated data, did you use the Octopus migrator command line tool?

If you did what version did you use, did you do it from 4.1.6 -> recent or, you migrated from 4.1.6 in one instance to another, or something else?

If you didn’t then could you elaborate on the process of how you did migrate?

Regards,
Nick


(system) #8

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.