Archive

Posts Tagged ‘Database’

Fix: Windows Update 0x8e5e03fa, 0x800703fa errors

Sometime ago, I was receiving errors 0x8e5e03fa and 0x800703fa on several pending updates at Windows 10’s Update pane (found at Settings / Updates & Security / Windows Update from the Start menu).

Στιγμιότυπο οθόνης (692)

The updates history wasn’t showing many more details, but could see Knowldege Base article numbers (KBxx) for some pending cummulative updates.

Στιγμιότυπο οθόνης (700)

Trying to update some graphics drivers from the Device Manager (can access that by right clicking the Start menu button and selecting “Device Manager” from the popup menu shown on Windows 10), by right-clicking respective devices and selecting to update their drivers, was also failing.

Στιγμιότυπο οθόνης (688)

Στιγμιότυπο οθόνης (691)

So it did look like a systematic issue, not some issue with some specific update item.

Looked up the error code 0x8e5e03fa via Google and found this article mentioning a JET (database engine) error. That’s the same engine used in Access if I remember well, interesting that it’s getting used by Windows Update too (probably to maintain some private database).

Στιγμιότυπο οθόνης (698)

The suggested fix didn’t work since the file mentioned in that article was not existing, but at that folder (%windir%\system32\catroot2) I found a dberr.txt file that obviously was holding some error log.

Στιγμιότυπο οθόνης (694)

Printing out that file (can use TYPE dberr.txt | more to wait after each “page”), I couldn’t help but notice that it was writing JET error all over it.

Στιγμιότυπο οθόνης (693)

I renamed that file (think it was then recreated again automatically) and also renamed the two folders there (using the move command – e.g. can type move, press TAB till the name of the folder appears and then add a minus sign and press TAB again till the same folder name appears and press ENTER). Did that while having the cryptsvc service stopped (using net stop cryptsvc command) as that article suggested. Then started the service again (using net start cryptsvc). 

Στιγμιότυπο οθόνης (696)

After doing this, all failing updates (some extra driver updates had been found using DriverBooster, but were also failing to install) eventually installed fine and Windows 10 started bringing more updates:

Στιγμιότυπο οθόνης (699)

Advertisements

HowTo: Delete all nodes and relationships from Neo4j graph database

At a Neo4j question in http://stackoverflow.com/questions/19624414/delete-node-and-relationships-using-cypher-query-over-rest-api, a recent reply (older ones use obsolete Cypher syntax) says:

Both START and the [r?] syntax are being phased out. It’s also usually not advised to directly use internal ids. Try something like:

match (n{some_field:"some_val"})
optional match (n)-[r]-()
delete n,r

So, to delete all nodes (including disconnected ones) and their relationships you could do:
MATCH (n) OPTIONAL MATCH (n)-[r]-() DELETE n,r
(nice that it works in a single line too)

However since we delete ALL nodes and relationships, this one looks cleaner:
MATCH (n), ()-[r]-() DELETE n,r

 

Update #1

Michael Hunger kindly commented below on this last query:

In your last query you create a huge cross product.
All nodes times all relationships.

Probably cleaner then to split it into two, delete rels first then nodes

Indeed, using PROFILE before the query it seems to do more work from a quick look (hoped it would be a bit more clever to optimize this, but maybe I’m asking too much). So probably should change it to two queries:

MATCH ()-[r]-() DELETE r

and

MATCH (n) DELETE n

 

Update #2

For deleting really big graphs, checkout an answer by Stefan Armbruster on how to delete in an iterative way at

http://stackoverflow.com/questions/29711757/best-way-to-delete-all-nodes-and-relationships-in-cypher/29715865

…the most easy way is to stop Neo4j, drop the data/graph.db folder and restart it.

Deleting a large graph via Cypher will be always slower but still doable if you use a proper transaction size to prevent memory issues (remember transaction are built up in memory first before they get committed). Typically 50-100k atomic operations is a good idea. You can add a limit to your deletion statement to control tx sizes and report back how many nodes have been deleted. Rerun this statement until a value of 0 is returned back:

MATCH (n)
OPTIONAL MATCH (n)-[r]-()
WITH n,r LIMIT 50000
DELETE n,r
RETURN count(n) as deletedNodesCount
%d bloggers like this: