Comments (13)
I'm running a next app with the built in api. So single threaded AFAIK.
In terms of how I was using arrays, I was setting the whole array at once, overwriting when updating.
path is like /image/7ddb9f615c2d9947be799b99d17ed59b11c61959
await acebaseFix.ref(path).set(images)
// Update via overwrite
await acebaseFix.ref(path).set(newImages)
// Create from scratch
await acebaseFix.ref(path).remove()
// Delete
Oh, the image array members are structured...
export interface Image {
width: number;
height: number;
img: string;
original: string;
url: string;
cat?: string;
}
I'll give object collections a try, but I think the use case is fine, as I wasn't mutating or changing the array.
Thanks for getting back quickly!
from acebase.
Also, I noticed that my Acebase server script crashed when I was trying to navigate to the node: items/0/3/16766808/item_data on Acebase Web Manager.
from acebase.
Thanks for reporting this. The best and quickest way for me to investigate this issue is having access to the actual data. If you can send me a copy of the data.db file through wetransfer.com, I will be able to poke into the binary data and see what's wrong and what might have caused it. You can send it to [email protected]
Note that if your data contains personal and/or sensitive data, please create a copy of the db and anonymize your data as much as possible before sending. I will treat your data confidentially and will remove all copies from my system when done!
from acebase.
Can you please reply
from acebase.
I'm closing this issue. If you would like this fixed @jkapenieks, please reply. For anyone else running into this issue, please also let me know.
from acebase.
Hi. I've ran into this as well. One of my paths refuses to read, which means I can't update or remove it.
Is there anyway to nuke it from orbit without reading it, or to read it and ignore errors
I can send you the database file, but at the moment, I'm just trying to recover my data from the last time I backed up.
from acebase.
Tried... await acebaseLocal.ref('/image/7ddb9f615c2d9947be799b99d17ed59b11c61959[1]').set({})
GetTypeError: Unknown chunk type 112 while reading record at "/image/7ddb9f615c2d9947be799b99d17ed59b11c61959[1]" @51,340
I've also tried set([])
to the key directly, and also remove
from acebase.
@neilsutcliffe Thanks for reporting this.
Are you running AceBase in a multi-process/threaded setup?
Also, I see you are directly updating an array entry, which is discouraged because of reasons described here: Using arrays. In most situations, it's better to use object collections.
I'll add a function to overwrite records today, so you will be able to fix this broken record.
from acebase.
I've published version 1.22.2,which now supports node recovery. See #142 for more info
Let me know if that works.
Also, if you are sure you are not auto-scaling your app in the cloud, let me know if you find a reproducible way to "break" a node!
from acebase.
Closing the issue again, feel free to reopen if this is still an issue!
from acebase.
Hi. I keep on getting a different issue, but still general corruption. I'm having to back up my database any time I change it. Might look into collections, but I am not doing complex things with arrays...
Either way, I end up corrupting the database when working with Next.js. It could be the hot-reloading is creating multiple connections to the database, which causes this issue.
CorruptRecordError: CORRUPT RECORD: key "img" in "/image/77f9d37ee3c03f1d702a20b11e08cee22210ae5f[0]" (@22,369) refers to address @22,323 which was already used to read "/image/2ffeb7f6c7b5ca0606af6178a7009fb08d69ac4d". Recursive or repeated reading has been prevented.
at new NodeReader (admin/node_modules/acebase/src/storage-acebase.js:2340:27)
at loadChildValue (admin/node_modules/acebase/src/storage-acebase.js:2583:40) {
record: [NodeAddress],
key: 'img'
}
img in this case is a URL
I've taken to storing different tables in different databases allowing me to revert only one if needed.
from acebase.
@neilsutcliffe You have to prevent multiple concurrent AceBase
instances to the same database to prevent corruption. Reuse 1 single AceBase
instance throughout your app to prevent this. Hot reloading should not be an issue, but having 2+ separate instances in your code both altering the same database will corrupt the db.
from acebase.
@neilsutcliffe You have to prevent multiple concurrent
AceBase
instances to the same database to prevent corruption. Reuse 1 singleAceBase
instance throughout your app to prevent this. Hot reloading should not be an issue, but having 2+ separate instances in your code both altering the same database will corrupt the db.
It's 2 seperate instances with 2 different database files.
However it is reinitialising on hot reloading...
I think I might have to look more into how next.js does this and determines what to recompile. There has to be mechanisms to prevent it from rebuilding.
from acebase.
Related Issues (20)
- pm2 cluster detection HOT 1
- import {} does not work with this package. HOT 3
- Getting feature not supported error when attempting to run in Electron app HOT 5
- When using "mutations" with a subscription it's throwing a warning HOT 5
- Unhandled Error but when i restarted the db the errors gone HOT 10
- Special chars in path corrupt data HOT 1
- Browser Acebase broke after last update HOT 2
- Schema validation fails for updates on higher path HOT 1
- Can't import { AceBase } with moduleResolution="nodenext" in tsconfig.json HOT 1
- Multiple TypeScript errors when using package acebase HOT 3
- Live query and indexing HOT 8
- `ref().get()` works while `query().get()` returns an empty array HOT 1
- Removing a large dataset throws RangeError HOT 1
- filter on nested data and IN operator for string type
- TypeError when trying to add new records after removing old ones HOT 1
- Any plan yo add Dart/Flutter support
- Error: DEV: Applied tree fixes did not change 88 pending operation(s) failing to execute HOT 1
- MySQL back-end & sync HOT 1
- Python Client or RESTful APIs?
- IPC mode 'socket' fails for new database & paths with spaces
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from acebase.