Quantcast

regenerate fails

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

regenerate fails

Eduard Drenth
Dear all,

I am having a hard time experimenting with odd in a teipublisher app.

One problem in particular now blocks me. When I "recompile ODD" I get this error:

Error for output mode web

Invalid argument to fn:doc or fn:doc-available. exerr:ERROR Document /db/apps/tdb/resources/odd/teipublisher.odd is a binary resource, not an XML document. Please consider using the function util:binary-doc() to retrieve a reference to it.

No idea what to do with this, I can read/write the odd with no problem. Any idea's / hints?

Eduard Drenth, Software Architekt

[hidden email]

Doelestrjitte 8
8911 DX  Ljouwert
+31 58 234 30 47

gpg: https://sks-keyservers.net/pks/lookup?op=get&search=0x065EF82A1E02CC43

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: regenerate fails

Jonathan Rowell

Yes, I had the same problem. You have to use doc-avaiable() for XML resources and binany-doc-available() for the others.


Jonathan




From: Eduard Drenth <[hidden email]>
Sent: Monday, March 27, 2017 11:02 AM
To: [hidden email]
Subject: [Exist-open] regenerate fails
 
Dear all,

I am having a hard time experimenting with odd in a teipublisher app.

One problem in particular now blocks me. When I "recompile ODD" I get this error:

Error for output mode web

Invalid argument to fn:doc or fn:doc-available. exerr:ERROR Document /db/apps/tdb/resources/odd/teipublisher.odd is a binary resource, not an XML document. Please consider using the function util:binary-doc() to retrieve a reference to it.

No idea what to do with this, I can read/write the odd with no problem. Any idea's / hints?

Eduard Drenth, Software Architekt

[hidden email]

Doelestrjitte 8
8911 DX  Ljouwert
+31 58 234 30 47

gpg: https://sks-keyservers.net/pks/lookup?op=get&search=0x065EF82A1E02CC43

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: regenerate fails

Eduard Drenth

ok, thanks, so what do I do? I change one of the .xql files in my app? Which one?


Shouldn't this just work? Perhaps it should be registered as a bug in gitlab?


Eduard Drenth, Software Architekt


[hidden email]


Doelestrjitte 8

8911 DX  Ljouwert

+31 58 234 30 47


gpg: https://sks-keyservers.net/pks/lookup?op=get&search=0x065EF82A1E02CC43




From: Jonathan Rowell <[hidden email]>
Sent: Monday, March 27, 2017 1:20 PM
To: Eduard Drenth; [hidden email]
Subject: Re: regenerate fails
 

Yes, I had the same problem. You have to use doc-avaiable() for XML resources and binany-doc-available() for the others.


Jonathan




From: Eduard Drenth <[hidden email]>
Sent: Monday, March 27, 2017 11:02 AM
To: [hidden email]
Subject: [Exist-open] regenerate fails
 
Dear all,

I am having a hard time experimenting with odd in a teipublisher app.

One problem in particular now blocks me. When I "recompile ODD" I get this error:

Error for output mode web

Invalid argument to fn:doc or fn:doc-available. exerr:ERROR Document /db/apps/tdb/resources/odd/teipublisher.odd is a binary resource, not an XML document. Please consider using the function util:binary-doc() to retrieve a reference to it.

No idea what to do with this, I can read/write the odd with no problem. Any idea's / hints?

Eduard Drenth, Software Architekt

[hidden email]

Doelestrjitte 8
8911 DX  Ljouwert
+31 58 234 30 47

gpg: https://sks-keyservers.net/pks/lookup?op=get&search=0x065EF82A1E02CC43

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: regenerate fails

Jonathan Rowell

Yes, I'm afraid so, you'll have to go through YOUR xql files and change the calls. If they're not your files you'll have to report a bug.


Jonathan



From: Eduard Drenth <[hidden email]>
Sent: Monday, March 27, 2017 11:53 AM
To: Jonathan Rowell; [hidden email]
Subject: Re: regenerate fails
 

ok, thanks, so what do I do? I change one of the .xql files in my app? Which one?


Shouldn't this just work? Perhaps it should be registered as a bug in gitlab?


Eduard Drenth, Software Architekt


[hidden email]


Doelestrjitte 8

8911 DX  Ljouwert

+31 58 234 30 47


gpg: https://sks-keyservers.net/pks/lookup?op=get&search=0x065EF82A1E02CC43




From: Jonathan Rowell <[hidden email]>
Sent: Monday, March 27, 2017 1:20 PM
To: Eduard Drenth; [hidden email]
Subject: Re: regenerate fails
 

Yes, I had the same problem. You have to use doc-avaiable() for XML resources and binany-doc-available() for the others.


Jonathan




From: Eduard Drenth <[hidden email]>
Sent: Monday, March 27, 2017 11:02 AM
To: [hidden email]
Subject: [Exist-open] regenerate fails
 
Dear all,

I am having a hard time experimenting with odd in a teipublisher app.

One problem in particular now blocks me. When I "recompile ODD" I get this error:

Error for output mode web

Invalid argument to fn:doc or fn:doc-available. exerr:ERROR Document /db/apps/tdb/resources/odd/teipublisher.odd is a binary resource, not an XML document. Please consider using the function util:binary-doc() to retrieve a reference to it.

No idea what to do with this, I can read/write the odd with no problem. Any idea's / hints?

Eduard Drenth, Software Architekt

[hidden email]

Doelestrjitte 8
8911 DX  Ljouwert
+31 58 234 30 47

gpg: https://sks-keyservers.net/pks/lookup?op=get&search=0x065EF82A1E02CC43

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: regenerate fails

Joe Wicentowski
In reply to this post by Eduard Drenth
Hi Eduard,

>> Invalid argument to fn:doc or fn:doc-available. exerr:ERROR Document /db/apps/tdb/resources/odd/teipublisher.odd is a binary resource, not an XML document. Please consider using the function util:binary-doc() to retrieve a reference to it.
>
> No idea what to do with this, I can read/write the odd with no problem. Any idea's / hints?

This error indicates that eXist thinks your .odd file is a binary
resource instead of an XML document.  This is unexpected, because as
you'll see at in the $EXIST_HOME/mime-types.xml file, which eXist
consults whenever it is storing a file to determine whether a file is
an XML document or a binary resource and to look up the mime-type,
eXist stores .odd files as XML files, not binary files.  (See
https://github.com/eXist-db/exist/blob/develop/mime-types.xml.tmpl#L22-L26.)
 So if you created your application via the TEI Publisher App
Generator function or subsequently built/installed your application as
an EXPath Package via Dashboard > Package Manager > Upload, eXist will
store all .odd files from your app as XML files, not binary files.

The troubleshooting questions I would ask, then:

0. eXist version?
1. What is the result of
xmldb:get-mime-type(xs:anyURI('/db/apps/tdb/resources/odd/teipublisher.odd'))
2. How (exactly) did you *first* store this .odd file in your database?

To recover from this error, download the file to disk, delete it from
the database, and then re-upload the file. Confirm that
xmldb:get-mime-type() returns "application/xml".

Joe

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: regenerate fails

Eduard Drenth
Thanks for elaborating

0. eXist version? => 3.1.1
1. What is the result of
xmldb:get-mime-type(xs:anyURI('/db/apps/tdb/resources/odd/teipublisher.odd')) => application/xml
2. How (exactly) did you *first* store this .odd file in your database? => through generate app in teipublisher

Then during some days I edited the odd in eXide, in atom, in external editor via webdav, I also played with the "upload selected" function in atom.

Here's how the problem disappeared:

- deleted odd from db in atom
- selected odd directory in db, select odd on filesystem, chose "upload selected" => whole odd directory gone in db!
- mount wedav, copy odd directory to db => recompile works again

I'm not sure what exactly caused the problem, but perhaps it was atom's upload function.

Bye,

Eduard Drenth, Software Architekt

[hidden email]

Doelestrjitte 8
8911 DX  Ljouwert
+31 58 234 30 47

gpg: https://sks-keyservers.net/pks/lookup?op=get&search=0x065EF82A1E02CC43

________________________________________
From: Joe Wicentowski <[hidden email]>
Sent: Monday, March 27, 2017 3:12 PM
To: Eduard Drenth
Cc: [hidden email]
Subject: Re: [Exist-open] regenerate fails

Hi Eduard,

>> Invalid argument to fn:doc or fn:doc-available. exerr:ERROR Document /db/apps/tdb/resources/odd/teipublisher.odd is a binary resource, not an XML document. Please consider using the function util:binary-doc() to retrieve a reference to it.
>
> No idea what to do with this, I can read/write the odd with no problem. Any idea's / hints?

This error indicates that eXist thinks your .odd file is a binary
resource instead of an XML document.  This is unexpected, because as
you'll see at in the $EXIST_HOME/mime-types.xml file, which eXist
consults whenever it is storing a file to determine whether a file is
an XML document or a binary resource and to look up the mime-type,
eXist stores .odd files as XML files, not binary files.  (See
https://github.com/eXist-db/exist/blob/develop/mime-types.xml.tmpl#L22-L26.)
 So if you created your application via the TEI Publisher App
Generator function or subsequently built/installed your application as
an EXPath Package via Dashboard > Package Manager > Upload, eXist will
store all .odd files from your app as XML files, not binary files.

The troubleshooting questions I would ask, then:

0. eXist version?
1. What is the result of
xmldb:get-mime-type(xs:anyURI('/db/apps/tdb/resources/odd/teipublisher.odd'))
2. How (exactly) did you *first* store this .odd file in your database?

To recover from this error, download the file to disk, delete it from
the database, and then re-upload the file. Confirm that
xmldb:get-mime-type() returns "application/xml".

Joe

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: regenerate fails

Eduard Drenth
I can confirm it is atom's upload function!

1 select odd on filesystem
2 select odd folder in db
3 choose upload
4 try to recompile => fails

Eduard Drenth, Software Architekt

[hidden email]

Doelestrjitte 8
8911 DX  Ljouwert
+31 58 234 30 47

gpg: https://sks-keyservers.net/pks/lookup?op=get&search=0x065EF82A1E02CC43

________________________________________
From: Eduard Drenth
Sent: Monday, March 27, 2017 4:29 PM
To: Joe Wicentowski
Cc: [hidden email]
Subject: Re: [Exist-open] regenerate fails

Thanks for elaborating

0. eXist version? => 3.1.1
1. What is the result of
xmldb:get-mime-type(xs:anyURI('/db/apps/tdb/resources/odd/teipublisher.odd')) => application/xml
2. How (exactly) did you *first* store this .odd file in your database? => through generate app in teipublisher

Then during some days I edited the odd in eXide, in atom, in external editor via webdav, I also played with the "upload selected" function in atom.

Here's how the problem disappeared:

- deleted odd from db in atom
- selected odd directory in db, select odd on filesystem, chose "upload selected" => whole odd directory gone in db!
- mount wedav, copy odd directory to db => recompile works again

I'm not sure what exactly caused the problem, but perhaps it was atom's upload function.

Bye,

Eduard Drenth, Software Architekt

[hidden email]

Doelestrjitte 8
8911 DX  Ljouwert
+31 58 234 30 47

gpg: https://sks-keyservers.net/pks/lookup?op=get&search=0x065EF82A1E02CC43

________________________________________
From: Joe Wicentowski <[hidden email]>
Sent: Monday, March 27, 2017 3:12 PM
To: Eduard Drenth
Cc: [hidden email]
Subject: Re: [Exist-open] regenerate fails

Hi Eduard,

>> Invalid argument to fn:doc or fn:doc-available. exerr:ERROR Document /db/apps/tdb/resources/odd/teipublisher.odd is a binary resource, not an XML document. Please consider using the function util:binary-doc() to retrieve a reference to it.
>
> No idea what to do with this, I can read/write the odd with no problem. Any idea's / hints?

This error indicates that eXist thinks your .odd file is a binary
resource instead of an XML document.  This is unexpected, because as
you'll see at in the $EXIST_HOME/mime-types.xml file, which eXist
consults whenever it is storing a file to determine whether a file is
an XML document or a binary resource and to look up the mime-type,
eXist stores .odd files as XML files, not binary files.  (See
https://github.com/eXist-db/exist/blob/develop/mime-types.xml.tmpl#L22-L26.)
 So if you created your application via the TEI Publisher App
Generator function or subsequently built/installed your application as
an EXPath Package via Dashboard > Package Manager > Upload, eXist will
store all .odd files from your app as XML files, not binary files.

The troubleshooting questions I would ask, then:

0. eXist version?
1. What is the result of
xmldb:get-mime-type(xs:anyURI('/db/apps/tdb/resources/odd/teipublisher.odd'))
2. How (exactly) did you *first* store this .odd file in your database?

To recover from this error, download the file to disk, delete it from
the database, and then re-upload the file. Confirm that
xmldb:get-mime-type() returns "application/xml".

Joe

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: regenerate fails

Joe Wicentowski
Hi Eduard,

Great troubleshooting!  I've confirmed your report here.  When I upload an .odd file with the existdb atom package, xmldb:get-mime-type() reports that the file's mimetype is "application/octet-stream".  Looking at the source, the "upload" functions set the content type of all files to "null" [1], which triggers the "save" function [2] to see if the file's mime type is registered [3].  The only file extensions registered here are for XQuery files.  If we add mime types for XML files, using, e.g., the ones defined in lib/watcher.js [4], I bet this will fix the problem.  

Okay, I've confirmed this does fix the problem on my local development copy of existdb-atom, and I've filed an issue [5] and a PR [6] with the fix.

Joe


On Mon, Mar 27, 2017 at 10:34 AM, Eduard Drenth <[hidden email]> wrote:
I can confirm it is atom's upload function!

1 select odd on filesystem
2 select odd folder in db
3 choose upload
4 try to recompile => fails

Eduard Drenth, Software Architekt

[hidden email]

Doelestrjitte 8
8911 DX  Ljouwert
+31 58 234 30 47

gpg: https://sks-keyservers.net/pks/lookup?op=get&search=0x065EF82A1E02CC43

________________________________________
From: Eduard Drenth
Sent: Monday, March 27, 2017 4:29 PM
To: Joe Wicentowski
Cc: [hidden email]
Subject: Re: [Exist-open] regenerate fails

Thanks for elaborating

0. eXist version? => 3.1.1
1. What is the result of
xmldb:get-mime-type(xs:anyURI('/db/apps/tdb/resources/odd/teipublisher.odd')) => application/xml
2. How (exactly) did you *first* store this .odd file in your database? => through generate app in teipublisher

Then during some days I edited the odd in eXide, in atom, in external editor via webdav, I also played with the "upload selected" function in atom.

Here's how the problem disappeared:

- deleted odd from db in atom
- selected odd directory in db, select odd on filesystem, chose "upload selected" => whole odd directory gone in db!
- mount wedav, copy odd directory to db => recompile works again

I'm not sure what exactly caused the problem, but perhaps it was atom's upload function.

Bye,

Eduard Drenth, Software Architekt

[hidden email]

Doelestrjitte 8
8911 DX  Ljouwert
+31 58 234 30 47

gpg: https://sks-keyservers.net/pks/lookup?op=get&search=0x065EF82A1E02CC43

________________________________________
From: Joe Wicentowski <[hidden email]>
Sent: Monday, March 27, 2017 3:12 PM
To: Eduard Drenth
Cc: [hidden email]
Subject: Re: [Exist-open] regenerate fails

Hi Eduard,

>> Invalid argument to fn:doc or fn:doc-available. exerr:ERROR Document /db/apps/tdb/resources/odd/teipublisher.odd is a binary resource, not an XML document. Please consider using the function util:binary-doc() to retrieve a reference to it.
>
> No idea what to do with this, I can read/write the odd with no problem. Any idea's / hints?

This error indicates that eXist thinks your .odd file is a binary
resource instead of an XML document.  This is unexpected, because as
you'll see at in the $EXIST_HOME/mime-types.xml file, which eXist
consults whenever it is storing a file to determine whether a file is
an XML document or a binary resource and to look up the mime-type,
eXist stores .odd files as XML files, not binary files.  (See
https://github.com/eXist-db/exist/blob/develop/mime-types.xml.tmpl#L22-L26.)
 So if you created your application via the TEI Publisher App
Generator function or subsequently built/installed your application as
an EXPath Package via Dashboard > Package Manager > Upload, eXist will
store all .odd files from your app as XML files, not binary files.

The troubleshooting questions I would ask, then:

0. eXist version?
1. What is the result of
xmldb:get-mime-type(xs:anyURI('/db/apps/tdb/resources/odd/teipublisher.odd'))
2. How (exactly) did you *first* store this .odd file in your database?

To recover from this error, download the file to disk, delete it from
the database, and then re-upload the file. Confirm that
xmldb:get-mime-type() returns "application/xml".

Joe


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Loading...