How to analyse iPhone crash log with JSON - ios

I got a crash log like this:
{"timestamp":"2017-01-05 22:29:03.03 +0800","bug_type":"298","os_version":"iPhone OS 9.3.2 (13F69)"}
{
"crashReporterKey" : "6e088e6d206ce6025a40eacd5ea68779dc5ac344",
"kernel" : "Darwin Kernel Version 15.5.0: Mon Apr 18 16:44:06 PDT 2016; root:xnu-3248.50.21~4\/RELEASE_ARM64_T7000",
"product" : "iPhone7,2",
"incident" : "C106CE8A-F492-47FF-BEA9-293E6ACFE201",
"date" : "2017-01-05 22:29:03.03 +0800",
"build" : "iPhone OS 9.3.2 (13F69)",
"timeDelta" : 3377,
"memoryStatus" : {
"compressorSize" : 30099,
"pageSize" : 4096,
"compressions" : 719018,
"memoryPages" : {
"active" : 33364,
"throttled" : 0,
"fileBacked" : 24001,
"wired" : 169666,
"anonymous" : 27027,
"purgeable" : 6,
"inactive" : 15716,
"free" : 2836,
"speculative" : 1948
},
"uncompressed" : 81552,
"decompressions" : 333878
},
"largestProcess" : "MYAPP",
"processes" : [
{
"rpages" : 556,
"states" : [
"daemon",
"idle"
],
"name" : "assetsd",
"pid" : 839,
"reason" : "vm-pageshortage",
"fds" : 50,
"uuid" : "MYUUID",
"purgeable" : 0,
"cpuTime" : 0.373819,
"lifetimeMax" : 970
},
{
"rpages" : 231,
"states" : [
"daemon",
"idle"
],
"name" : "followupd",
"pid" : 851,
"reason" : "vm-pageshortage",
"fds" : 50,
"uuid" : "MYUUID",
"purgeable" : 0,
"cpuTime" : 0.04115,
"lifetimeMax" : 487
},
and a lot more...
There is no need to symbolize it since there is no call stack shown.
And I was just running my app to play video for like one hour, then this crash came out.
It is not every time but quite often.
How should I read such kind of log?
Can anyone explain me which of all the keys are important and what they mean in the big json?

#dstudeba is right, when you playing the video your CPU memory consumption is more then it is expected. Sometimes it is happened
when there is bulk of data coming from the server.
when you does not managed the memory in your app.
For more details : Analyzing Crash Reports and MemoryMgmt

Your App crashed because it ran out of memory. I don't know what your app does, but it either has a memory leak or is not monitoring/releasing memory properly.
Under reason it says [vm-pageshortage] according to the Apple documentation it is "The process was killed due to memory pressure."
You can read Apple's documentation on crash reports here: https://developer.apple.com/library/content/technotes/tn2151/_index.html

Related

Unable to find the reason of crash in crash log file shared by apple after app review rejection

My app were rejected by the apple review team and shared a crashlog file but i am not able to find the reason of the crash in crashlog file. Can anyone tell me that how we can find the reason of the crash in crash log file?
`
{"app_name":"Foo","timestamp":"2022-09-08 10:46:03.00 +0100","app_version":"55","slice_uuid":"529efaf0-1464-38b2-8c41-3a0edadca233","adam_id":"1496108936","build_version":"1","platform":2,"bundleID":"com.foo.foo","share_with_app_devs":0,"is_first_party":0,"bug_type":"309","os_version":"iPhone OS 15.6.1 (19G82)","incident_id":"5E8B06A8-EE24-4CDC-BD48-CAB02AEA6615","name":"foo"}
{
"uptime" : 920000,
"procLaunch" : "2022-09-08 10:46:02.5975 +0100",
"procRole" : "Foreground",
"version" : 2,
"userID" : 501,
"deployVersion" : 210,
"modelCode" : "iPad11,3",
"procStartAbsTime" : 22247974353105,
"coalitionID" : 3668,
"osVersion" : {
"isEmbedded" : true,
"train" : "iPhone OS 15.6.1",
"releaseType" : "User",
"build" : "19G82"
},
"captureTime" : "2022-09-08 10:46:03.6753 +0100",
"incident" : "5E8B06A8-EE24-4CDC-BD48-CAB02AEA6615",
"bug_type" : "309",
"pid" : 6341,
"procExitAbsTime" : 22248000054890,
"cpuType" : "ARM-64",
"procName" : "foo",
"procPath" : "\/private\/var\/containers\/Bundle\/Application\/EDF1F543-13EB-453E-AD4A-2FFEA481B288\/foo.app\/foo",
"bundleInfo" : {"CFBundleShortVersionString":"55","CFBundleVersion":"1","CFBundleIdentifier":"com.foo.foo","DTAppStoreToolsBuild":"13F100"},
"storeInfo" : {"itemID":"1496108936","deviceIdentifierForVendor":"B73C62DC-81DF-4552-99BB-FDBCE5E72BDD","thirdParty":true,"softwareVersionExternalIdentifier":"852078451"},
"parentProc" : "launchd",
"parentPid" : 1,
"coalitionName" : "com.foo.foo",
"crashReporterKey" : "24de9edc0e63b08e2d17af0670774d643c794ca5",
"isCorpse" : 1,
"exception" : {"codes":"0x0000000000000001, 0x0000000102e2bbf4","rawCodes":[1,4343380980],"type":"EXC_BREAKPOINT","signal":"SIGTRAP"},
"termination" : {"flags":0,"code":5,"namespace":"SIGNAL","indicator":"Trace\/BPT trap: 5","byProc":"exc handler","byPid":6341},
"faultingThread" : 0,
"threads" : [{"triggered":true,"id":4696497,"threadState":{"x":[{"value":6124189864},{"value":32},{"value":7},{"value":1},{"value":4294967294},{"value":1},{"value":1},{"value":0},{"value":4294967301},{"value":2147483649},{"value":4294967301},{"value":4294967299},{"value":6124189872},{"value":2835368086},{"value":2837467136},{"value":10},{"value":11002588268},{"value":689963008},{"value":0},{"value":6530925228,"symbolLocation":0,"symbol":"swift::metadataimpl::FixedSizeBufferValueWitnesses<swift::metadataimpl::ValueWitnesses<swift::metadataimpl::NativeBox<unsigned long long, 8ul, 8ul, 8ul> >, true, 8ul, 8ul, false>::getEnumTagSinglePayload(swift::OpaqueValue const*, unsigned int, swift::TargetMetadata<swift::InProcess> const*)"},{"value":6124189424},{"value":7961257712,"symbolLocation":0,"symbol":"type metadata for Date"},{"value":7961344592,"symbolLocation":0,"symbol":"value witness table for Builtin.Int64"},{"value":4749843968},{"value":10737611088},{"value":6124189456},{"value":7961182112,"symbolLocation":0,"symbol":"type metadata for IndexPath"},{"value":6124189440},{"value":6124189408}],"flavor":"ARM_THREAD_STATE64","lr":{"value":16168593918452218868},"cpsr":{"value":0},"fp":{"value":6124190000},"sp":{"value":6124188816},"esr":{"value":4060086273,"description":"(Breakpoint) brk 1"},"pc":{"value":4343380980,"matchesCrashFrame":1},"far":{"value":4352726936}},"queue":"com.apple.main-thread","frames":[{"imageOffset":703476,"imageIndex":0},{"imageOffset":703476,"imageIndex":0},{"imageOffset":683444,"imageIndex":0},{"imageOffset":2648516,"symbol":"-[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:]","symbolLocation":1532,"imageIndex":1},{"imageOffset":4735024,"symbol":"-[UITableView _updateVisibleCellsForRanges:createIfNecessary:]","symbolLocation":732,"imageIndex":1},{"imageOffset":2800572,"symbol":"-[UITableView _updateVisibleCellsNow:]","symbolLocation":1432,"imageIndex":1},{"imageOffset":1556184,"symbol":"-[UITableView layoutSubviews]","symbolLocation":456,"imageIndex":1},{"imageOffset":1622396,"symbol":"-[UIView(CALayerDelegate) layoutSublayersOfLayer:]","symbolLocation":2592,"imageIndex":1},{"imageOffset":264188,"symbol":"CA::Layer::layout_if_needed(CA::Transaction*)","symbolLocation":532,"imageIndex":2},{"imageOffset":207968,"symbol":"CA::Layer::layout_and_display_if_needed(CA::Transaction*)","symbolLocation":136,"imageIndex":2},{"imageOffset":292276,"symbol":"CA::Context::commit_transaction(CA::Transaction*, double, double*)","symbolLocation":452,"imageIndex":2},{"imageOffset":328872,"symbol":"CA::Transaction::commit()","symbolLocation":704,"imageIndex":2},{"imageOffset":205728,"symbol":"CA::Transaction::flush_as_runloop_observer(bool)","symbolLocation":88,"imageIndex":2},{"imageOffset":266436,"symbol":"__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__","symbolLocation":36,"imageIndex":3},{"imageOffset":65664,"symbol":"__CFRunLoopDoObservers","symbolLocation":592,"imageIndex":3},{"imageOffset":45372,"symbol":"__CFRunLoopRun","symbolLocation":1052,"imageIndex":3},{"imageOffset":125896,"symbol":"CFRunLoopRunSpecific","symbolLocation":600,"imageIndex":3},{"imageOffset":4980,"symbol":"GSEventRunModal","symbolLocation":164,"imageIndex":4},{"imageOffset":5327704,"symbol":"-[UIApplication _run]","symbolLocation":1100,"imageIndex":1},{"imageOffset":2711696,"symbol":"UIApplicationMain","symbolLocation":364,"imageIndex":1},{"imageOffset":24976,"imageIndex":0},{"imageOffset":105892,"symbol":"start","symbolLocation":520,"imageIndex":5}]},{"id":4696501,"frames":[{"imageOffset":3668,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":6}]},{"id":4696502,"frames":[{"imageOffset":3668,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":6}]},{"id":4696503,"frames":[{"imageOffset":3668,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":6}]},{"id":4696504,"name":"com.apple.uikit.eventfetch-thread","frames":[{"imageOffset":5280,"symbol":"mach_msg_trap","symbolLocation":8,"imageIndex":7},{"imageOffset":6884,"symbol":"mach_msg","symbolLocation":76,"imageIndex":7},{"imageOffset":27952,"symbol":"__CFRunLoopServiceMachPort","symbolLocation":372,"imageIndex":3},{"imageOffset":45500,"symbol":"__CFRunLoopRun","symbolLocation":1180,"imageIndex":3},{"imageOffset":125896,"symbol":"CFRunLoopRunSpecific","symbolLocation":600,"imageIndex":3},{"imageOffset":103492,"symbol":"-[NSRunLoop(NSRunLoop) runMode:beforeDate:]","symbolLocation":236,"imageIndex":8},{"imageOffset":372236,"symbol":"-[NSRunLoop(NSRunLoop) runUntilDate:]","symbolLocation":92,"imageIndex":8},{"imageOffset":4779204,"symbol":"-[UIEventFetcher threadMain]","symbolLocation":524,"imageIndex":1},{"imageOffset":431132,"symbol":"__NSThread__start__","symbolLocation":808,"imageIndex":8},{"imageOffset":6572,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":6},{"imageOffset":3688,"symbol":"thread_start","symbolLocation":8,"imageIndex":6}]},{"id":4696505,"frames":[{"imageOffset":3668,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":6}]},{"id":4696506,"frames":[{"imageOffset":3668,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":6}]},{"id":4696507,"frames":[{"imageOffset":3668,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":6}]},{"id":4696511,"frames":[{"imageOffset":3668,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":6}]},{"id":4696512,"frames":[{"imageOffset":3668,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":6}]},{"id":4696513,"frames":[{"imageOffset":3668,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":6}]},{"id":4696514,"frames":[{"imageOffset":3668,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":6}]},{"id":4696516,"name":"com.apple.NSURLConnectionLoader","frames":[{"imageOffset":5280,"symbol":"mach_msg_trap","symbolLocation":8,"imageIndex":7},{"imageOffset":6884,"symbol":"mach_msg","symbolLocation":76,"imageIndex":7},{"imageOffset":27952,"symbol":"__CFRunLoopServiceMachPort","symbolLocation":372,"imageIndex":3},{"imageOffset":45500,"symbol":"__CFRunLoopRun","symbolLocation":1180,"imageIndex":3},{"imageOffset":125896,"symbol":"CFRunLoopRunSpecific","symbolLocation":600,"imageIndex":3},{"imageOffset":2589148,"imageIndex":9},{"imageOffset":431132,"symbol":"__NSThread__start__","symbolLocation":808,"imageIndex":8},{"imageOffset":6572,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":6},{"imageOffset":3688,"symbol":"thread_start","symbolLocation":8,"imageIndex":6}]},{"id":4696517,"name":"com.apple.CoreMotion.MotionThread","frames":[{"imageOffset":5280,"symbol":"mach_msg_trap","symbolLocation":8,"imageIndex":7},{"imageOffset":6884,"symbol":"mach_msg","symbolLocation":76,"imageIndex":7},{"imageOffset":27952,"symbol":"__CFRunLoopServiceMachPort","symbolLocation":372,"imageIndex":3},{"imageOffset":45500,"symbol":"__CFRunLoopRun","symbolLocation":1180,"imageIndex":3},{"imageOffset":125896,"symbol":"CFRunLoopRunSpecific","symbolLocation":600,"imageIndex":3},{"imageOffset":654760,"symbol":"CFRunLoopRun","symbolLocation":64,"imageIndex":3},{"imageOffset":76444,"imageIndex":10},{"imageOffset":6572,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":6},{"imageOffset":3688,"symbol":"thread_start","symbolLocation":8,"imageIndex":6}]},{"id":4696518,"name":"AVAudioSession Notify Thread","frames":[{"imageOffset":5280,"symbol":"mach_msg_trap","symbolLocation":8,"imageIndex":7},{"imageOffset":6884,"symbol":"mach_msg","symbolLocation":76,"imageIndex":7},{"imageOffset":27952,"symbol":"__CFRunLoopServiceMachPort","symbolLocation":372,"imageIndex":3},{"imageOffset":45500,"symbol":"__CFRunLoopRun","symbolLocation":1180,"imageIndex":3},{"imageOffset":125896,"symbol":"CFRunLoopRunSpecific","symbolLocation":600,"imageIndex":3},{"imageOffset":28420,"symbol":"CADeprecated::GenericRunLoopThread::Entry(void*)","symbolLocation":164,"imageIndex":11},{"imageOffset":67824,"symbol":"CADeprecated::CAPThread::Entry(CADeprecated::CAPThread*)","symbolLocation":92,"imageIndex":11},{"imageOffset":6572,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":6},{"imageOffset":3688,"symbol":"thread_start","symbolLocation":8,"imageIndex":6}]},{"id":4696519,"name":"JavaScriptCore libpas scavenger","frames":[{"imageOffset":7972,"symbol":"__psynch_cvwait","symbolLocation":8,"imageIndex":7},{"imageOffset":33432,"symbol":"_pthread_cond_wait","symbolLocation":1236,"imageIndex":6},{"imageOffset":962888,"symbol":"scavenger_thread_main","symbolLocation":1232,"imageIndex":12},{"imageOffset":6572,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":6},{"imageOffset":3688,"symbol":"thread_start","symbolLocation":8,"imageIndex":6}]}],
"usedImages" : [
{
"source" : "P",
"arch" : "arm64",
"base" : 4342677504,
"size" : 4833280,
"uuid" : "529efaf0-1464-38b2-8c41-3a0edadca233",
"path" : "\/private\/var\/containers\/Bundle\/Application\/EDF1F543-13EB-453E-AD4A-2FFEA481B288\/foo.app\/foo",
"name" : "foo"
}
]
}
`
Trying to find the reason of crash in the crash log file.

What are the GLTF animations sampler input/output values?

I am reading the specification, but I can not understand the properties of the sampler.
This is the animation that I have
"animations" : [
{
"channels" : [
{
"sampler" : 0,
"target" : {
"node" : 0,
"path" : "translation"
}
}
],
"name" : "00001_2780.datAction",
"samplers" : [
{
"input" : 9,
"interpolation" : "CUBICSPLINE",
"output" : 10
}
]
},
{
"channels" : [
{
"sampler" : 0,
"target" : {
"node" : 1,
"path" : "translation"
}
}
],
"name" : "00002_2780.datAction",
"samplers" : [
{
"input" : 9,
"interpolation" : "CUBICSPLINE",
"output" : 11
}
]
}
],
What I can not understand is what are the values 9 and 10 for the first sample and 9 and 11 for the second
All that we have in the specification is
https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#animations
Each of the animation's samplers defines the input/output pair: a set of floating point scalar values representing linear time in seconds; and a set of vectors or scalars representing animated property.
And this makes it more unclear to me.
Is there a more detailed explanation about what input/output values are and what they represent. What will happen for example if I change the input from 9 to 99 or to 9.9 or to 0.9 or to 0. How will this change the animation?
Thanks
The numbers 9 and 10 here are glTF accessor index ID values. If you decode accessor index 9, you'll find the list of times for each of the keyframes of the animation. If you decode accessor 10, normally you would expect to find the list of values for the keyframes. But since this is CUBICSPLINE, accessor 10 will contain the in-tangent, value, and out-tangent for each keyframe.
One way to investigate glTF files like this is to use the glTF Tools extension for VSCode. You can right-click the input or output value and choose Go To Definition to get to the accessor in question, and choose Go To Definition again to decode it. (Disclaimer, I'm a contributor to glTF Tools).

i want to fetch product_description but it contain html so i m getting confuse that how to get proper format from it

JSON:
{ "wishlist": [ { "wishlist": 0 } ], "cart": [ { "cart": 1 } ], "product": [ { "promo_id": 0, "avals": 0, "dis": null, "mp_product_id": 252, "mp_category_id": 113, "product_name": "Pink Soft Net Fabric Kids Angel Lehenga Choli", "product_description": "
This Pink Coloured Traditional Soft Net Fabric Lehenga Choli gives a beautifull look to your child. This Outfit come with Brocket Fabric Lehenga and Top has Soft Net Fabric with Silk Lining come along with Soft Net Dupatta .\r\n\r\n
You can make your kids wear this outfit for parties and functions.\r\n\r\n
Type :\r\n\r\n
*Semi-Stitched*\r\n\r\n
FABRIC :\r\n\r\n
Top : Unstitched Designer Brocade fabric
\r\nBottom : stitched Soft Net fabric
\r\nDupatta : Soft Net fabric
\r\nInner : Silk fabric\r\n\r\n
Size Chart :\r\n\r\n
1 to 5 year : 30 inches
\r\n6 to 8 year : 32 inches
\r\n9 to 10 year : 34 inches
\r\n10 to 15 year: 36 inches\r\n\r\n
Care
\r\nDry Clean\r\n", "sku_number": "Angel_3_Pink", "qty": 25, "likes_count": 0, "list_price": 2082, "selling_price": 1249, "discount": 41 } ], "image": [ { "image_name": "Sweet Angel Vol3-Pink.jpg" } ], "variant": [ { "Color": "PINK", "Size": "S,M,L,XL", "Occasion": "Party" } ], "related": [ { "mp_product_id": 231, "mp_category_id": 113, "product_name": "White Peacock Kids Indo Western ", "product_description": "
This White Coloured Traditional Banglory Top Fabrics Indo Western gives a beautifull look to your child. This Outfit come with Paper Silk Fabric Lehenga and Top has Banglory Fabric.\r\n\r\n
You can make your kids wear this outfit for parties and functions.\r\n\r\n
Type :\r\n\r\n
*Stitched*\r\n\r\n
FABRIC :\r\n\r\n
Top - Banglory (foam seat work),\r\n\r\n
Lehenga - Paper silk,\r\n\r\n
Size Chart :\r\n\r\n
6 to 12 year : 34 inches\r\n\r\n
Care
\r\nDry Clean\r\n", "product_image": "", "seller_product_code": "White_Peacock", "system_product_code": 0, "sku_number": "White_Peacock", "status": "A", "is_features": 0, "list_price": 2271, "selling_price": 1249, "qty": 25, "weight": "700", "cod_charge": "0", "shipping_charge": "0", "likes_count": 0, "create_date": "2017-06-26 12:38:51", "modify_date": "2017-06-26 12:39:37", "main_order": 14, "set_order": 0, "image_name": "Peacock White Kids \u00a0--- CKL 216 --- Rs. 625.jpg" }
Yes you are doing the same thing, but your code is prone to crashes as you are forcefully trying to unwrap optionals. Try this instead
Alamofire.request(APIProductDetail, method: .get, parameters: params, encoding: URLEncoding.default, headers: nil).responseJSON { (response) in
switch response.result {
case .success(let responseResultValue):
if let responseResult = responseResultValue as? [String:Any] {
if let productsList = responseResult["product"] as? [[String:Any]] {
for product in productsList {
if let productDescription = product["product_description"] as? String {
print(productDescription) //Here you will get the product description
}
}
}
}
case .failure(let error):
//handle any error here
print(error.localizedDescription)
}
}

Docker API: cpu_stats vs percpu_stats

What is the difference between
cpu_stats and percpu_stats when using Docker remote API:
The request is :
GET /containers/(id or name)/stats
(A part of) The response is:
"cpu_stats" : {
"cpu_usage" : {
"percpu_usage" : [
8646879,
24472255,
36438778,
30657443
],
"usage_in_usermode" : 50000000,
"total_usage" : 100215355,
"usage_in_kernelmode" : 30000000
},
"system_cpu_usage" : 739306590000000,
"throttling_data" : {"periods":0,"throttled_periods":0,"throttled_time":0}
},
"precpu_stats" : {
"cpu_usage" : {
"percpu_usage" : [
8646879,
24350896,
36438778,
30657443
],
"usage_in_usermode" : 50000000,
"total_usage" : 100093996,
"usage_in_kernelmode" : 30000000
},
"system_cpu_usage" : 9492140000000,
"throttling_data" : {"periods":0,"throttled_periods":0,"throttled_time":0}
}
Example taken from Docker docs:
https://docs.docker.com/engine/reference/api/docker_remote_api_v1.24/#get-container-stats-based-on-resource-usage
When testing with a sample container, values are almost the same.
Example of an output:
#Cpu stas
{u'cpu_usage': {u'usage_in_usermode': 0, u'total_usage': 36569630, u'percpu_usage': [8618616, 3086454, 16466404, 8398156], u'usage_in_kernelmode': 20000000}, u'system_cpu_usage': 339324470000000, u'throttling_data': {u'throttled_time': 0, u'periods': 0, u'throttled_periods': 0}}
#Per cup stats
{u'cpu_usage': {u'usage_in_usermode': 0, u'total_usage': 36569630, u'percpu_usage': [8618616, 3086454, 16466404, 8398156], u'usage_in_kernelmode': 20000000}, u'system_cpu_usage': 339320550000000, u'throttling_data': {u'throttled_time': 0, u'periods': 0, u'throttled_periods': 0}}
I tried also to compare specific metrics in the two case for 4 containers:
#First container
359727340000000 #CPU Stats
359723390000000 #Per CPU Stats
#2
359735220000000
359731290000000
#3
359743100000000
359739170000000
#4
359750940000000
359747000000000
The values above are almost same (some differences but not huge - may be because there are some ms between each request.)
In the official documentation:
The precpu_stats is the cpu statistic of last read, which is used for
calculating the cpu usage percent. It is not the exact copy of the
“cpu_stats” field.
Not very clear for me.
Anyone could explain better ?

Neo4j Spatial server error 500 when adding nodes to layer

I am using the Spatial plugin for Neo4j 2.2.2 and have managed to create a spatial index by following the guide http://neo4j-contrib.github.io/spatial/#spatial-layers.
:POST http://localhost:7475/db/data/ext/SpatialPlugin/graphdb/addSimplePointLayer
{
"layer" : "geom",
"lat" : "lat",
"lon" : "lon"
}
:POST http://localhost:7474/db/data/index/node/
{
"name" : "geom",
"config" : {
"provider" : "spatial",
"geometry_type" : "point",
"lat" : "lat",
"lon" : "lon"
}
}
I have pre-existing unconnected nodes with multiple labels 'DB_2' and 'Address' and properties 'name', 'lon' and 'lat', when I try to add these nodes to the spatial index I get an error but if I create a node without any labels and just 'lon' and 'lat' properties it seems to work without any errors.
:POST http://localhost:7474/db/data/ext/SpatialPlugin/graphdb/addNodeToLayer
{
"layer" : "geom",
"node" : "http://localhost:7474/db/data/node/{id}"
}
500 Internal Server Error
==> {
==> "message" : "Error adding nodes to layer geom",
==> "exception" : "RuntimeException",
==> "fullname" : "java.lang.RuntimeException",
==> "stackTrace" : [ "org.neo4j.gis.spatial.server.plugin.SpatialPlugin.addNodeToLayer(SpatialPlugin. java:108)","java.lang.reflect.Method.invoke(Method.java:483)", "org.neo4j.server.plugins.PluginMethod.invoke(PluginMethod.java:61)","org.neo4j.server.plugins.PluginManager.invoke(PluginManager.java:158)", "org.neo4j.server.rest.web.ExtensionService.invokeGraphDatabaseExtension(ExtensionService.java:312)","org.neo4j.server.rest.web.ExtensionService.invokeGraphDatabaseExtension(ExtensionService.java:134)","java.lang.reflect.Method.invoke(Method.java:483)","org.neo4j.server.rest.transactional.TransactionalRequestDispatcher.dispatch(TransactionalRequestDispatcher.java:139)","org.neo4j.server.rest.dbms.AuthorizationFilter.doFilter(AuthorizationFilter.java:120)","java.lang.Thread.run(Thread.java:745)" ],
==> "cause" : {
==> "exception" : "ClassCastException",
==> "fullname" : "java.lang.ClassCastException",
==> "stackTrace" : [ "org.neo4j.gis.spatial.encoders.SimplePointEncoder.decodeGeometry(SimplePointEncoder.java:63)", " "org.neo4j.gis.spatial.DefaultLayer.add(DefaultLayer.java:77)", "org.neo4j.gis.spatial.server.plugin.SpatialPlugin.addNodeToLayer(SpatialPlugin.java:102)", "java.lang.reflect.Method.invoke(Method.java:483)", "org.neo4j.server.plugins.PluginMethod.invoke(PluginMethod.java:61)", "org.neo4j.server.plugins.PluginManager.invoke(PluginManager.java:158)", "org.neo4j.server.rest.web.ExtensionService.invokeGraphDatabaseExtension(ExtensionService.java:312)", "org.neo4j.server.rest.web.ExtensionService.invokeGraphDatabaseExtension(ExtensionService.java:134)", "java.lang.reflect.Method.invoke(Method.java:483)", "org.neo4j.server.rest.transactional.TransactionalRequestDispatcher.dispatch(TransactionalRequestDispatcher.java:139)", "org.neo4j.server.rest.dbms.AuthorizationFilter.doFilter(AuthorizationFilter.java:120)", "java.lang.Thread.run(Thread.java:745)" ],
==> "message" : "java.lang.String cannot be cast to java.lang.Number",
==> "errors" : [ {
==> "code" : "Neo.DatabaseError.General.UnknownFailure",
==> "stackTrace" : "java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Number\r\n\tat org.neo4j.gis.spatial.encoders.SimplePointEncoder.decodeGeometry(SimplePointEncoder.java:63)\r\n\tat org.neo4j.gis.spatial.DefaultLayer.add(DefaultLayer.java:77)\r\n\tat org.neo4j.gis.spatial.server.plugin.SpatialPlugin.addNodeToLayer(SpatialPlugin.java:102)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:483)\r\n\tat org.neo4j.server.plugins.PluginMethod.invoke(PluginMethod.java:61)\r\n\tat org.neo4j.server.plugins.PluginManager.invoke(PluginManager.java:158)\r\n\tat org.neo4j.server.rest.web.ExtensionService.invokeGraphDatabaseExtension(ExtensionService.java:312)\r\n\tat org.neo4j.server.rest.web.ExtensionService.invokeGraphDatabaseExtension(ExtensionService.java:134)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:483)\r\n\tat com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)\r\n\tat com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)\r\n\tat com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)\r\n\tat org.neo4j.server.rest.transactional.TransactionalRequestDispatcher.dispatch(TransactionalRequestDispatcher.java:139)\r\n\tat com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)\r\n\tat com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)\r\n\tat com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)\r\n\tat com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)\r\n\tat com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)\r\n\tat com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1542)\r\n\tat com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1473)\r\n\tat com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419)\r\n\tat com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409)\r\n\tat com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409)\r\n\tat com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:540)\r\n\tat com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:715)\r\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:790)\r\n\tat org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:800)\r\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)\r\n\tat org.neo4j.server.rest.dbms.AuthorizationFilter.doFilter(AuthorizationFilter.java:120)\r\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)\r\n\tat org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)\r\n\tat org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221)\r\n\tat org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1125)\r\n\tat org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)\r\n\tat org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)\r\n\tat org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1059)\r\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)\r\n\tat org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)\r\n\tat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)\r\n\tat org.eclipse.jetty.server.Server.handle(Server.java:497)\r\n\tat org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)\r\n\tat org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:248)\r\n\tat org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)\r\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:620)\r\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:540)\r\n\tat java.lang.Thread.run(Thread.java:745)\r\n",
==> "message" : "java.lang.String cannot be cast to java.lang.Number"
==> } ]
==> },
==> "errors" : [ {
==> "code" : "Neo.DatabaseError.General.UnknownFailure",
==> "stackTrace" : "java.lang.RuntimeException: Error adding nodes to layer geom\r\n\tat org.neo4j.gis.spatial.server.plugin.SpatialPlugin.addNodeToLayer(SpatialPlugin.java:108)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:483)\r\n\tat org.neo4j.server.plugins.PluginMethod.invoke(PluginMethod.java:61)\r\n\tat org.neo4j.server.plugins.PluginManager.invoke(PluginManager.java:158)\r\n\tat org.neo4j.server.rest.web.ExtensionService.invokeGraphDatabaseExtension(ExtensionService.java:312)\r\n\tat org.neo4j.server.rest.web.ExtensionService.invokeGraphDatabaseExtension(ExtensionService.java:134)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:483)\r\n\tat com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)\r\n\tat com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)\r\n\tat com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)\r\n\tat org.neo4j.server.rest.transactional.TransactionalRequestDispatcher.dispatch(TransactionalRequestDispatcher.java:139)\r\n\tat com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)\r\n\tat com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)\r\n\tat com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)\r\n\tat com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)\r\n\tat com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)\r\n\tat com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1542)\r\n\tat com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1473)\r\n\tat com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419)\r\n\tat com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409)\r\n\tat com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409)\r\n\tat com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:540)\r\n\tat com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:715)\r\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:790)\r\n\tat org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:800)\r\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)\r\n\tat org.neo4j.server.rest.dbms.AuthorizationFilter.doFilter(AuthorizationFilter.java:120)\r\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)\r\n\tat org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)\r\n\tat org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221)\r\n\tat org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1125)\r\n\tat org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)\r\n\tat org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)\r\n\tat org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1059)\r\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)\r\n\tat org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)\r\n\tat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)\r\n\tat org.eclipse.jetty.server.Server.handle(Server.java:497)\r\n\tat org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)\r\n\tat org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:248)\r\n\tat org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)\r\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:620)\r\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:540)\r\n\tat java.lang.Thread.run(Thread.java:745)\r\nCaused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Number\r\n\tat org.neo4j.gis.spatial.encoders.SimplePointEncoder.decodeGeometry(SimplePointEncoder.java:63)\r\n\tat org.neo4j.gis.spatial.DefaultLayer.add(DefaultLayer.java:77)\r\n\tat org.neo4j.gis.spatial.server.plugin.SpatialPlugin.addNodeToLayer(SpatialPlugin.java:102)\r\n\t... 49 more\r\n",
==> "message" : "Error adding nodes to layer geom"
==> } ]
==> }
I not sure if it has anything to do with my node labels or properties as I can't find any indication from the guide or other examples suggesting that this could be a problem.
Thanks for any help in advance!

Resources