question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

quote_from_bytes() expected bytes

See original GitHub issue

How do you use Sentry?

Self-hosted/on-premise

Version

1.9.8

Steps to Reproduce

None, all API requests fail to this

Expected Result

It is OK to log the error about sentry-tracing not being able to do its magic, but it should not make the full application error out

Actual Result

Traceback (most recent call last):
  File "/var/task/botocore/httpsession.py", line 448, in send
    urllib_response = conn.urlopen(
  File "/var/task/urllib3/connectionpool.py", line 703, in urlopen
    httplib_response = self._make_request(
  File "/var/task/urllib3/connectionpool.py", line 398, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/var/task/urllib3/connection.py", line 239, in request
    super(HTTPConnection, self).request(method, url, body=body, headers=headers)
  File "/usr/local/python/lib/python3.9/http/client.py", line 1285, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/var/task/botocore/awsrequest.py", line 94, in _send_request
    rval = super()._send_request(
  File "/usr/local/python/lib/python3.9/http/client.py", line 1296, in _send_request
    self.putrequest(method, url, **skips)
  File "/var/task/urllib3/connection.py", line 219, in putrequest
    return _HTTPConnection.putrequest(self, method, url, *args, **kwargs)
  File "/var/task/sentry_sdk/integrations/stdlib.py", line 88, in putrequest
    for key, value in hub.iter_trace_propagation_headers(span):
  File "/var/task/sentry_sdk/hub.py", line 717, in iter_trace_propagation_headers
    for header in span.iter_headers():
  File "/var/task/sentry_sdk/tracing.py", line 322, in iter_headers
    baggage = self.containing_transaction.get_baggage().serialize()
  File "/var/task/sentry_sdk/tracing_utils.py", line 541, in serialize
    item = Baggage.SENTRY_PREFIX + quote(key) + "=" + quote(val)
  File "/usr/local/python/lib/python3.9/urllib/parse.py", line 871, in quote
    return quote_from_bytes(string, safe)
  File "/usr/local/python/lib/python3.9/urllib/parse.py", line 896, in quote_from_bytes
    raise TypeError("quote_from_bytes() expected bytes")

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
lehmatcommented, Sep 19, 2022

It is defaulted to integer: 1 so it surely might be the root cause

0reactions
sl0thentr0pycommented, Sep 19, 2022

is your SENTRY_RELEASE by any chance an integer?

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - Troubelshooting raise TypeError("quote_from_bytes ...
and the error is raise TypeError("quote_from_bytes() expected bytes") TypeError: quote_from_bytes() expected bytes. Help is much appreciated.
Read more >
quote_from_bytes() expected bytes on pset 9 Finance - Quote
I know that lookup returns a dict but my understanding is that the return value can just be assigned to a variable like...
Read more >
TypeError: quote_from_bytes() expected bytes is raised during ...
TypeError: quote_from_bytes() expected bytes is raised during debug session. Relates to 1. Relates to 1 issue (0 unresolved).
Read more >
TypeError: quote_from_bytes() expected bytes when ... - GitHub
API version: 2020-03-02; oxxo_beta=v1. Python library: 2.48.0. Whenever I add a card using my frontend I get a card id, after that I...
Read more >
TypeError: quote_from_bytes() expected bytes - Microsoft Q&A
Deleting files from blob - TypeError: quote_from_bytes() expected bytes. Hi, I have some files inside a container named data:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found