Question: Error uploading Galaxy file via HTTP
1
Inquirer • 80 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!
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.
Hi, thanks for the reply. I am using the following in bioblend:
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.