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

Error creating TinyURL link #199

Open
zoidy opened this issue Apr 26, 2021 · 2 comments
Open

Error creating TinyURL link #199

zoidy opened this issue Apr 26, 2021 · 2 comments
Labels
api Use of a third-party API bug Something isn't working curation Pertains to aspects of curation, including workflow management p1 Issues affecting production, multiple users
Milestone

Comments

@zoidy
Copy link
Collaborator

zoidy commented Apr 26, 2021

Exception when creating README form TinyURL

21:55:31 -     INFO: TinyURL link does not exist. Creating!
21:55:31 -  WARNING: Caught an HTTPError: 400 Client Error: Bad Request for url: http://tinyurl.com/api-create.php?url=https://uarizona.co1.qualtrics.com/jfe/form/<snip>&alias=Abdolhosseini-14399315-1-README
--- Logging error ---
Traceback (most recent call last):
  File "/home/curator/codes/LD_Cool_P/ldcoolp/curation/email/urls.py", line 56, in tiny_url
    response.raise_for_status()
  File "/home/curator/.local/lib/python3.7/site-packages/requests/models.py", line 943, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: http://tinyurl.com/api-create.php?url=https://uarizona.co1.qualtrics.com/jfe/form/<snip>&alias=Abdolhosseini-14399315-1-README

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/anaconda3/envs/curation/lib/python3.7/logging/__init__.py", line 1025, in emit
    msg = self.format(record)
  File "/opt/anaconda3/envs/curation/lib/python3.7/logging/__init__.py", line 869, in format
    return fmt.format(record)
  File "/opt/anaconda3/envs/curation/lib/python3.7/logging/__init__.py", line 608, in format
    record.message = record.getMessage()
  File "/opt/anaconda3/envs/curation/lib/python3.7/logging/__init__.py", line 369, in getMessage
    msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
  File "/home/curator/codes/LD_Cool_P/ldcoolp/scripts/generate_qualtrics_links", line 101, in <module>
    readme_tinyurl = urls.tiny_url(readme_full_url, alias=readme_alias)
  File "/home/curator/codes/LD_Cool_P/ldcoolp/curation/email/urls.py", line 60, in tiny_url
    log.warning('Body:\n', response.text)
Message: 'Body:\n'
Arguments: ('Error',)
Traceback (most recent call last):
  File "/home/curator/codes/LD_Cool_P/ldcoolp/curation/email/urls.py", line 56, in tiny_url
    response.raise_for_status()
  File "/home/curator/.local/lib/python3.7/site-packages/requests/models.py", line 943, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: http://tinyurl.com/api-create.php?url=https://uarizona.co1.qualtrics.com/jfe/form/<snip>alias=Abdolhosseini-14399315-1-README

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/curator/codes/LD_Cool_P/ldcoolp/scripts/generate_qualtrics_links", line 101, in <module>
    readme_tinyurl = urls.tiny_url(readme_full_url, alias=readme_alias)
  File "/home/curator/codes/LD_Cool_P/ldcoolp/curation/email/urls.py", line 61, in tiny_url
    raise HTTPError
requests.exceptions.HTTPError
@astrochun
Copy link
Contributor

There is something wrong with parsing certain title it seems. I'm still looking into it. For now, use the full Qualtrics links, which seem to work.

@astrochun astrochun added api Use of a third-party API bug Something isn't working curation Pertains to aspects of curation, including workflow management p1 Issues affecting production, multiple users labels Apr 26, 2021
@astrochun astrochun added this to the v1.1.0 milestone Apr 26, 2021
@zoidy
Copy link
Collaborator Author

zoidy commented Apr 26, 2021

Thanks, I created the shortened link manually for now. This is a relatively low priority item since there is a manual workaround

@astrochun astrochun modified the milestones: v1.1.0, v1.2.0 Jun 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Use of a third-party API bug Something isn't working curation Pertains to aspects of curation, including workflow management p1 Issues affecting production, multiple users
Projects
None yet
Development

No branches or pull requests

2 participants