open-sdg / open-sdg

A platform for collecting and disseminating data for the Sustainable Development Goal global indicators.
https://open-sdg.org
MIT License
62 stars 77 forks source link

Issue while updating to 2.2.0 #2058

Closed camereb closed 4 months ago

camereb commented 1 year ago

Please complete the following information Data repository URL: https://github.com/sdg-data-canada-odd-donnees/sdg-data-donnees-odd Data or metadata issue: Version update to 2.2.0 Input format: requirements.txt

Describe the bug While updating to 2.2.0 (from 2.1.0) encountered what seems to be an encoding issue (see portion of error script below) when updating the requirements.txt file.

determine_encoding self.update_raw() File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/yaml/reader.py", line 178, in update_raw data = self.stream.read(size) File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/codecs.py", line 322, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xab in position 60: invalid start byte Error: Process completed with exit code 1.

Additional context Please advise on how to fix this issue, thank you.

sarah-beasley commented 1 year ago

Hi, have you tried editing the file in github, and making sure all the line breaks are standard spaces? It looks like a problem potentially with the translation files, maybe an unexpected character, so we just need to try and find it. @brockfanning will also try run locally and see if he has the same issue.

camereb commented 1 year ago

Hi Sarah, thanks for your help. We've gone through the translation files and removed extra characters, but after trying to push the version update again, it still failed unfortunately. Any additional help would be appreciated, thanks!

christoph-LSN commented 1 year ago

@camereb perhaps you take a look at this csy file https://github.com/sdg-data-canada-odd-donnees/sdg-data-donnees-odd/blob/d307eb6e56b3c1f323fa03149fac15ddf1ce856a/data/indicator_1-4-1.csv#L127

may be the character between (aged 15–49 years) 15 and 49 is the problem

camereb commented 1 year ago

Thanks for pointing this out! We've fixed the character error and tried re-updating to v2.2.0 again, but unfortunately it is still failing to update. Thank you for your help, and any additional guidance is appreciated.

christoph-LSN commented 1 year ago

@camereb After fixing the character-error in 1-4-1 the Utf-8 error doesn't appears any more. Right?

In your config_data.yml both translations options are active.

I think SDG will try to get the translations from the sdg-translation.git as well as from your local translations folder. Not sure if this causes the problem....

https://github.com/sdg-data-canada-odd-donnees/sdg-data-donnees-odd/blob/21a5b926d44985bd2064a8a0abce19a0841ffbd1/config_data.yml#L71-L78

Could you post the link to your site repo as well? Did you change your Gemfile as well?

camereb commented 1 year ago

After fixing the character error in 1-4-1 the utf-8 error still appears in the error message.

Link to site repo: https://github.com/sdg-data-canada-odd-donnees/sdg-odd-dev

And yes, the Gemfile was changed too.

Thanks for your help!

brockfanning commented 1 year ago

@camereb Here is a pull request with enough fixes to get the build to complete (at least when I run it locally). The fixes involved both character encoding issues and YAML syntax issues. https://github.com/sdg-data-canada-odd-donnees/sdg-data-donnees-odd/pull/217

I don't understand character encoding enough to describe exactly what those problems were, but I was able to fix them by copying/pasting certain characters from other places I found on the web.

For the metadata files, the YAML syntax is rather tricky. If the content of a field contains a colon (:) then the whole thing needs to be enclosed in quotes. Otherwise, the YAML parser thinks that it is the beginning of a new field, and gets confused.

camereb commented 1 year ago

Thanks very much for all your help! We have successfully updated to v2.2.0.