Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

application download from exide #1587

Closed
PietroLiuzzo opened this issue Oct 13, 2017 · 8 comments
Closed

application download from exide #1587

PietroLiuzzo opened this issue Oct 13, 2017 · 8 comments
Assignees
Milestone

Comments

@PietroLiuzzo
Copy link

PietroLiuzzo commented Oct 13, 2017

What is the problem

I used application/download in eXide to get the xar of my app. I then deleted the app and added it back. the package manager reports an error in repo.xml.
I have decompressed the xar and in repo.xml I have this
<permissions xmlns:repo="http://exist-db.org/xquery/repo" user="Pietro" group="dba" mode="rw-rw-r--" unknown="http://exist-db.org/xquery/repo" #unknown="http://exist-db.org/xquery/repo"/>

removing the package so added is also a problem, and the package manager reports

Package not found. Failed to remove package from database due to error in repo.xml: Failed to parse repo.xml: exerr:ERROR Error while parsing XML: Element type "permissions" must be followed by either attribute specifications, ">" or "/>".

I have tried to remove the package manually from

What did you expect

to upload smoothly the downloaded package, to be able also to remove it smoothly.

Describe how to reproduce or add a test

I am not sure this happens with all apps. it happens with all those in my exist installation. also if I install from the package repository the shakes app, dowload it as described and then try to upload it from that package.
I have also tried to rebuild the package with ant, removing #unknown="http://exist-db.org/xquery/repo" from permissions in repo.xml. The same happens with the package thus created.

Context information

Please always add the following information

  • eXist-db version 3.5.0 (latest official release)
  • Java version Java(TM) SE Runtime Environment (build 1.8.0_73-b02
  • Operating system (MacOs)
@duncdrum
Copy link
Contributor

Hello Pietro, is your pre- or post-install.xql doing something to set permission? that would explain why a cleaned-up repo.xml gets overwritten on install

@PietroLiuzzo
Copy link
Author

I never opened those files at all...

@PietroLiuzzo
Copy link
Author

post-install I never had one there.

@duncdrum
Copy link
Contributor

I still don't understand if your pre-install.xql includes any functions that try to set-up permissions for your app. But your problem might be related to this ticket #1573, which contains a work around.

@PietroLiuzzo
Copy link
Author

it should not, I have done nothing to alter that file since it has been created by the application for me.

xquery version "1.0";

import module namespace xdb="http://exist-db.org/xquery/xmldb";

(: The following external variables are set by the repo:deploy function :)

(: file path pointing to the exist installation directory :)
declare variable $home external;
(: path to the directory containing the unpacked .xar package :)
declare variable $dir external;
(: the target collection into which the app is deployed :)
declare variable $target external;

declare function local:mkcol-recursive($collection, $components) {
    if (exists($components)) then
        let $newColl := concat($collection, "/", $components[1])
        return (
            xdb:create-collection($collection, $components[1]),
            local:mkcol-recursive($newColl, subsequence($components, 2))
        )
    else
        ()
};

(: Helper function to recursively create a collection hierarchy. :)
declare function local:mkcol($collection, $path) {
    local:mkcol-recursive($collection, tokenize($path, "/"))
};

(: store the collection configuration :)
local:mkcol("/db/system/config", $target),
xdb:store-files-from-pattern(concat("/system/config", $target), $dir, "*.xconf")

@duncdrum
Copy link
Contributor

Ok so somewhere outside of pre and post install is trying to set permissions

<permissions xmlns:repo="http://exist-db.org/xquery/repo" user="Pietro" group="dba" mode="rw-rw-r--" unknown="http://exist-db.org/xquery/repo" #unknown="http://exist-db.org/xquery/repo"/>

The problem is that I can't reproduce the errors. I tried to generate a new app, with app-user permissions set via exide, download the xar, and then uninstall and redeploy. No errors, no superfluous namespaces before or after. Could it be that there is a rogue post- or pre-install file somewhere in the collection hierarchy that is trying to write the permissions into the repo?

You can try to deploy the app in your instance if you wish. (its just an empty app template)
user and pw is simply tester to see if it generates similar errors.

@adamretter
Copy link
Member

@PietroLiuzzo @duncdrum is this still an open issue?

@adamretter adamretter modified the milestones: eXist-3.7.0, eXist-4.0.1 Feb 14, 2018
@PietroLiuzzo
Copy link
Author

no, with 3.6.1 I do not have this issue anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants