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

Software upload failure #1188

Open
yasushinj opened this issue Jun 20, 2020 · 1 comment
Open

Software upload failure #1188

yasushinj opened this issue Jun 20, 2020 · 1 comment
Assignees

Comments

@yasushinj
Copy link

pushing a file from python client, cytomine core : RestSoftwareController.groovy is failing at the following code. parent directory with softare,id should be tested whether or not directory, if it is not, it should go ahead to make directory and then move to create a file. Currently, it is trying to create file and then checking the parent directory, so it is destined to fail if the directory does not exist upon file creation.

                String sourcePath = software.id+"/"+filename
                File source = new File((grailsApplication.config.cytomine.software.path.softwareSources as String)+"/"+sourcePath)
                if(!source.parentFile.exists()) source.parentFile.mkdir()
                f.transferTo(source) 
@geektortoise geektortoise self-assigned this Jun 26, 2020
@geektortoise
Copy link
Member

Hello,

The File object "source" is only instantiated at the line 2.
In Java, you can create a File object even if the associated path doesn't exists. It will not try to create the file on your filesystem.

So, we check if the parentDirectory exists before creating the file with the line
f.transferTo(source)

However, the softwareSources parameter is not into the bootstrap repository, so its default value is "/data/softwares/code"

I will fix this into the bootstrap repository because it can be the origin of some problems.

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

2 participants