You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/12/07 16:27:00 UTC

[jira] [Commented] (BROOKLYN-568) Rebind failed: NPE deserializing SshFeed

    [ https://issues.apache.org/jira/browse/BROOKLYN-568?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16282102#comment-16282102 ] 

ASF GitHub Bot commented on BROOKLYN-568:
-----------------------------------------

GitHub user aledsage opened a pull request:

    https://github.com/apache/brooklyn-server/pull/912

    BROOKLYN-568: fix NPE on SshFeed rebind

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/aledsage/brooklyn-server BROOKLYN-568

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/brooklyn-server/pull/912.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #912
    
----
commit 2f0bd261cfab06cb9b26c2242750fd4bfadc3764
Author: Aled Sage <al...@gmail.com>
Date:   2017-12-07T15:54:20Z

    BROOKLYN-568: fix NPE on SshFeed rebind

----


> Rebind failed: NPE deserializing SshFeed
> ----------------------------------------
>
>                 Key: BROOKLYN-568
>                 URL: https://issues.apache.org/jira/browse/BROOKLYN-568
>             Project: Brooklyn
>          Issue Type: Bug
>    Affects Versions: 0.12.0
>            Reporter: Aled Sage
>            Assignee: Aled Sage
>
> With Brooklyn 1.0.0-SNAPSHOT, I tried rebinding to some persisted state from 0.12.0. However, rebind failed to deserialize an {{SsshFeed}} with the exception below:
> {noformat}
> 2017-11-25T22:03:31,781 WARN  123 o.a.b.c.m.r.RebindExceptionHandlerImpl [ooklyn-persister] problem loading memento: memento kscyylt8h9 (FEED) deserialization error; continuing: com.thoughtworks.xstream.converters.ConversionException: C
> ould not call com.google.common.collect.HashMultimap.readObject() : null
> ---- Debugging information ----
> message             : Could not call com.google.common.collect.HashMultimap.readObject()
> cause-exception     : java.lang.NullPointerException
> cause-message       : null
> class               : com.google.common.collect.HashMultimap
> required-type       : com.google.common.collect.HashMultimap
> converter-type      : com.thoughtworks.xstream.converters.reflection.SerializableConverter
> path                : /feed/config/polls/com.google.guava:com.google.common.collect.HashMultimap/com.google.guava:com.google.common.collect.HashMultimap
> line number         : 135
> class[1]            : java.util.LinkedHashMap
> converter-type[1]   : org.apache.brooklyn.util.core.xstream.StringKeyMapConverter
> class[2]            : org.apache.brooklyn.core.mgmt.rebind.dto.BasicFeedMemento
> converter-type[2]   : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
> version             : 1.0.0-20171113.0927
> -------------------------------
> com.thoughtworks.xstream.converters.ConversionException: Could not call com.google.common.collect.HashMultimap.readObject() : null
> ---- Debugging information ----
> message             : Could not call com.google.common.collect.HashMultimap.readObject()
> cause-exception     : java.lang.NullPointerException
> cause-message       : null
> class               : com.google.common.collect.HashMultimap
> required-type       : com.google.common.collect.HashMultimap
> converter-type      : com.thoughtworks.xstream.converters.reflection.SerializableConverter
> path                : /feed/config/polls/com.google.guava:com.google.common.collect.HashMultimap/com.google.guava:com.google.common.collect.HashMultimap
> line number         : 135
> class[1]            : java.util.LinkedHashMap
> converter-type[1]   : org.apache.brooklyn.util.core.xstream.StringKeyMapConverter
> class[2]            : org.apache.brooklyn.core.mgmt.rebind.dto.BasicFeedMemento
> converter-type[2]   : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
> version             : 1.0.0-20171113.0927
> -------------------------------
>         at com.thoughtworks.xstream.core.util.SerializationMembers.callReadObject(SerializationMembers.java:133) [269:xstream:1.4.8]
>         at com.thoughtworks.xstream.converters.reflection.SerializableConverter.doUnmarshal(SerializableConverter.java:455) [269:xstream:1.4.8]
>         at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:263) [269:xstream:1.4.8]
>         at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72) [269:xstream:1.4.8]
>         at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65) [269:xstream:1.4.8]
>         at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66) [269:xstream:1.4.8]
>         at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50) [269:xstream:1.4.8]
>         at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:71) [269:xstream:1.4.8]
>         at org.apache.brooklyn.util.core.xstream.StringKeyMapConverter.unmarshalStringKey(StringKeyMapConverter.java:120) [123:org.apache.brooklyn.core:1.0.0.20171113_0927]
>         at org.apache.brooklyn.util.core.xstream.StringKeyMapConverter.unmarshalEntry(StringKeyMapConverter.java:111) [123:org.apache.brooklyn.core:1.0.0.20171113_0927]
>         at org.apache.brooklyn.util.core.xstream.MapConverter.populateMap(MapConverter.java:89) [123:org.apache.brooklyn.core:1.0.0.20171113_0927]
>         at com.thoughtworks.xstream.converters.collections.MapConverter.unmarshal(MapConverter.java:87) [269:xstream:1.4.8]
>         at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72) [269:xstream:1.4.8]
>         at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65) [269:xstream:1.4.8]
>         at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66) [269:xstream:1.4.8]
>         at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshallField(AbstractReflectionConverter.java:480) [269:xstream:1.4.8]
>         at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:412) [269:xstream:1.4.8]
>         at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:263) [269:xstream:1.4.8]
>         at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72) [269:xstream:1.4.8]
>        at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65) [269:xstream:1.4.8]
>         at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66) [269:xstream:1.4.8]
>         at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50) [269:xstream:1.4.8]
>         at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134) [269:xstream:1.4.8]
>         at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32) [269:xstream:1.4.8]
>         at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1206) [269:xstream:1.4.8]
>         at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1190) [269:xstream:1.4.8]
>         at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1061) [269:xstream:1.4.8]
>         at org.apache.brooklyn.util.core.xstream.XmlSerializer.deserialize(XmlSerializer.java:167) [123:org.apache.brooklyn.core:1.0.0.20171113_0927]
>         at org.apache.brooklyn.util.core.xstream.XmlSerializer.fromString(XmlSerializer.java:177) [123:org.apache.brooklyn.core:1.0.0.20171113_0927]
>         at org.apache.brooklyn.core.mgmt.persist.RetryingMementoSerializer.fromString(RetryingMementoSerializer.java:71) [123:org.apache.brooklyn.core:1.0.0.20171113_0927]
>         at org.apache.brooklyn.core.mgmt.persist.BrooklynMementoPersisterToObjectStore$4.visit(BrooklynMementoPersisterToObjectStore.java:482) [123:org.apache.brooklyn.core:1.0.0.20171113_0927]
>         at org.apache.brooklyn.core.mgmt.persist.BrooklynMementoPersisterToObjectStore$1VisitorWrapper.run(BrooklynMementoPersisterToObjectStore.java:536) [123:org.apache.brooklyn.core:1.0.0.20171113_0927]
>         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
>         at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
>         at java.lang.Thread.run(Thread.java:748) [?:?]
> Caused by: java.lang.NullPointerException
>         at org.apache.brooklyn.core.sensor.ssh.SshCommandSensor.makeCommandExecutingInDirectory(SshCommandSensor.java:160) ~[?:?]
>         at org.apache.brooklyn.core.sensor.ssh.SshCommandSensor$2.get(SshCommandSensor.java:128) ~[?:?]
>         at org.apache.brooklyn.core.sensor.ssh.SshCommandSensor$2.get(SshCommandSensor.java:125) ~[?:?]
>         at org.apache.brooklyn.feed.CommandPollConfig.toStringPollSource(CommandPollConfig.java:170) ~[?:?]
>         at org.apache.brooklyn.core.feed.FeedConfig.equalsFields(FeedConfig.java:281) ~[?:?]
>         at org.apache.brooklyn.core.feed.PollConfig.equalsFields(PollConfig.java:83) ~[?:?]
>         at org.apache.brooklyn.feed.CommandPollConfig.equalsFields(CommandPollConfig.java:174) ~[?:?]
>         at org.apache.brooklyn.core.feed.FeedConfig.hashCode(FeedConfig.java:289) ~[?:?]
>         at java.util.HashMap.hash(HashMap.java:338) ~[?:?]
>         at java.util.HashMap.put(HashMap.java:611) ~[?:?]
>         at java.util.HashSet.add(HashSet.java:219) ~[?:?]
>         at com.google.common.collect.AbstractMapBasedMultimap$WrappedCollection.add(AbstractMapBasedMultimap.java:505) ~[?:?]
>         at com.google.common.collect.Serialization.populateMultimap(Serialization.java:190) ~[?:?]
>         at com.google.common.collect.HashMultimap.readObject(HashMultimap.java:137) ~[?:?]
>         at sun.reflect.GeneratedMethodAccessor89.invoke(Unknown Source) ~[?:?]
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
>         at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
>         at com.thoughtworks.xstream.core.util.SerializationMembers.callReadObject(SerializationMembers.java:125) ~[?:?]
>         ... 36 more
> {noformat}
> The feed throwing the exception was:
> {noformat}
> <uniqueTag>SshFeed[ssh[source /var/run/flannel/subne.../65bb2d4b-&gt;flannel.mtu]]</uniqueTag>
> {noformat}
> That feed's {{SshCommandSensor}} has {{<val_-entity>aqo7xbff1n</val_-entity>}}, but that entity doesn't exist in the persisted state. In fact the feed is orphaned: it is not referenced by any entity. The {{entity}} field is therefore null.
> The actual NPE is due to a bad implementation of {{FeedConfig.hashCode}}. By calling {{toStringPollSource}}, which calls {{getCommandSupplier().get()}}. But this tries to use a reference to entity {{<val_-entity>aqo7xbff1n</val_-entity>}}, which is null. 
> Note that with the default persistence configuration, the deserialization of the feed is logged but rebind will continue. The error therefore does not cause a serious problem (because the feed is orphaned anyway, we don't care).



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)