You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by GitBox <gi...@apache.org> on 2021/06/14 12:49:00 UTC

[GitHub] [lucenenet] eladmarg opened a new issue #319: NRE on spatial search

eladmarg opened a new issue #319:
URL: https://github.com/apache/lucenenet/issues/319


   Hi,
   I'm getting this exception sometimes, this is on heavily indexed production environment, 
   couldn't reproduce this locally.
   its happening rarely, with unknown reason / pattern.
   
   all I'm doing is simple spatial search, points close to point, ordered by distance.
   I'm using 10km radius filter, with matchalldocs query and sort by distance.
   
   code for sort:
    
   ```
   var point = SpatialContext.MakePoint(lon, lat);
   var valueSource = SpatialStrategy.MakeDistanceValueSource(point, DistanceUtils.DEG_TO_KM);
   var sort = new Sort(valueSource.GetSortField(false)).Rewrite(indexSearcher);
   ```
   the exception:
   
   System.NullReferenceException: Object reference not set to an instance of an object.  
      at Spatial4n.Core.Util.GeohashUtils.DecodeBoundary(String geohash, SpatialContext ctx)  
      at Spatial4n.Core.Util.GeohashUtils.Decode(String geohash, SpatialContext ctx)  
      at Lucene.Net.Spatial.Util.ShapeFieldCacheProvider`1.<GetCache>b__5_0(IndexReader key)  
      at System.Runtime.CompilerServices.ConditionalWeakTable`2.GetValue(TKey key, CreateValueCallback createValueCallback)  
      at Lucene.Net.Spatial.Util.ShapeFieldCacheDistanceValueSource.CachedDistanceFunctionValue..ctor(AtomicReader reader, ShapeFieldCacheDistanceValueSource enclosingInstance)  
      at Lucene.Net.Spatial.Util.ShapeFieldCacheDistanceValueSource.GetValues(IDictionary context, AtomicReaderContext readerContext)  
      at Lucene.Net.Queries.Function.ValueSource.ValueSourceComparer.SetNextReader(AtomicReaderContext context)  
      at Lucene.Net.Search.TopFieldCollector.OneComparerNonScoringCollector.SetNextReader(AtomicReaderContext context)  
      at Lucene.Net.IndexSearcher.Search.Search(IList`1 leaves, Weight weight, ICollector collector)  
      at Lucene.Net.IndexSearcher.Search.Search(IList`1 leaves, Weight weight, FieldDoc after, Int32 nDocs, Sort sort, Boolean fillFields, Boolean doDocScores, Boolean doMaxScore)  
      at Lucene.Net.IndexSearcher.Search.Search(Weight weight, FieldDoc after, Int32 nDocs, Sort sort, Boolean fillFields, Boolean doDocScores, Boolean doMaxScore)  
   
   
   any ideas?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [lucenenet] eladmarg commented on issue #319: NRE on spatial search

Posted by GitBox <gi...@apache.org>.
eladmarg commented on issue #319:
URL: https://github.com/apache/lucenenet/issues/319#issuecomment-860193856


   this still occurs
   
   <pre>
   System.NullReferenceException: Object reference not set to an instance of an object.
      at IRectangle Spatial4n.Core.Util.GeohashUtils.DecodeBoundary(string geohash, SpatialContext ctx)
      at IPoint Spatial4n.Core.Util.GeohashUtils.Decode(string geohash, SpatialContext ctx)
      at ShapeFieldCache<T> Lucene.Net.Spatial.Util.ShapeFieldCacheProvider<T>.GetCache(AtomicReader reader)+(IndexReader key) => { }
      at TValue System.Runtime.CompilerServices.ConditionalWeakTable<TKey, TValue>.GetValueLocked(TKey key, CreateValueCallback createValueCallback)
      at TValue System.Runtime.CompilerServices.ConditionalWeakTable<TKey, TValue>.GetValue(TKey key, CreateValueCallback createValueCallback)
      at new Lucene.Net.Spatial.Util.ShapeFieldCacheDistanceValueSource+CachedDistanceFunctionValue(AtomicReader reader, ShapeFieldCacheDistanceValueSource enclosingInstance)
      at FunctionValues Lucene.Net.Spatial.Util.ShapeFieldCacheDistanceValueSource.GetValues(IDictionary context, AtomicReaderContext readerContext)
      at FieldComparer Lucene.Net.Queries.Function.ValueSource+ValueSourceComparer.SetNextReader(AtomicReaderContext context)
      at void Lucene.Net.Search.TopFieldCollector+OneComparerNonScoringCollector.SetNextReader(AtomicReaderContext context)
      at void Lucene.Net.IndexSearcher.Search.Search(IList<AtomicReaderContext> leaves, Weight weight, ICollector collector) x 5
   </pre>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [lucenenet] NightOwl888 commented on issue #319: NRE on spatial search

Posted by GitBox <gi...@apache.org>.
NightOwl888 commented on issue #319:
URL: https://github.com/apache/lucenenet/issues/319#issuecomment-774223702


   I see. Could you please provide complete example code to reproduce the issue (even if it happens rarely)?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [lucenenet] eladmarg closed issue #319: NRE on spatial search

Posted by GitBox <gi...@apache.org>.
eladmarg closed issue #319:
URL: https://github.com/apache/lucenenet/issues/319


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@lucenenet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [lucenenet] eladmarg commented on issue #319: NRE on spatial search

Posted by GitBox <gi...@apache.org>.
eladmarg commented on issue #319:
URL: https://github.com/apache/lucenenet/issues/319#issuecomment-901240097


   finally, I can confirm this is resolved. (thanks to #509)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@lucenenet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [lucenenet] eladmarg commented on issue #319: NRE on spatial search

Posted by GitBox <gi...@apache.org>.
eladmarg commented on issue #319:
URL: https://github.com/apache/lucenenet/issues/319#issuecomment-773081085


   still happen...


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [lucenenet] NightOwl888 commented on issue #319: NRE on spatial search

Posted by GitBox <gi...@apache.org>.
NightOwl888 commented on issue #319:
URL: https://github.com/apache/lucenenet/issues/319#issuecomment-665516967


   What version are you seeing this in? And does the behavior differ between versions?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [lucenenet] NightOwl888 closed issue #319: NRE on spatial search

Posted by GitBox <gi...@apache.org>.
NightOwl888 closed issue #319:
URL: https://github.com/apache/lucenenet/issues/319


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [lucenenet] eladmarg commented on issue #319: NRE on spatial search

Posted by GitBox <gi...@apache.org>.
eladmarg commented on issue #319:
URL: https://github.com/apache/lucenenet/issues/319#issuecomment-901240097


   finally, I can confirm this is resolved. (thanks to #509)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@lucenenet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [lucenenet] eladmarg commented on issue #319: NRE on spatial search

Posted by GitBox <gi...@apache.org>.
eladmarg commented on issue #319:
URL: https://github.com/apache/lucenenet/issues/319#issuecomment-666959114


   maybe this can give more information, i noticed this exception too, (very rarely)
   
   ```csharp
   System.ArgumentOutOfRangeException: Index and count must refer to a location within the buffer.  Parameter name: bytes  
      at System.Text.UTF8Encoding.GetString(Byte[] bytes, Int32 index, Int32 count)  
      at Lucene.Net.Spatial.Prefix.Tree.Cell.get_TokenString()  
      at Lucene.Net.Spatial.Prefix.Tree.GeohashPrefixTree.GhCell.get_Center()  
      at Lucene.Net.Spatial.Util.ShapeFieldCacheProvider`1.<GetCache>b__5_0(IndexReader key)  
      at System.Runtime.CompilerServices.ConditionalWeakTable`2.GetValue(TKey key, CreateValueCallback createValueCallback)  
      at Lucene.Net.Spatial.Util.ShapeFieldCacheDistanceValueSource.CachedDistanceFunctionValue..ctor(AtomicReader reader, ShapeFieldCacheDistanceValueSource enclosingInstance)  
      at Lucene.Net.Spatial.Util.ShapeFieldCacheDistanceValueSource.GetValues(IDictionary context, AtomicReaderContext readerContext)  
      at Lucene.Net.Queries.Function.ValueSource.ValueSourceComparer.SetNextReader(AtomicReaderContext context)  
      at Lucene.Net.Search.TopFieldCollector.OneComparerNonScoringCollector.SetNextReader(AtomicReaderContext context)  
      at Lucene.Net.IndexSearcher.Search.Search(IList`1 leaves, Weight weight, ICollector collector)  
      at Lucene.Net.IndexSearcher.Search.Search(IList`1 leaves, Weight weight, FieldDoc after, Int32 nDocs, Sort sort, Boolean fillFields, Boolean doDocScores, Boolean doMaxScore)  
      at Lucene.Net.IndexSearcher.Search.Search(Weight weight, FieldDoc after, Int32 nDocs, Sort sort, Boolean fillFields, Boolean doDocScores, Boolean doMaxScore)  
   
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [lucenenet] eladmarg commented on issue #319: NRE on spatial search

Posted by GitBox <gi...@apache.org>.
eladmarg commented on issue #319:
URL: https://github.com/apache/lucenenet/issues/319#issuecomment-773081085


   still happen...


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [lucenenet] eladmarg closed issue #319: NRE on spatial search

Posted by GitBox <gi...@apache.org>.
eladmarg closed issue #319:
URL: https://github.com/apache/lucenenet/issues/319


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@lucenenet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [lucenenet] NightOwl888 commented on issue #319: NRE on spatial search

Posted by GitBox <gi...@apache.org>.
NightOwl888 commented on issue #319:
URL: https://github.com/apache/lucenenet/issues/319#issuecomment-901258903


   Thanks for the update Elad.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@lucenenet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [lucenenet] eladmarg commented on issue #319: NRE on spatial search

Posted by GitBox <gi...@apache.org>.
eladmarg commented on issue #319:
URL: https://github.com/apache/lucenenet/issues/319#issuecomment-665518934


   > What version are you seeing this in? And does the behavior differ between versions?
   
   latest (beta 11, it was also on previous versions from the beta 8, maybe even before but this issue was on beta 8)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [lucenenet] eladmarg commented on issue #319: NRE on spatial search

Posted by GitBox <gi...@apache.org>.
eladmarg commented on issue #319:
URL: https://github.com/apache/lucenenet/issues/319#issuecomment-723428344


   Thanks for the update, 
   I'll deploy next release and hope this will be resolved 
   
   It's happening very rarely on production with high frequency request rates 
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [lucenenet] NightOwl888 commented on issue #319: NRE on spatial search

Posted by GitBox <gi...@apache.org>.
NightOwl888 commented on issue #319:
URL: https://github.com/apache/lucenenet/issues/319#issuecomment-723422073


   @eladmarg 
   
   I have tracked down issue #296 which also started to appear on 4.8.0-beta00008 and didn't occur on 4.8.0-beta00007. Could you download the packages from the `nuget` artifact [here](https://dev.azure.com/LuceneNET-Temp/Lucene.NET/_build/results?buildId=1171&view=artifacts&type=publishedArtifacts) to see if this problem still exists?
   
   If this issue still exists, it may be possible to trace it to a commit if you can provide a console app and the data that causes it to fail.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org