rundeck-plugins / rundeck-ec2-nodes-plugin

Get resource node data from Amazon EC2
85 stars 45 forks source link

NullPointerException when trying to save project. #23

Closed burdandrei closed 8 years ago

burdandrei commented 9 years ago

Hi, i updated the plugin version to 1.5 because of eu-central-1 signing issue, and started to receive the NullPointerException on Project save. It's easy reprodusable:

  1. edit project
  2. add ec2 resources
  3. try to delete them receive:
java.util.NoSuchElementException
    at java.util.ArrayList$Itr.next(ArrayList.java:834)
    at java.util.Collections.max(Collections.java:698)
    at rundeck.services.PasswordFieldsService.adjust(PasswordFieldsService.groovy:55)
    at rundeck.controllers.FrameworkController$_closure4.doCall(FrameworkController.groovy:901)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:565)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1360)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1331)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1331)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1331)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:477)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:539)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1031)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:406)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:965)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
    at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:288)
    at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:115)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1331)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1331)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1331)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1331)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1331)
    at com.codahale.metrics.servlet.AbstractInstrumentedFilter.doFilter(AbstractInstrumentedFilter.java:97)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1331)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:477)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:486)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1031)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:406)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:965)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
    at org.eclipse.jetty.server.Server.handle(Server.java:349)
    at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:449)
    at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:925)
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:857)
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
    at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:76)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
    at java.lang.Thread.run(Thread.java:745)

I tried to edit my current projects and looks like if i add http proxy password i can change mapping or something, but i still cant delete it.

I'm running Rundeck 2.3.2-1 with MySQL backend.

thanks

ghost commented 9 years ago

Same thing. I'm on Rundeck 2.3.2, EC2 plugin 1.5.

gschueler commented 9 years ago

hi there was a bug fixed for upcoming rundeck 2.4, I will verify if that is the cause

gschueler commented 9 years ago

yes this is the cause: https://github.com/rundeck/rundeck/issues/1025

ghost commented 9 years ago

Is there a workaround? I found that I could add a ec2 source while creating a project. This did not get any amazon errors, but it still did not find any of my instances. Have you done that with a current rundeck and had it work?

Note that I used the plug-in as shipped. Did not change the mapping file or add any filters.

Thanks for all your work, I know how much time this kind of project takes.

Lance

On Mon, Dec 15, 2014 at 11:06 AM, Greg Schueler notifications@github.com wrote:

yes this is the cause: rundeck/rundeck#1025 https://github.com/rundeck/rundeck/issues/1025

— Reply to this email directly or view it on GitHub https://github.com/rundeck-plugins/rundeck-ec2-nodes-plugin/issues/23#issuecomment-67046719 .

gschueler commented 9 years ago

A workaround is to hand-edit the project.properties file to add the values. (note; password values are cleartext in this file)   Here is a full config example, if this is the 3rd resource model source for the project. (otherwise change 3 to another #). I put blank values for the optional config values;

resources.source.3.type=aws-ec2 resources.source.3.config.accessKey= resources.source.3.config.httpProxyUser= resources.source.3.config.httpProxyPass= resources.source.3.config.mappingFile= resources.source.3.config.filter= resources.source.3.config.secretKey= resources.source.3.config.mappingParams= resources.source.3.config.runningOnly=true resources.source.3.config.httpProxyPort=80 resources.source.3.config.endpoint= resources.source.3.config.httpProxyHost= resources.source.3.config.useDefaultMapping=true resources.source.3.config.refreshInterval=30

Greg Schueler

On December 15, 2014 at 12:21:35 PM, lance-edmodo (notifications@github.com) wrote:

Is there a workaround? I found that I could add a ec2 source while creating a project. This did not get any amazon errors, but it still did not find any of my instances. Have you done that with a current rundeck and had it work?

Note that I used the plug-in as shipped. Did not change the mapping file or add any filters.

Thanks for all your work, I know how much time this kind of project takes.

Lance

On Mon, Dec 15, 2014 at 11:06 AM, Greg Schueler notifications@github.com wrote:

yes this is the cause: rundeck/rundeck#1025 https://github.com/rundeck/rundeck/issues/1025

— Reply to this email directly or view it on GitHub https://github.com/rundeck-plugins/rundeck-ec2-nodes-plugin/issues/23#issuecomment-67046719 .

— Reply to this email directly or view it on GitHub.

burdandrei commented 9 years ago

If you're using DB Backend it's a little hard to edit the file, but i found a workaround: just put something in password field - one character is enough, and you can save the project!