-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Runtime Exception on CleanupWEeklySnapshots #4
Comments
Interesting. Off the top of my head, I'm not sure what's causing that, but a few guesses / things to check:
|
I updated to the most recent version that I downloaded today. I am running 2012 R2 and I ran it as administrator and still got the error above. Any other thoughts? It seems to be trying to delete and run through loop based on an array that is empty? Thanks, |
I performed additional troubleshooting and found where the error was. The script checks the description field of all snapshots for the string "Daily" or "Weekly". If the account has snapshots which do not have a description, the script will fail with the Null value exception. I would suggest building into the script a check for the NULL value in the description field and just ignore this snapshot. |
Excellent suggestion Jason - thank you! Want to take a stab at adding & testing this and submitting as a pull request? I'll happily guide you through that process if you'd like. |
I will try to put this on the schedule to look at eventually but I can not commit to anything near term, due to the large number of projects and ongoing deadlines. I will reach out when I have a chance and need assistance. Talk to you soon. |
No rush or obligation Jason - just if you have the time/interest. Many thanks! |
Figured it out. Don't know how to submit code though... then the fix: function CleanupDailySnapshots |
Note, you porobably need to fix this in function CleanupWeeklySnapshots as well. |
When I run the script the backups will work and I can see them in my console, however I get the following error. I need to be sure that despite the error that the cleanup part of the script will work as well.
11/24/2014 9:29:16 PM xxxx-AWS Production Daily Backup Starting
11/24/2014 9:29:16 PM Instance xxxx-AWS-DC (i-xxxxxxxb) Creating Snapshot
11/24/2014 9:29:16 PM Snapshot xxxx-AWS-DC vol-xxxxxxx Daily 20141124092916 Created for xxx-AWS-DC (i-xxxxxxxx)
11/24/2014 9:29:31 PM Cleaning up daily snapshots
11/24/2014 9:29:31 PM CleanupWeeklySnapshots : System.Management.Automation.RuntimeException: You cannot call a method on a null-valued expression.
at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
11/24/2014 9:29:31 PM WriteToLog : System.NotSupportedException: Specified method is not supported.
at System.Management.Automation.ParameterBinderBase.CoerceTypeAsNeeded(CommandParameterInternal argument, String parameterName, Type toType, ParameterCollectionTypeInformation collectionTypeInfo, Object currentValue)
11/24/2014 9:29:31 PM WriteToLog : System.NotSupportedException: Specified method is not supported.
at System.Management.Automation.ParameterBinderBase.CoerceTypeAsNeeded(CommandParameterInternal argument, String parameterName, Type toType, ParameterCollectionTypeInformation collectionTypeInfo, Object currentValue)
11/24/2014 9:29:31 PM WriteToLog : System.NotSupportedException: Specified method is not supported.
at System.Management.Automation.ParameterBinderBase.CoerceTypeAsNeeded(CommandParameterInternal argument, String parameterName, Type toType, ParameterCollectionTypeInformation collectionTypeInfo, Object currentValue)
11/24/2014 9:29:31 PM WriteToLog : System.NotSupportedException: Specified method is not supported.
at System.Management.Automation.ParameterBinderBase.CoerceTypeAsNeeded(CommandParameterInternal argument, String parameterName, Type toType, ParameterCollectionTypeInformation collectionTypeInfo, Object currentValue)
11/24/2014 9:29:31 PM WriteToLog : System.NotSupportedException: Specified method is not supported.
at System.Management.Automation.ParameterBinderBase.CoerceTypeAsNeeded(CommandParameterInternal argument, String parameterName, Type toType, ParameterCollectionTypeInformation collectionTypeInfo, Object currentValue)
11/24/2014 9:29:31 PM WriteToLog : System.NotSupportedException: Specified method is not supported.
at System.Management.Automation.ParameterBinderBase.CoerceTypeAsNeeded(CommandParameterInternal argument, String parameterName, Type toType, ParameterCollectionTypeInformation collectionTypeInfo, Object currentValue)
11/24/2014 9:29:31 PM WriteToLog : System.NotSupportedException: Specified method is not supported.
at System.Management.Automation.ParameterBinderBase.CoerceTypeAsNeeded(CommandParameterInternal argument, String parameterName, Type toType, ParameterCollectionTypeInformation collectionTypeInfo, Object currentValue)
11/24/2014 9:29:31 PM WriteToLog : System.NotSupportedException: Specified method is not supported.
at System.Management.Automation.ParameterBinderBase.CoerceTypeAsNeeded(CommandParameterInternal argument, String parameterName, Type toType, ParameterCollectionTypeInformation collectionTypeInfo, Object currentValue)
11/24/2014 9:29:31 PM WriteToLog : System.NotSupportedException: Specified method is not supported.
at System.Management.Automation.ParameterBinderBase.CoerceTypeAsNeeded(CommandParameterInternal argument, String parameterName, Type toType, ParameterCollectionTypeInformation collectionTypeInfo, Object currentValue)
11/24/2014 9:29:31 PM WriteToLog : System.NotSupportedException: Specified method is not supported.
The last error repeats for probably 300 times then stops.
Any assistance would be appreciated.
Thanks,
Jason
The text was updated successfully, but these errors were encountered: