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

Upload: Adding files on dataset create seem to succeed, files are listed but not saved. #3866

Closed
kcondon opened this issue May 30, 2017 · 5 comments

Comments

@kcondon
Copy link
Contributor

kcondon commented May 30, 2017

This issue appeared during development and has not been released. It has been merged into /develop however.

@pdurbin
Copy link
Member

pdurbin commented May 31, 2017

I can confirm this bug as of cb0e38f in the develop branch.

The dataset is created but there is no thumbnail for a jpg file and I'm seeing "Internal Server Error" when I click Download, as shown in the screenshot below. In server.log, on clicking Download, the error says java.io.IOException: Failed to open local file file:///Users/pdurbin/dataverse/files/10.5072/FK2/I9O8AB/15c5ead307a-a2619b2c5d5d.

screen shot 2017-05-31 at 9 24 09 am

screen shot 2017-05-31 at 9 24 22 am

@pdurbin
Copy link
Member

pdurbin commented May 31, 2017

On create, the directory where files are to be stored is not created. In production the directory is something like /usr/local/glassfish4/glassfish/domains/domain1/files/10.5072/FK2/IF3GJB.

The reason the directory is not being created is that this.getIdentifier() is null in the getFileSystemDirectory method of Dataset.java.

Here's how the method looks as of cb0e38f:

    public Path getFileSystemDirectory() {
        Path studyDir = null;

        String filesRootDirectory = System.getProperty("dataverse.files.directory");
        if (filesRootDirectory == null || filesRootDirectory.equals("")) {
            filesRootDirectory = "/tmp/files";
        }

        if (this.getAuthority() != null && this.getIdentifier() != null) {
            studyDir = Paths.get(filesRootDirectory, this.getAuthority(), this.getIdentifier());
        }

        return studyDir;
    }

Here's a link to the code:

studyDir = Paths.get(filesRootDirectory, this.getAuthority(), this.getIdentifier());

@pdurbin
Copy link
Member

pdurbin commented May 31, 2017

I just created pull request #3868 and will move this issue to code review at https://waffle.io/IQSS/dataverse

@djbrooke
Copy link
Contributor

@raprasad - you mentioned in standup you were going to take a look at this.

@sekmiller
Copy link
Contributor

@djbrooke I just looked at it. It looks good. Moving to QA

kcondon added a commit that referenced this issue May 31, 2017
save files permanently in command rather than JSF page #3866
@kcondon kcondon self-assigned this May 31, 2017
@kcondon kcondon closed this as completed May 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants