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

Errors Encountered During Asset Transfer Using kobo-transfer #49

Open
stephencoduor opened this issue Nov 19, 2024 · 1 comment
Open

Comments

@stephencoduor
Copy link

Description

While attempting to transfer assets using the kobo-transfer tool, I encountered multiple issues related to URL construction and validation. Below are the details of the errors and observations:

HTTP Error:

File "/usr/lib/python3/dist-packages/requests/models.py", line 943, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://kf.mydomain.com/api/v2/assets/.json

URL Construction Issue:

Issue 1

The constructed URL seems incorrect:
asset_url and asset_url_json

Http request to https://kf.mydomain.com/api/v2/assets/.json returns HTTPError: 404
Expected URL: https://kf.mydomain.com/api/v2/assets.json

When visiting the correct URL (https://kf.mydomain.com/api/v2/assets.json), I receive a valid JSON response.

Issue 2

The function def _validate_config(self) fails if any assets are not deployed, even though some assets are successfully deployed

Validation Issue:

The function def _validate_config fails if any assets are not deployed, even though some assets status is deployed deployed. This behavior halts the transfer process unnecessarily.

Steps to Reproduce
Use the kobo-transfer tool to transfer assets.
Observe the constructed URL and note the addition of an extra . before .json.
Attempt to transfer assets when some are deployed, and some are not.

Proposed Fixes

URL Construction:
Investigate the logic constructing asset_url and asset_url_json.
Ensure no trailing slashes or unnecessary dots are appended to the base URL.

Validation Logic:
Modify _validate_config(self) to allow the transfer of deployed assets even if some assets are not deployed.

Environment:

Tool: kobo-transfer
Python Version: ., Python 3.10
Platform: Ubuntu 22.04

@stephencoduor
Copy link
Author

stephencoduor commented Nov 19, 2024

Hello, I ready to create a PR if the issue is reproduceable on other environments

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

1 participant