linkedin / linkedin/oncall

UnicodeDecodeError: 'ascii' codec can't decode

Open
#366 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.3k
Forks
245
PR merge metrics
No merged PRs in 30d

Description

I'm upgrading oncall application to current version by migrating my on-call DB with data by modifying required fields as per the new DB schema. after dumping am not able to see all my data which is present in DB.
while accessing oncall UI is working fine but not able to see the teams and their calender info.
Getting below error.
can somebody please help here.

_**Tue Feb 1 18:09:15 2022 - [uwsgi-daemons] respawning "/home/oncall/env/bin/oncall-notifier /home/oncall/config/config.yaml" (uid: 1000 gid: 1000)
Traceback (most recent call last):
File "/home/oncall/env/bin/oncall-notifier", line 11, in
load_entry_point('oncall==1.4.3', 'console_scripts', 'oncall-notifier')()
File "/home/oncall/env/lib/python3.6/site-packages/oncall/bin/notifier.py", line 136, in main
config = yaml.safe_load(config_file)
File "/home/oncall/env/lib/python3.6/site-packages/yaml/__init__.py", line 125, in safe_load
return load(stream, SafeLoader)
File "/home/oncall/env/lib/python3.6/site-packages/yaml/__init__.py", line 79, in load
loader = Loader(stream)
File "/home/oncall/env/lib/python3.6/site-packages/yaml/loader.py", line 34, in __init__
Reader.__init__(self, stream)
File "/home/oncall/env/lib/python3.6/site-packages/yaml/reader.py", line 85, in __init__
self.determine_encoding()
File "/home/oncall/env/lib/python3.6/site-packages/yaml/reader.py", line 124, in determine_encoding
self.update_raw()
File "/home/oncall/env/lib/python3.6/site-packages/yaml/reader.py", line 178, in update_raw
data = self.stream.read(size)
File "/usr/lib/python3.6/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 4039: ordinal not in range(128)**_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with oncall/bin/notifier.py and the config.yaml passed to oncall-notifier, where the traceback shows yaml.safe_load reading the stream. Reproduce the notifier startup with the migrated data and inspect the encoding failure. Done means the notifier starts without the UnicodeDecodeError and teams and calendar information are visible.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.