You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
foss_cli: Not able to upload a file (error:fossology.exceptions.FossologyApiError: Upload upload via foss-cli could not be performed: Require uploadType (400))
#133
Open
IrinSamuel opened this issue
Apr 30, 2024
· 3 comments
I installed fossology 3.2.0 and used the foss_cli. The fossology server is spinned up using docker and available and running at http://localhost:8081/repo
These are the commands followed:
foss_cli config
foss_cli -vv create_group FossGroup
foss_cli -vv create_folder FossFolder --folder_group FossGroup --folder_description "Description of FossFolder"
foss_cli -vv upload_file --folder_name FossFolder --access_level public /mnt/c/Users/xxx/Downloads/xxx.tar.gz
Step1 to 3 works, but for Step4, this is the output I get,
2024-04-30 11:20:23,035 - DEBUG - [foss_cli.py:305] - foss_cli called with: ['/home/xxxx/env_fossology/bin/foss_cli',
'-vv',
'upload_file',
'--folder_name',
'FossFolder',
'--access_level',
'public',
'/mnt/c/Users/xxxx/Downloads/xxxx.tar.gz']
2024-04-30 11:20:23,035 - DEBUG - [foss_cli.py:146] - Function needs_later_initialization_of_foss_instance called {'DEBUG': False,
'IS_REQUEST_FOR_CONFIG': False,
'IS_REQUEST_FOR_HELP': False,
'RESULT_DIR': '.foss_cli_results',
'TOKEN': None,
'VERBOSE': 2}
2024-04-30 11:20:23,035 - DEBUG - [foss_cli.py:309] - Initializing Fossology client according to the CLI context
2024-04-30 11:20:23,035 - DEBUG - [foss_cli.py:198] - INIT FOSS
2024-04-30 11:20:23,035 - DEBUG - [foss_cli.py:207] - Set server token from configfile http://localhost:8081/repo:xxxx
2024-04-30 11:20:23,179 - DEBUG - [foss_cli.py:224] - Logged in as user fossy
2024-04-30 11:20:23,184 - DEBUG - [foss_cli.py:555] - Try to upload file /mnt/c/Users/xxxx/Downloads/xxxx.tar.gz
2024-04-30 11:20:23,184 - DEBUG - [foss_cli.py:94] - Found upload folder FossFolder with id 3
Traceback (most recent call last):
File "/home/xxxx/env_fossology/bin/foss_cli", line 8, in
sys.exit(main())
^^^^^^
File "/home/xxxx/env_fossology/lib/python3.12/site-packages/fossology/foss_cli.py", line 813, in main
cli(obj=d) # pragma: no cover
^^^^^^^^^^
File "/home/xxxx/env_fossology/lib/python3.12/site-packages/click/core.py", line 1157, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/xxxx/env_fossology/lib/python3.12/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/home/xxxx/env_fossology/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/xxxx/env_fossology/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/xxxx/env_fossology/lib/python3.12/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/xxxx/env_fossology/lib/python3.12/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/xxxx/env_fossology/lib/python3.12/site-packages/fossology/foss_cli.py", line 570, in upload_file
the_upload = foss.upload_file(
^^^^^^^^^^^^^^^^^
File "/home/xxxx/env_fossology/lib/python3.12/site-packages/fossology/uploads.py", line 309, in upload_file
raise FossologyApiError(description, response)
fossology.exceptions.FossologyApiError: Upload upload via foss-cli could not be performed: Require uploadType (400)
I also tried different other type of files (*.zip, *.txt) to upload, but could not do it successfully. However, uploading manually is successfull. Can you let me know what is wrong.
Thanks and regards,
Irin
The text was updated successfully, but these errors were encountered:
Thanks for your answer. I tried now with the latest v3.2.1 and it works. However, this release is not available with pip install https://pypi.org/project/fossology/
The latest there is still 3.2.0. Can you please add this release there as well so that I can use it with pip and not do a manual install?
Hi,
I installed fossology 3.2.0 and used the foss_cli. The fossology server is spinned up using docker and available and running at http://localhost:8081/repo
These are the commands followed:
foss_cli config
foss_cli -vv create_group FossGroup
foss_cli -vv create_folder FossFolder --folder_group FossGroup --folder_description "Description of FossFolder"
foss_cli -vv upload_file --folder_name FossFolder --access_level public /mnt/c/Users/xxx/Downloads/xxx.tar.gz
Step1 to 3 works, but for Step4, this is the output I get,
2024-04-30 11:20:23,035 - DEBUG - [foss_cli.py:305] - foss_cli called with: ['/home/xxxx/env_fossology/bin/foss_cli',
'-vv',
'upload_file',
'--folder_name',
'FossFolder',
'--access_level',
'public',
'/mnt/c/Users/xxxx/Downloads/xxxx.tar.gz']
2024-04-30 11:20:23,035 - DEBUG - [foss_cli.py:146] - Function needs_later_initialization_of_foss_instance called {'DEBUG': False,
'IS_REQUEST_FOR_CONFIG': False,
'IS_REQUEST_FOR_HELP': False,
'RESULT_DIR': '.foss_cli_results',
'TOKEN': None,
'VERBOSE': 2}
2024-04-30 11:20:23,035 - DEBUG - [foss_cli.py:309] - Initializing Fossology client according to the CLI context
2024-04-30 11:20:23,035 - DEBUG - [foss_cli.py:198] - INIT FOSS
2024-04-30 11:20:23,035 - DEBUG - [foss_cli.py:207] - Set server token from configfile http://localhost:8081/repo:xxxx
2024-04-30 11:20:23,179 - DEBUG - [foss_cli.py:224] - Logged in as user fossy
2024-04-30 11:20:23,184 - DEBUG - [foss_cli.py:555] - Try to upload file /mnt/c/Users/xxxx/Downloads/xxxx.tar.gz
2024-04-30 11:20:23,184 - DEBUG - [foss_cli.py:94] - Found upload folder FossFolder with id 3
Traceback (most recent call last):
File "/home/xxxx/env_fossology/bin/foss_cli", line 8, in
sys.exit(main())
^^^^^^
File "/home/xxxx/env_fossology/lib/python3.12/site-packages/fossology/foss_cli.py", line 813, in main
cli(obj=d) # pragma: no cover
^^^^^^^^^^
File "/home/xxxx/env_fossology/lib/python3.12/site-packages/click/core.py", line 1157, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/xxxx/env_fossology/lib/python3.12/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/home/xxxx/env_fossology/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/xxxx/env_fossology/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/xxxx/env_fossology/lib/python3.12/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/xxxx/env_fossology/lib/python3.12/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/xxxx/env_fossology/lib/python3.12/site-packages/fossology/foss_cli.py", line 570, in upload_file
the_upload = foss.upload_file(
^^^^^^^^^^^^^^^^^
File "/home/xxxx/env_fossology/lib/python3.12/site-packages/fossology/uploads.py", line 309, in upload_file
raise FossologyApiError(description, response)
fossology.exceptions.FossologyApiError: Upload upload via foss-cli could not be performed: Require uploadType (400)
I also tried different other type of files (*.zip, *.txt) to upload, but could not do it successfully. However, uploading manually is successfull. Can you let me know what is wrong.
Thanks and regards,
Irin
The text was updated successfully, but these errors were encountered: