Question: Error uploading Galaxy file via HTTP
1
gravatar for Inquirer
5 months ago by
Inquirer80
Inquirer80 wrote:

Hi,

In our facility we have a web server that uploads files to Galaxy libraries via HTTP requests in PHP. It has been working for a while, but following an update to the latest version of Galaxy it started returning this error:

Fatal error: Exit code 1 ()
Traceback (most recent call last):
  File "/home/galaxy/galaxy/tools/data_source/upload.py", line 270, in <module>
    __main__()
  File "/home/galaxy/galaxy/tools/data_source/upload.py", line 263, in __main__
    metadata.append(add_file(dataset, registry, output_path))
  File "/home/galaxy/galaxy/tools/data_source/upload.py", line 136, in add_file
    if datatype.dataset_content_needs_grooming(dataset.path):
AttributeError: 'NoneType' object has no attribute 'dataset_content_needs_grooming'

If I comment out this section of the upload.py script, everything proceeds well and the files are usable by Galaxy, but it is not an ideal solution. Besides, those files do not have a known format.

This is the chunk of code that executes the POST request:

$params = array(
    'create_type' => 'file',
    'file_type' => 'auto',
    'dbkey' => '?',
    'folder_id' => $folder_id,
    'filesystem_paths' => $pathToFile,
    'link_data_only' => "link_to_files",
    'upload_option' => "upload_paths",
 );
 $URL = $baseURL . '/api/libraries/' . $library_id . '/contents/?key=' . $adminAPI;
$responseLibrary = httpPOST($URL, $params); // Send POST request

Interestingly, everything works as intended if I use bioblend. Any ideas on what might be wrong? At first I thought that 'file_type' might be necessary and I added it, to no avail...

Thanks!

api upload galaxy http • 238 views
ADD COMMENTlink modified 5 months ago • written 5 months ago by Inquirer80

What is the bioblend analog you're using? I haven't had to work with PHP in some time, I'll look and see what might be happening with the payload on post.

ADD REPLYlink written 5 months ago by Dannon Baker3.7k

Hi, thanks for the reply. I am using the following in bioblend:

gi = GalaxyInstance(url = GALAXY_URL, key=key_admin)
gi.libraries.upload_from_galaxy_filesystem(library_id=library_id,filesystem_paths=filepath,link_data_only='link_to_files')

As I said, this works fine. In PHP, the file is sent to the library (the POST request is successful), but the upload process fails at the lines mentioned above. As a result, it's shown with the state "error" and it has no data type.

ADD REPLYlink modified 5 months ago • written 5 months ago by Inquirer80
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 173 users visited in the last hour