Cake build script calling AWS.ElasticBeanstalk DescribeEnvironments() throwing MissingMethodException









up vote
0
down vote

favorite












This is a very specific error, I have spent the last several days investigating it but have hit a dead end.



A task in my cake build script is trying to check if the elastic beanstalk environment is ready. We have been using this addin (https://github.com/mathieukempe/Cake.AWS.ElasticBeanstalk) I forked the repo to add the DescribeEnvironments() implementation. The addin code works if I run it directly in a console app. However when I run it from the cake build script it throws System.MissingMethodException: Method not found: 'System.String Amazon.Runtime.Internal.Util.StringUtils.FromDateTimeToISO8601(System.DateTime)'
and unfortunately I think I am the only person on the internet having this problem.



Below is the task my cake script is running:



Task("CheckEBEnvironment")
.Does((context) =>
var settings = CreateElasticBeanstalkSettings();
if (context.ApplicationVersionReady(settings, ebApplication, ebEnvironment, ebVersion))
Information("Environment ready.");
isReady = true;
else
Information("Environment not ready...");

);


and below is the addin code:



[CakeAliasCategory("AWS")]
[CakeNamespaceImport("Amazon")]
[CakeNamespaceImport("Amazon.ElasticBeanstalk")]
public static class ElasticBeanstalkAliases

private static IElasticBeanstalkManager CreateManager(this ICakeContext context)

return new ElasticBeanstalkManager(context.Environment, context.Log);


// ...

[CakeMethodAlias]
[CakeAliasCategory("ElasticBeanstalk")]
public static bool ApplicationVersionReady(this ICakeContext context, ElasticBeanstalkSettings settings, string applicationName, string environmentName, string versionLabel)

var manager = context.CreateManager();
return manager.ApplicationVersionReady(settings, applicationName, environmentName, versionLabel);




Here is the implementation:



public class ElasticBeanstalkManager : IElasticBeanstalkManager

private readonly ICakeEnvironment _Environment;
private readonly ICakeLog _Log;

/// <summary>
/// If the manager should output progrtess events to the cake log
/// </summary>
public bool LogProgress get; set;

public ElasticBeanstalkManager(ICakeEnvironment environment, ICakeLog log)

if (environment == null)

throw new ArgumentNullException("environment");

if (log == null)

throw new ArgumentNullException("log");


_Environment = environment;
_Log = log;

this.LogProgress = true;


//Request
private AmazonElasticBeanstalkClient GetClient(ElasticBeanstalkSettings settings)

if (settings == null)

throw new ArgumentNullException("settings");


if (settings.Region == null)

throw new ArgumentNullException("settings.Region");


if (settings.Credentials == null)

if (String.IsNullOrEmpty(settings.AccessKey))

throw new ArgumentNullException("settings.AccessKey");

if (String.IsNullOrEmpty(settings.SecretKey))

throw new ArgumentNullException("settings.SecretKey");


return new AmazonElasticBeanstalkClient(settings.AccessKey, settings.SecretKey, settings.Region);

else

return new AmazonElasticBeanstalkClient(settings.Credentials, settings.Region);



public bool ApplicationVersionReady(ElasticBeanstalkSettings settings, string applicationName, string environmentName, string versionLabel)

if (string.IsNullOrEmpty(applicationName))

throw new ArgumentNullException(nameof(applicationName));


if (string.IsNullOrEmpty(environmentName))

throw new ArgumentNullException(nameof(environmentName));


if (string.IsNullOrEmpty(versionLabel))

throw new ArgumentNullException(nameof(versionLabel));


var client = GetClient(settings);
var status = client.DescribeEnvironmentsAsync(new DescribeEnvironmentsRequest

ApplicationName = applicationName,
EnvironmentNames = new List<string>(new environmentName),
VersionLabel = versionLabel,
IncludeDeleted = false,
).Result.Environments[0].Status.Value;

return status == "Ready";




Here is the entire exception message:




System.AggregateException: One or more errors occurred. ---> System.MissingMethodException: Method not found: 'System.String Amazon.Runtime.Internal.Util.StringUtils.FromDateTimeToISO8601(System.DateTime)'.
at Amazon.ElasticBeanstalk.Model.Internal.MarshallTransformations.DescribeEnvironmentsRequestMarshaller.Marshall(DescribeEnvironmentsRequest publicRequest)
at Amazon.Runtime.Internal.Marshaller.PreInvoke(IExecutionContext executionContext)
at Amazon.Runtime.Internal.Marshaller.InvokeAsync[T](IExecutionContext executionContext)
at Amazon.Runtime.Internal.CallbackHandler.d__91.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Amazon.Runtime.Internal.ErrorCallbackHandler.<InvokeAsync>d__5
1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Amazon.Runtime.Internal.MetricsHandler.d__11.MoveNext()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task
1.GetResultCore(Boolean waitCompletionNotification)
at Cake.AWS.ElasticBeanstalk.ElasticBeanstalkManager.ApplicationVersionReady(ElasticBeanstalkSettings settings, String applicationName, String environmentName, String versionLabel)
at Submission#0.<>b__0_11(ICakeContext context)
---> (Inner Exception #0) System.MissingMethodException: Method not found: 'System.String Amazon.Runtime.Internal.Util.StringUtils.FromDateTimeToISO8601(System.DateTime)'.
at Amazon.ElasticBeanstalk.Model.Internal.MarshallTransformations.DescribeEnvironmentsRequestMarshaller.Marshall(DescribeEnvironmentsRequest publicRequest)
at Amazon.Runtime.Internal.Marshaller.PreInvoke(IExecutionContext executionContext)
at Amazon.Runtime.Internal.Marshaller.InvokeAsync[T](IExecutionContext executionContext)
at Amazon.Runtime.Internal.CallbackHandler.d__91.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Amazon.Runtime.Internal.ErrorCallbackHandler.<InvokeAsync>d__5
1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Amazon.Runtime.Internal.MetricsHandler.d__1`1.MoveNext()<---




My guess is that the cake context is somewhere setting a date time on the request which is in a formate that Amazon can't handle. If anyone has any ideas or has come accross a similar issue I would be very grateful.










share|improve this question

























    up vote
    0
    down vote

    favorite












    This is a very specific error, I have spent the last several days investigating it but have hit a dead end.



    A task in my cake build script is trying to check if the elastic beanstalk environment is ready. We have been using this addin (https://github.com/mathieukempe/Cake.AWS.ElasticBeanstalk) I forked the repo to add the DescribeEnvironments() implementation. The addin code works if I run it directly in a console app. However when I run it from the cake build script it throws System.MissingMethodException: Method not found: 'System.String Amazon.Runtime.Internal.Util.StringUtils.FromDateTimeToISO8601(System.DateTime)'
    and unfortunately I think I am the only person on the internet having this problem.



    Below is the task my cake script is running:



    Task("CheckEBEnvironment")
    .Does((context) =>
    var settings = CreateElasticBeanstalkSettings();
    if (context.ApplicationVersionReady(settings, ebApplication, ebEnvironment, ebVersion))
    Information("Environment ready.");
    isReady = true;
    else
    Information("Environment not ready...");

    );


    and below is the addin code:



    [CakeAliasCategory("AWS")]
    [CakeNamespaceImport("Amazon")]
    [CakeNamespaceImport("Amazon.ElasticBeanstalk")]
    public static class ElasticBeanstalkAliases

    private static IElasticBeanstalkManager CreateManager(this ICakeContext context)

    return new ElasticBeanstalkManager(context.Environment, context.Log);


    // ...

    [CakeMethodAlias]
    [CakeAliasCategory("ElasticBeanstalk")]
    public static bool ApplicationVersionReady(this ICakeContext context, ElasticBeanstalkSettings settings, string applicationName, string environmentName, string versionLabel)

    var manager = context.CreateManager();
    return manager.ApplicationVersionReady(settings, applicationName, environmentName, versionLabel);




    Here is the implementation:



    public class ElasticBeanstalkManager : IElasticBeanstalkManager

    private readonly ICakeEnvironment _Environment;
    private readonly ICakeLog _Log;

    /// <summary>
    /// If the manager should output progrtess events to the cake log
    /// </summary>
    public bool LogProgress get; set;

    public ElasticBeanstalkManager(ICakeEnvironment environment, ICakeLog log)

    if (environment == null)

    throw new ArgumentNullException("environment");

    if (log == null)

    throw new ArgumentNullException("log");


    _Environment = environment;
    _Log = log;

    this.LogProgress = true;


    //Request
    private AmazonElasticBeanstalkClient GetClient(ElasticBeanstalkSettings settings)

    if (settings == null)

    throw new ArgumentNullException("settings");


    if (settings.Region == null)

    throw new ArgumentNullException("settings.Region");


    if (settings.Credentials == null)

    if (String.IsNullOrEmpty(settings.AccessKey))

    throw new ArgumentNullException("settings.AccessKey");

    if (String.IsNullOrEmpty(settings.SecretKey))

    throw new ArgumentNullException("settings.SecretKey");


    return new AmazonElasticBeanstalkClient(settings.AccessKey, settings.SecretKey, settings.Region);

    else

    return new AmazonElasticBeanstalkClient(settings.Credentials, settings.Region);



    public bool ApplicationVersionReady(ElasticBeanstalkSettings settings, string applicationName, string environmentName, string versionLabel)

    if (string.IsNullOrEmpty(applicationName))

    throw new ArgumentNullException(nameof(applicationName));


    if (string.IsNullOrEmpty(environmentName))

    throw new ArgumentNullException(nameof(environmentName));


    if (string.IsNullOrEmpty(versionLabel))

    throw new ArgumentNullException(nameof(versionLabel));


    var client = GetClient(settings);
    var status = client.DescribeEnvironmentsAsync(new DescribeEnvironmentsRequest

    ApplicationName = applicationName,
    EnvironmentNames = new List<string>(new environmentName),
    VersionLabel = versionLabel,
    IncludeDeleted = false,
    ).Result.Environments[0].Status.Value;

    return status == "Ready";




    Here is the entire exception message:




    System.AggregateException: One or more errors occurred. ---> System.MissingMethodException: Method not found: 'System.String Amazon.Runtime.Internal.Util.StringUtils.FromDateTimeToISO8601(System.DateTime)'.
    at Amazon.ElasticBeanstalk.Model.Internal.MarshallTransformations.DescribeEnvironmentsRequestMarshaller.Marshall(DescribeEnvironmentsRequest publicRequest)
    at Amazon.Runtime.Internal.Marshaller.PreInvoke(IExecutionContext executionContext)
    at Amazon.Runtime.Internal.Marshaller.InvokeAsync[T](IExecutionContext executionContext)
    at Amazon.Runtime.Internal.CallbackHandler.d__91.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at Amazon.Runtime.Internal.ErrorCallbackHandler.<InvokeAsync>d__5
    1.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at Amazon.Runtime.Internal.MetricsHandler.d__11.MoveNext()
    --- End of inner exception stack trace ---
    at System.Threading.Tasks.Task
    1.GetResultCore(Boolean waitCompletionNotification)
    at Cake.AWS.ElasticBeanstalk.ElasticBeanstalkManager.ApplicationVersionReady(ElasticBeanstalkSettings settings, String applicationName, String environmentName, String versionLabel)
    at Submission#0.<>b__0_11(ICakeContext context)
    ---> (Inner Exception #0) System.MissingMethodException: Method not found: 'System.String Amazon.Runtime.Internal.Util.StringUtils.FromDateTimeToISO8601(System.DateTime)'.
    at Amazon.ElasticBeanstalk.Model.Internal.MarshallTransformations.DescribeEnvironmentsRequestMarshaller.Marshall(DescribeEnvironmentsRequest publicRequest)
    at Amazon.Runtime.Internal.Marshaller.PreInvoke(IExecutionContext executionContext)
    at Amazon.Runtime.Internal.Marshaller.InvokeAsync[T](IExecutionContext executionContext)
    at Amazon.Runtime.Internal.CallbackHandler.d__91.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at Amazon.Runtime.Internal.ErrorCallbackHandler.<InvokeAsync>d__5
    1.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at Amazon.Runtime.Internal.MetricsHandler.d__1`1.MoveNext()<---




    My guess is that the cake context is somewhere setting a date time on the request which is in a formate that Amazon can't handle. If anyone has any ideas or has come accross a similar issue I would be very grateful.










    share|improve this question























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      This is a very specific error, I have spent the last several days investigating it but have hit a dead end.



      A task in my cake build script is trying to check if the elastic beanstalk environment is ready. We have been using this addin (https://github.com/mathieukempe/Cake.AWS.ElasticBeanstalk) I forked the repo to add the DescribeEnvironments() implementation. The addin code works if I run it directly in a console app. However when I run it from the cake build script it throws System.MissingMethodException: Method not found: 'System.String Amazon.Runtime.Internal.Util.StringUtils.FromDateTimeToISO8601(System.DateTime)'
      and unfortunately I think I am the only person on the internet having this problem.



      Below is the task my cake script is running:



      Task("CheckEBEnvironment")
      .Does((context) =>
      var settings = CreateElasticBeanstalkSettings();
      if (context.ApplicationVersionReady(settings, ebApplication, ebEnvironment, ebVersion))
      Information("Environment ready.");
      isReady = true;
      else
      Information("Environment not ready...");

      );


      and below is the addin code:



      [CakeAliasCategory("AWS")]
      [CakeNamespaceImport("Amazon")]
      [CakeNamespaceImport("Amazon.ElasticBeanstalk")]
      public static class ElasticBeanstalkAliases

      private static IElasticBeanstalkManager CreateManager(this ICakeContext context)

      return new ElasticBeanstalkManager(context.Environment, context.Log);


      // ...

      [CakeMethodAlias]
      [CakeAliasCategory("ElasticBeanstalk")]
      public static bool ApplicationVersionReady(this ICakeContext context, ElasticBeanstalkSettings settings, string applicationName, string environmentName, string versionLabel)

      var manager = context.CreateManager();
      return manager.ApplicationVersionReady(settings, applicationName, environmentName, versionLabel);




      Here is the implementation:



      public class ElasticBeanstalkManager : IElasticBeanstalkManager

      private readonly ICakeEnvironment _Environment;
      private readonly ICakeLog _Log;

      /// <summary>
      /// If the manager should output progrtess events to the cake log
      /// </summary>
      public bool LogProgress get; set;

      public ElasticBeanstalkManager(ICakeEnvironment environment, ICakeLog log)

      if (environment == null)

      throw new ArgumentNullException("environment");

      if (log == null)

      throw new ArgumentNullException("log");


      _Environment = environment;
      _Log = log;

      this.LogProgress = true;


      //Request
      private AmazonElasticBeanstalkClient GetClient(ElasticBeanstalkSettings settings)

      if (settings == null)

      throw new ArgumentNullException("settings");


      if (settings.Region == null)

      throw new ArgumentNullException("settings.Region");


      if (settings.Credentials == null)

      if (String.IsNullOrEmpty(settings.AccessKey))

      throw new ArgumentNullException("settings.AccessKey");

      if (String.IsNullOrEmpty(settings.SecretKey))

      throw new ArgumentNullException("settings.SecretKey");


      return new AmazonElasticBeanstalkClient(settings.AccessKey, settings.SecretKey, settings.Region);

      else

      return new AmazonElasticBeanstalkClient(settings.Credentials, settings.Region);



      public bool ApplicationVersionReady(ElasticBeanstalkSettings settings, string applicationName, string environmentName, string versionLabel)

      if (string.IsNullOrEmpty(applicationName))

      throw new ArgumentNullException(nameof(applicationName));


      if (string.IsNullOrEmpty(environmentName))

      throw new ArgumentNullException(nameof(environmentName));


      if (string.IsNullOrEmpty(versionLabel))

      throw new ArgumentNullException(nameof(versionLabel));


      var client = GetClient(settings);
      var status = client.DescribeEnvironmentsAsync(new DescribeEnvironmentsRequest

      ApplicationName = applicationName,
      EnvironmentNames = new List<string>(new environmentName),
      VersionLabel = versionLabel,
      IncludeDeleted = false,
      ).Result.Environments[0].Status.Value;

      return status == "Ready";




      Here is the entire exception message:




      System.AggregateException: One or more errors occurred. ---> System.MissingMethodException: Method not found: 'System.String Amazon.Runtime.Internal.Util.StringUtils.FromDateTimeToISO8601(System.DateTime)'.
      at Amazon.ElasticBeanstalk.Model.Internal.MarshallTransformations.DescribeEnvironmentsRequestMarshaller.Marshall(DescribeEnvironmentsRequest publicRequest)
      at Amazon.Runtime.Internal.Marshaller.PreInvoke(IExecutionContext executionContext)
      at Amazon.Runtime.Internal.Marshaller.InvokeAsync[T](IExecutionContext executionContext)
      at Amazon.Runtime.Internal.CallbackHandler.d__91.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at Amazon.Runtime.Internal.ErrorCallbackHandler.<InvokeAsync>d__5
      1.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at Amazon.Runtime.Internal.MetricsHandler.d__11.MoveNext()
      --- End of inner exception stack trace ---
      at System.Threading.Tasks.Task
      1.GetResultCore(Boolean waitCompletionNotification)
      at Cake.AWS.ElasticBeanstalk.ElasticBeanstalkManager.ApplicationVersionReady(ElasticBeanstalkSettings settings, String applicationName, String environmentName, String versionLabel)
      at Submission#0.<>b__0_11(ICakeContext context)
      ---> (Inner Exception #0) System.MissingMethodException: Method not found: 'System.String Amazon.Runtime.Internal.Util.StringUtils.FromDateTimeToISO8601(System.DateTime)'.
      at Amazon.ElasticBeanstalk.Model.Internal.MarshallTransformations.DescribeEnvironmentsRequestMarshaller.Marshall(DescribeEnvironmentsRequest publicRequest)
      at Amazon.Runtime.Internal.Marshaller.PreInvoke(IExecutionContext executionContext)
      at Amazon.Runtime.Internal.Marshaller.InvokeAsync[T](IExecutionContext executionContext)
      at Amazon.Runtime.Internal.CallbackHandler.d__91.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at Amazon.Runtime.Internal.ErrorCallbackHandler.<InvokeAsync>d__5
      1.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at Amazon.Runtime.Internal.MetricsHandler.d__1`1.MoveNext()<---




      My guess is that the cake context is somewhere setting a date time on the request which is in a formate that Amazon can't handle. If anyone has any ideas or has come accross a similar issue I would be very grateful.










      share|improve this question













      This is a very specific error, I have spent the last several days investigating it but have hit a dead end.



      A task in my cake build script is trying to check if the elastic beanstalk environment is ready. We have been using this addin (https://github.com/mathieukempe/Cake.AWS.ElasticBeanstalk) I forked the repo to add the DescribeEnvironments() implementation. The addin code works if I run it directly in a console app. However when I run it from the cake build script it throws System.MissingMethodException: Method not found: 'System.String Amazon.Runtime.Internal.Util.StringUtils.FromDateTimeToISO8601(System.DateTime)'
      and unfortunately I think I am the only person on the internet having this problem.



      Below is the task my cake script is running:



      Task("CheckEBEnvironment")
      .Does((context) =>
      var settings = CreateElasticBeanstalkSettings();
      if (context.ApplicationVersionReady(settings, ebApplication, ebEnvironment, ebVersion))
      Information("Environment ready.");
      isReady = true;
      else
      Information("Environment not ready...");

      );


      and below is the addin code:



      [CakeAliasCategory("AWS")]
      [CakeNamespaceImport("Amazon")]
      [CakeNamespaceImport("Amazon.ElasticBeanstalk")]
      public static class ElasticBeanstalkAliases

      private static IElasticBeanstalkManager CreateManager(this ICakeContext context)

      return new ElasticBeanstalkManager(context.Environment, context.Log);


      // ...

      [CakeMethodAlias]
      [CakeAliasCategory("ElasticBeanstalk")]
      public static bool ApplicationVersionReady(this ICakeContext context, ElasticBeanstalkSettings settings, string applicationName, string environmentName, string versionLabel)

      var manager = context.CreateManager();
      return manager.ApplicationVersionReady(settings, applicationName, environmentName, versionLabel);




      Here is the implementation:



      public class ElasticBeanstalkManager : IElasticBeanstalkManager

      private readonly ICakeEnvironment _Environment;
      private readonly ICakeLog _Log;

      /// <summary>
      /// If the manager should output progrtess events to the cake log
      /// </summary>
      public bool LogProgress get; set;

      public ElasticBeanstalkManager(ICakeEnvironment environment, ICakeLog log)

      if (environment == null)

      throw new ArgumentNullException("environment");

      if (log == null)

      throw new ArgumentNullException("log");


      _Environment = environment;
      _Log = log;

      this.LogProgress = true;


      //Request
      private AmazonElasticBeanstalkClient GetClient(ElasticBeanstalkSettings settings)

      if (settings == null)

      throw new ArgumentNullException("settings");


      if (settings.Region == null)

      throw new ArgumentNullException("settings.Region");


      if (settings.Credentials == null)

      if (String.IsNullOrEmpty(settings.AccessKey))

      throw new ArgumentNullException("settings.AccessKey");

      if (String.IsNullOrEmpty(settings.SecretKey))

      throw new ArgumentNullException("settings.SecretKey");


      return new AmazonElasticBeanstalkClient(settings.AccessKey, settings.SecretKey, settings.Region);

      else

      return new AmazonElasticBeanstalkClient(settings.Credentials, settings.Region);



      public bool ApplicationVersionReady(ElasticBeanstalkSettings settings, string applicationName, string environmentName, string versionLabel)

      if (string.IsNullOrEmpty(applicationName))

      throw new ArgumentNullException(nameof(applicationName));


      if (string.IsNullOrEmpty(environmentName))

      throw new ArgumentNullException(nameof(environmentName));


      if (string.IsNullOrEmpty(versionLabel))

      throw new ArgumentNullException(nameof(versionLabel));


      var client = GetClient(settings);
      var status = client.DescribeEnvironmentsAsync(new DescribeEnvironmentsRequest

      ApplicationName = applicationName,
      EnvironmentNames = new List<string>(new environmentName),
      VersionLabel = versionLabel,
      IncludeDeleted = false,
      ).Result.Environments[0].Status.Value;

      return status == "Ready";




      Here is the entire exception message:




      System.AggregateException: One or more errors occurred. ---> System.MissingMethodException: Method not found: 'System.String Amazon.Runtime.Internal.Util.StringUtils.FromDateTimeToISO8601(System.DateTime)'.
      at Amazon.ElasticBeanstalk.Model.Internal.MarshallTransformations.DescribeEnvironmentsRequestMarshaller.Marshall(DescribeEnvironmentsRequest publicRequest)
      at Amazon.Runtime.Internal.Marshaller.PreInvoke(IExecutionContext executionContext)
      at Amazon.Runtime.Internal.Marshaller.InvokeAsync[T](IExecutionContext executionContext)
      at Amazon.Runtime.Internal.CallbackHandler.d__91.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at Amazon.Runtime.Internal.ErrorCallbackHandler.<InvokeAsync>d__5
      1.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at Amazon.Runtime.Internal.MetricsHandler.d__11.MoveNext()
      --- End of inner exception stack trace ---
      at System.Threading.Tasks.Task
      1.GetResultCore(Boolean waitCompletionNotification)
      at Cake.AWS.ElasticBeanstalk.ElasticBeanstalkManager.ApplicationVersionReady(ElasticBeanstalkSettings settings, String applicationName, String environmentName, String versionLabel)
      at Submission#0.<>b__0_11(ICakeContext context)
      ---> (Inner Exception #0) System.MissingMethodException: Method not found: 'System.String Amazon.Runtime.Internal.Util.StringUtils.FromDateTimeToISO8601(System.DateTime)'.
      at Amazon.ElasticBeanstalk.Model.Internal.MarshallTransformations.DescribeEnvironmentsRequestMarshaller.Marshall(DescribeEnvironmentsRequest publicRequest)
      at Amazon.Runtime.Internal.Marshaller.PreInvoke(IExecutionContext executionContext)
      at Amazon.Runtime.Internal.Marshaller.InvokeAsync[T](IExecutionContext executionContext)
      at Amazon.Runtime.Internal.CallbackHandler.d__91.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at Amazon.Runtime.Internal.ErrorCallbackHandler.<InvokeAsync>d__5
      1.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at Amazon.Runtime.Internal.MetricsHandler.d__1`1.MoveNext()<---




      My guess is that the cake context is somewhere setting a date time on the request which is in a formate that Amazon can't handle. If anyone has any ideas or has come accross a similar issue I would be very grateful.







      c# .net amazon-elastic-beanstalk iso8601 cakebuild






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 9 at 20:48









      Jeff Stapleton

      7817




      7817






















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          0
          down vote













          My guess is, that you are missing some dependencies.



          As the error states, the method Amazon.Runtime.Internal.Util.StringUtils.FromDateTimeToISO8601(System.DateTime) can not be found. Looking at the Cake addin you mentioned, on nuget.org it shows that it has some dependencies to the AWSSDK.Core and AWSSDK.ElasticBeanstalk packages. And on the github project of the first one you can see, that this is where the method is implemented.



          So I guess that you don't specify those dependencies when building your forked addin and therefor the error occurs. If you build a nuget package, add those packages as dependencies (the same way the original addin does).






          share|improve this answer




















          • That was my thinking but I double checked and ensured that the AWSSDK.Core.dll was included in the nuget package and was present in addin folders after cake installed all addins. I even decompiled the .dll to make sure the method infact existed and it does.
            – Jeff Stapleton
            Nov 12 at 17:44

















          up vote
          0
          down vote



          accepted










          I figured out the issue. I was using two addins the first is Cake.AWS.S3 the second is Cake.AWS.ElasticBeanstalk and since the S3 addin was defined first when cake needed to reference the AWSSDK.Core.dll it would use the .dll the S3 addin provided which happened to be an older version than the ElasticBeanstalk addin was expecting, resulting in it calling a method that doesn't exist.



          If I simply define the Cake.AWS.ElasticBeanstalk addin first it works. I may submit a pull request to upgrade S3 addin's AWSSDK.Core.dll






          share|improve this answer




















            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53233059%2fcake-build-script-calling-aws-elasticbeanstalk-describeenvironments-throwing-m%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote













            My guess is, that you are missing some dependencies.



            As the error states, the method Amazon.Runtime.Internal.Util.StringUtils.FromDateTimeToISO8601(System.DateTime) can not be found. Looking at the Cake addin you mentioned, on nuget.org it shows that it has some dependencies to the AWSSDK.Core and AWSSDK.ElasticBeanstalk packages. And on the github project of the first one you can see, that this is where the method is implemented.



            So I guess that you don't specify those dependencies when building your forked addin and therefor the error occurs. If you build a nuget package, add those packages as dependencies (the same way the original addin does).






            share|improve this answer




















            • That was my thinking but I double checked and ensured that the AWSSDK.Core.dll was included in the nuget package and was present in addin folders after cake installed all addins. I even decompiled the .dll to make sure the method infact existed and it does.
              – Jeff Stapleton
              Nov 12 at 17:44














            up vote
            0
            down vote













            My guess is, that you are missing some dependencies.



            As the error states, the method Amazon.Runtime.Internal.Util.StringUtils.FromDateTimeToISO8601(System.DateTime) can not be found. Looking at the Cake addin you mentioned, on nuget.org it shows that it has some dependencies to the AWSSDK.Core and AWSSDK.ElasticBeanstalk packages. And on the github project of the first one you can see, that this is where the method is implemented.



            So I guess that you don't specify those dependencies when building your forked addin and therefor the error occurs. If you build a nuget package, add those packages as dependencies (the same way the original addin does).






            share|improve this answer




















            • That was my thinking but I double checked and ensured that the AWSSDK.Core.dll was included in the nuget package and was present in addin folders after cake installed all addins. I even decompiled the .dll to make sure the method infact existed and it does.
              – Jeff Stapleton
              Nov 12 at 17:44












            up vote
            0
            down vote










            up vote
            0
            down vote









            My guess is, that you are missing some dependencies.



            As the error states, the method Amazon.Runtime.Internal.Util.StringUtils.FromDateTimeToISO8601(System.DateTime) can not be found. Looking at the Cake addin you mentioned, on nuget.org it shows that it has some dependencies to the AWSSDK.Core and AWSSDK.ElasticBeanstalk packages. And on the github project of the first one you can see, that this is where the method is implemented.



            So I guess that you don't specify those dependencies when building your forked addin and therefor the error occurs. If you build a nuget package, add those packages as dependencies (the same way the original addin does).






            share|improve this answer












            My guess is, that you are missing some dependencies.



            As the error states, the method Amazon.Runtime.Internal.Util.StringUtils.FromDateTimeToISO8601(System.DateTime) can not be found. Looking at the Cake addin you mentioned, on nuget.org it shows that it has some dependencies to the AWSSDK.Core and AWSSDK.ElasticBeanstalk packages. And on the github project of the first one you can see, that this is where the method is implemented.



            So I guess that you don't specify those dependencies when building your forked addin and therefor the error occurs. If you build a nuget package, add those packages as dependencies (the same way the original addin does).







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 12 at 15:28









            Philipp Grathwohl

            1,38031628




            1,38031628











            • That was my thinking but I double checked and ensured that the AWSSDK.Core.dll was included in the nuget package and was present in addin folders after cake installed all addins. I even decompiled the .dll to make sure the method infact existed and it does.
              – Jeff Stapleton
              Nov 12 at 17:44
















            • That was my thinking but I double checked and ensured that the AWSSDK.Core.dll was included in the nuget package and was present in addin folders after cake installed all addins. I even decompiled the .dll to make sure the method infact existed and it does.
              – Jeff Stapleton
              Nov 12 at 17:44















            That was my thinking but I double checked and ensured that the AWSSDK.Core.dll was included in the nuget package and was present in addin folders after cake installed all addins. I even decompiled the .dll to make sure the method infact existed and it does.
            – Jeff Stapleton
            Nov 12 at 17:44




            That was my thinking but I double checked and ensured that the AWSSDK.Core.dll was included in the nuget package and was present in addin folders after cake installed all addins. I even decompiled the .dll to make sure the method infact existed and it does.
            – Jeff Stapleton
            Nov 12 at 17:44












            up vote
            0
            down vote



            accepted










            I figured out the issue. I was using two addins the first is Cake.AWS.S3 the second is Cake.AWS.ElasticBeanstalk and since the S3 addin was defined first when cake needed to reference the AWSSDK.Core.dll it would use the .dll the S3 addin provided which happened to be an older version than the ElasticBeanstalk addin was expecting, resulting in it calling a method that doesn't exist.



            If I simply define the Cake.AWS.ElasticBeanstalk addin first it works. I may submit a pull request to upgrade S3 addin's AWSSDK.Core.dll






            share|improve this answer
























              up vote
              0
              down vote



              accepted










              I figured out the issue. I was using two addins the first is Cake.AWS.S3 the second is Cake.AWS.ElasticBeanstalk and since the S3 addin was defined first when cake needed to reference the AWSSDK.Core.dll it would use the .dll the S3 addin provided which happened to be an older version than the ElasticBeanstalk addin was expecting, resulting in it calling a method that doesn't exist.



              If I simply define the Cake.AWS.ElasticBeanstalk addin first it works. I may submit a pull request to upgrade S3 addin's AWSSDK.Core.dll






              share|improve this answer






















                up vote
                0
                down vote



                accepted







                up vote
                0
                down vote



                accepted






                I figured out the issue. I was using two addins the first is Cake.AWS.S3 the second is Cake.AWS.ElasticBeanstalk and since the S3 addin was defined first when cake needed to reference the AWSSDK.Core.dll it would use the .dll the S3 addin provided which happened to be an older version than the ElasticBeanstalk addin was expecting, resulting in it calling a method that doesn't exist.



                If I simply define the Cake.AWS.ElasticBeanstalk addin first it works. I may submit a pull request to upgrade S3 addin's AWSSDK.Core.dll






                share|improve this answer












                I figured out the issue. I was using two addins the first is Cake.AWS.S3 the second is Cake.AWS.ElasticBeanstalk and since the S3 addin was defined first when cake needed to reference the AWSSDK.Core.dll it would use the .dll the S3 addin provided which happened to be an older version than the ElasticBeanstalk addin was expecting, resulting in it calling a method that doesn't exist.



                If I simply define the Cake.AWS.ElasticBeanstalk addin first it works. I may submit a pull request to upgrade S3 addin's AWSSDK.Core.dll







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 12 at 17:42









                Jeff Stapleton

                7817




                7817



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53233059%2fcake-build-script-calling-aws-elasticbeanstalk-describeenvironments-throwing-m%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Use pre created SQLite database for Android project in kotlin

                    Darth Vader #20

                    Ondo