eXist-db / xst

Command line tool to interact with exist-db instances
https://npmjs.com/@existdb/xst
MIT License
17 stars 4 forks source link

[BUG] XST download not possible #50

Closed StephanMa closed 1 year ago

StephanMa commented 1 year ago

To be able to better understand you problem, please add as much information as possible to this ticket. Always test your bugs against the latest stable release of exist. We cannot provide support for older versions here on GitHub. If the version of eXist that is experiencing the issue is more than 1 major version behind the most recent release, please consider posting a question on our mailing list.

Describe the bug I try to download a resource/collection via xst. Unfortunately, I just get the xst splash screen.

Expected behavior Download of the resource

To Reproduce

The best way is to provide an SSCCE (Short, Self Contained, Correct (Compilable), Example). One type of SSCCE could be a small test which reproduces the issue and can be run without dependencies. Please locate the existing test-suite and follow the examples provided there:

xst get /db/apps/stephan/ZZUXMPUX.xml . --config dockerhost

where "dockerhost" is the name of my config file. ls of collections works well... so I can confirm that my config file is working

Screenshots If applicable, add screenshots to help explain your problem.

Bildschirm­foto 2022-12-20 um 15 49 25

Context (please always complete the following information):

Additional context

line-o commented 1 year ago

Node version would be helpful to know @StephanMa Will have to modify the issue template ;)

StephanMa commented 1 year ago

Ah of cause... Node v19.3.0

line-o commented 1 year ago

I have not tested node 19 yet. :eyes:

line-o commented 1 year ago

works for me Build: eXist-6.1.0-SNAPSHOT (89109f644c19482a0f48f7d47619589ba2f14092) Java: 1.8.0_352 (Azul Systems, Inc.) Node: 19.3.0 OS: Mac OS X 12.6.2 (aarch64)

The behaviour you see is as if xst does not recognise the command at all. :/

line-o commented 1 year ago

@StephanMa would you be able to clone this repo, build xst locally and link it and then run the tests? The detailed instructions are in the development section of the readme

... and there is a leftover in the description it should say:

git clone https://github.com/eXist-db/xst
StephanMa commented 1 year ago

I’ve cloned the exist Repo… Did npm install and afterwards npm link

StephanMa commented 1 year ago

All the other commands seem to run… but not get

line-o commented 1 year ago

What format does your dockerhost config file have?

line-o commented 1 year ago

And what is the output of xst --help?

line-o commented 1 year ago

@StephanMa I just realised that the get command is missing in your screenshot!

StephanMa commented 1 year ago
{
    "connectionOptions": {
        "basic_auth": {
            "user": "admin",
            "pass": ""
        },
        "rejectUnauthorized": false,
        "host": "192.168.178.22",
        "port": 8080,
        "secure": false
    },
    "extensionsort": true,
    "color": true,
    "insert-final-newline": true
}
StephanMa commented 1 year ago

@StephanMa I just realised that the get command is missing in your screenshot!

Na its at the top...

Bildschirm­foto 2022-12-20 um 21 04 39
StephanMa commented 1 year ago

the file does exist... /db/apps/dashboard doesn't work either

line-o commented 1 year ago

It looks like you have an old version of xst installed.

What does xst --version give you?

line-o commented 1 year ago

the expected return of xst --help is

xst

interact with an exist-db instance

Commands:
  xst                                     interact with an exist-db instance                                                                                                                          [default]
  xst execute [<query>] [options]         execute a query in an exist-db instance                                                                                                          [aliases: run, exec]
  xst package <command>                   do something with packages                                                                                                                             [aliases: pkg]
  xst list [options] <collection>         List connection contents                                                                                                                                [aliases: ls]
  xst upload [options] <source> <target>  Upload files and directories to a target collection in exist-db                                                                                         [aliases: up]
  xst remove [options] <paths..>          remove collections and resources                                                                                                           [aliases: rm, delete, del]
  xst get [options] <source> <target>     Download a collection or resources from exist-db                                                                                           [aliases: download, fetch]

Options:
  --version  Show version number                                                                                                                                                                      [boolean]
  --config   configuration to use
  --help     Show help                                                                                                                                                                                [boolean]
StephanMa commented 1 year ago
0.0.0-development

because I build it

StephanMa commented 1 year ago
xst

interact with an exist-db instance

Commands:
  xst                                     interact with an exist-db instance                                      [default]
  xst execute [<query>] [options]         execute a query in an exist-db instance                      [aliases: run, exec]
  xst install [options] <packages..>      Install XAR package                                                  [aliases: i]
  xst list [options] <collection>         List connection contents                                            [aliases: ls]
  xst upload [options] <source> <target>  Upload files and directories to a target collection in exist-db     [aliases: up]

Options:
  --version  Show version number                                                                                  [boolean]
  --config   configuration to use
  --help     Show help                                                                                            [boolean]
line-o commented 1 year ago

But an old version 😄

Try

❯ npm unlink --global @existdb/xst
❯ npm install --global @existdb/xst
line-o commented 1 year ago

or you can also link it again, that's up to you

StephanMa commented 1 year ago

yeah looks better :) Thanks... now I have a different error

Unsupported XML serialization option value:

do you have a clue what's up there?

line-o commented 1 year ago

Since you also use a colored terminal the XST ascii logo should be bright yellow when calling xst without any commands

line-o commented 1 year ago

In your config you have "insert-final-newline": true and that is not supported in any released version of existdb. It will be released with exist 6.1.0.

StephanMa commented 1 year ago

well... thank you :) it worked Will close this issue