Hi,
We are facing an issue where octopus system variables are not resolving.
We get the error Cannot open database "OSO_NG_#{Octopus.Environment.Name | Replace “-” “_”}"
NotSpecified: Exception calling “Extract” with “4” argument(s): “Could not connect to database server.”
Deployment variable preview:
And even in preview its not resolving. We are using the SQL-Deploy DACPAC step template.
I can send on the Task Log if you need it.
This means it could be one of the following issues:
1.) depending on the version of Octopus you are running, there may have been a bug which has since been fixed. I’m running 2022.3.349
2.) You’ve targeted the variable incorrectly in DACPAC step under “Target Database”.
The way the variable should be written in your DACPAC step is exactly like this: #{EF.SQL.DBName}
3.) You’ve put your variables somewhere else, and they don’t evaluate correctly based on the order of the Octopus Deployment Process. I’ve entered the variable into my “Project Variables”.
If you put “OctopusPrintEvaluatedVariables” and “OctopusPrintVariables” in your variables and set their values to “True”, (as per my picture) the evaluated variable should be printed in your logs, so you can check on the result.
Thanks for the update. That’s very odd. I will look through some old issues to see if there is any old issues that were reported around variable substitution.
Would you please send me through the Task Logs with the evaluated variables switched on. Would you also please provide me with the output of the Deployment Process as described here?