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

Enonic dump operations do not work on remote hosts #287

Open
gbbirkisson opened this issue Apr 21, 2021 · 3 comments
Open

Enonic dump operations do not work on remote hosts #287

gbbirkisson opened this issue Apr 21, 2021 · 3 comments
Assignees
Labels
To Be Discussed Should be discussed with a group

Comments

@gbbirkisson
Copy link
Contributor

It tries to read some local directories that are not present instead of calling the remote XP server.

$ enonic dump ls
Error reading dumps folder: open data/dump: no such file or directory
@alansemenov
Copy link
Member

@gbbirkisson You have set environment variables, right?

@gbbirkisson
Copy link
Contributor Author

Yes I have.

All dump operations use this function ensureNameFlag:

func ensureNameFlag(name string, mustNotExist, force bool) string {
existingDumps := listExistingDumpNames()

And that function never calls the remote server:

func listExistingDumpNames() []string {
homePath := sandbox.GetActiveHomePath()
dumpsDir := filepath.Join(homePath, "data", "dump")
dumps, err := ioutil.ReadDir(dumpsDir)
if err != nil {
util.Warn(err, "Error reading dumps folder:")
return []string{}
}
dumpNames := make([]string, len(dumps))
for i, dump := range dumps {
dumpNames[i] = dump.Name()
}
return dumpNames
}

@pmi
Copy link
Member

pmi commented May 28, 2021

It tries to read some local directories that are not present instead of calling the remote XP server.

$ enonic dump ls
Error reading dumps folder: open data/dump: no such file or directory

XP remote API simply does not have list command cuz there is no way for it can list local dump files.
So CLI is just being clever and just scans the local folder for previous dumps.

@alansemenov alansemenov added the To Be Discussed Should be discussed with a group label Jun 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
To Be Discussed Should be discussed with a group
Projects
None yet
Development

No branches or pull requests

3 participants