BaseX python replace bug

Tuesday, 12 January 2021 · 6 messages · last reply 22 Jan 2021
DK
Daniel Kaplan12 Jan 2021 23:38 #
Hello, I'm experiencing some issue(s) when using BaseX... wanted to report it here, but not sure what information you need. I'm accessing baseX via python. Attached is some code that reproduces it for me. It doesn't seem to occur when I am not manually flushing, and only seems to occur with replace, but not add. How should I proceed? Cheers, Daniel PS: I am using a folder containing all the items in question.
LQ
Liam R. E. Quin13 Jan 2021 01:14 #
Quoted text · Daniel Kaplan · 6 lines
On Tue, 2021-01-12 at 16:38 -0500, Daniel Kaplan wrote: > Hello, > > I'm experiencing some issue(s) when using BaseX... wanted to report > it > here, but not sure what information you need.
Imagine for a moment that it does not happen for anyone else... What exactly goes wrong, in detail? Is there an error message? Are wrong vaues inserted into the database? Do your shoes fall off? Do the files get added into the index? How did you determine that something went wrong? There seems to be a missing double quote in your Python script, could this be your error? And a space in "data/ /BadFileFolder" - try withut having a space in the filename maybe? Liam
-- Liam Quin, https://www.delightfulcomputing.com/ Available for XML/Document/Information Architecture/XSLT/ XSL/XQuery/Web/Text Processing/A11Y training, work & consulting. Barefoot Web-slave, antique illustrations: http://www.fromoldbooks.org
DK
Daniel Kaplan13 Jan 2021 01:27 #
Ah, my bad. That's all relevant questions. I do get an error, an OS "Bad File Descriptor" error. Tracing it up, there's a java "Array out of bounds" error. Notably, the same files can be inserted into a clean database using "ADD", but not "REPLACE". I didn't check if the files get added to an index. I don't believe there's an issue with the paths. I'll modified the paths to preserve private data.. New file provided, and a stack trace file. I demonstrate code that's effectively identical, but the only difference is "ADD" vs "REPLACE", and cache vs not. There issue seems to be the files themselves, not adding from the folder vs not, since adding the folder vs the files directly doesn't change anything that I've noticed. Cheers, Daniel
Quoted text · Liam R. E. Quin · 29 lines
On Tue, Jan 12, 2021 at 6:14 PM Liam R. E. Quin <liam at fromoldbooks.org> wrote: > On Tue, 2021-01-12 at 16:38 -0500, Daniel Kaplan wrote: > > Hello, > > > > I'm experiencing some issue(s) when using BaseX... wanted to report > > it > > here, but not sure what information you need. > > Imagine for a moment that it does not happen for anyone else... > > What exactly goes wrong, in detail? Is there an error message? Are > wrong vaues inserted into the database? Do your shoes fall off? Do the > files get added into the index? How did you determine that something > went wrong? > > There seems to be a missing double quote in your Python script, could > this be your error? And a space in "data/ /BadFileFolder" - try withut > having a space in the filename maybe? > > Liam > > -- > Liam Quin, https://www.delightfulcomputing.com/ > Available for XML/Document/Information Architecture/XSLT/ > XSL/XQuery/Web/Text Processing/A11Y training, work & consulting. > Barefoot Web-slave, antique illustrations: http://www.fromoldbooks.org > >
CG
Christian Grün13 Jan 2021 10:09 #
Hi Daniel, Thanks for writing to the list. Based on your input files, I managed to reproduce the bug via a BaseX command script. It seems to occur if ADDCACHE is enabled, and if a document is replaced in an empty database. I’ve created a new GitHub issues [1], we’ll fix this soon. Until then, and if your input files are not huge, you should be safe if you disable the addcache option. Cheers, Christian [1] https://github.com/BaseXdb/basex/issues/1978
Quoted text · Daniel Kaplan · 46 lines
On Wed, Jan 13, 2021 at 12:27 AM Daniel Kaplan <daniel.z.kaplan at gmail.com> wrote: > > Ah, my bad. That's all relevant questions. > > I do get an error, an OS "Bad File Descriptor" error. Tracing it up, there's a java "Array out of bounds" error. > Notably, the same files can be inserted into a clean database using "ADD", but not "REPLACE". > I didn't check if the files get added to an index. > > I don't believe there's an issue with the paths. I'll modified the paths to preserve private data.. > New file provided, and a stack trace file. > > I demonstrate code that's effectively identical, but the only difference is "ADD" vs "REPLACE", and cache vs not. > > There issue seems to be the files themselves, not adding from the folder vs not, since adding the folder vs the files directly doesn't change anything that I've noticed. > > Cheers, Daniel > > On Tue, Jan 12, 2021 at 6:14 PM Liam R. E. Quin <liam at fromoldbooks.org> wrote: >> >> On Tue, 2021-01-12 at 16:38 -0500, Daniel Kaplan wrote: >> > Hello, >> > >> > I'm experiencing some issue(s) when using BaseX... wanted to report >> > it >> > here, but not sure what information you need. >> >> Imagine for a moment that it does not happen for anyone else... >> >> What exactly goes wrong, in detail? Is there an error message? Are >> wrong vaues inserted into the database? Do your shoes fall off? Do the >> files get added into the index? How did you determine that something >> went wrong? >> >> There seems to be a missing double quote in your Python script, could >> this be your error? And a space in "data/ /BadFileFolder" - try withut >> having a space in the filename maybe? >> >> Liam >> >> -- >> Liam Quin, https://www.delightfulcomputing.com/ >> Available for XML/Document/Information Architecture/XSLT/ >> XSL/XQuery/Web/Text Processing/A11Y training, work & consulting. >> Barefoot Web-slave, antique illustrations: http://www.fromoldbooks.org >>
DK
Daniel Kaplan18 Jan 2021 04:20 #
Awesome, thanks!
Quoted text · Christian Grün · 74 lines
On Wed, Jan 13, 2021, 4:09 AM Christian Grün <christian.gruen at gmail.com> wrote: > Hi Daniel, > > Thanks for writing to the list. Based on your input files, I managed > to reproduce the bug via a BaseX command script. It seems to occur if > ADDCACHE is enabled, and if a document is replaced in an empty > database. > > I’ve created a new GitHub issues [1], we’ll fix this soon. Until then, > and if your input files are not huge, you should be safe if you > disable the addcache option. > > Cheers, > Christian > > [1] https://github.com/BaseXdb/basex/issues/1978 > > > > On Wed, Jan 13, 2021 at 12:27 AM Daniel Kaplan > <daniel.z.kaplan at gmail.com> wrote: > > > > Ah, my bad. That's all relevant questions. > > > > I do get an error, an OS "Bad File Descriptor" error. Tracing it up, > there's a java "Array out of bounds" error. > > Notably, the same files can be inserted into a clean database using > "ADD", but not "REPLACE". > > I didn't check if the files get added to an index. > > > > I don't believe there's an issue with the paths. I'll modified the paths > to preserve private data.. > > New file provided, and a stack trace file. > > > > I demonstrate code that's effectively identical, but the only difference > is "ADD" vs "REPLACE", and cache vs not. > > > > There issue seems to be the files themselves, not adding from the folder > vs not, since adding the folder vs the files directly doesn't change > anything that I've noticed. > > > > Cheers, Daniel > > > > On Tue, Jan 12, 2021 at 6:14 PM Liam R. E. Quin <liam at fromoldbooks.org> > wrote: > >> > >> On Tue, 2021-01-12 at 16:38 -0500, Daniel Kaplan wrote: > >> > Hello, > >> > > >> > I'm experiencing some issue(s) when using BaseX... wanted to report > >> > it > >> > here, but not sure what information you need. > >> > >> Imagine for a moment that it does not happen for anyone else... > >> > >> What exactly goes wrong, in detail? Is there an error message? Are > >> wrong vaues inserted into the database? Do your shoes fall off? Do the > >> files get added into the index? How did you determine that something > >> went wrong? > >> > >> There seems to be a missing double quote in your Python script, could > >> this be your error? And a space in "data/ /BadFileFolder" - try withut > >> having a space in the filename maybe? > >> > >> Liam > >> > >> -- > >> Liam Quin, https://www.delightfulcomputing.com/ > >> Available for XML/Document/Information Architecture/XSLT/ > >> XSL/XQuery/Web/Text Processing/A11Y training, work & consulting. > >> Barefoot Web-slave, antique illustrations: http://www.fromoldbooks.org > >> >
CG
Christian Grünin reply to Daniel Kaplan, 12 Jan 2021, 23:3822 Jan 2021 11:07 #
Thanks for your patience, Daniel, The issue has been resolved. A new snapshot is available [1]. Have fun, Christian [1] https://files.basex.org/releases/latest/
Quoted text · Daniel Kaplan · 17 lines
On Tue, Jan 12, 2021 at 10:38 PM Daniel Kaplan <daniel.z.kaplan at gmail.com> wrote: > > > Hello, > > I'm experiencing some issue(s) when using BaseX... wanted to report it here, but not sure what information you need. > > I'm accessing baseX via python. Attached is some code that reproduces it for me. It doesn't seem to occur when I am not manually flushing, and only seems to occur with replace, but not add. > > How should I proceed? > > Cheers, Daniel > > PS: I am using a folder containing all the items in question. > >

⚡Generated with XQuery