-
Notifications
You must be signed in to change notification settings - Fork 60
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
Submit license fails with UTF decode error #462
Comments
Note that the error is occurring on this line: spdx-online-tools/src/app/utils.py Line 518 in 0e661a3
which which was modified with PR #444 If I change lines 517 and 518 back, the problem goes away. @BanulaKumarage - from your PR it looks like if I change these lines back it will re-introduce the unit test failure. Let me know what you think. |
Yeah @goneall it was changed for the fix of unit test failure. As I mentioned in the PR #444 byte type patterns were not converted to utf-8 strings. That's why I changed that way. Can you tell me how to recreate this error? I will work in this issue when I recreate the error. |
Completely understand - if you can duplicate it, you can fix it :) I just created a docker image per the README, started it up and whenever I created an issue, it caused the error. I tried clearing the redis DB and recreating the license data (a couple lines up from the changed code in util.py) and it still occurred. I can reproduce it at will, so if you want me to collect any data, let me know. |
@goneall can you debug the code by putting a debug point at 519 and send me the r.keys() and spdxLicenseIds? |
@BanulaKumarage Attached is the output of the r.keys() from debug and license ID's (debug.txt and debug2.txt resp). |
Thank you @goneall. I will look into this. |
@goneall Is this the place where error is raised? I ran the below sample python script. |
The error is the next line:
|
I can't print out the |
Here's the output of
|
@goneall if it's possible can you send me the value of r.mget(spdxLicenseIds) and r.mget(r.keys())? |
@BanulaKumarage The value of r.mget(spdxLicenseIds) is too big to capture on the screen. Above, I sent you the output of r.mget(spdxLicenseIds[0]). Can you use that to see if it decodes? |
BTW - you should be able to duplicate this if you use Docker and containers to run the app. |
Yeah @goneall I can use that. |
Okay @goneall I will try that way. But a small clarification. Why the issue raises specifically when running from docker? And not raising when running the app without docker? |
Docker has a more reproducible environment - when your running it from your local machine it will be impacted by what your operating system is. The production environment is also run from a Docker image. I also know that this occurs in a docker image on my machine. |
Thank you @goneall for the clarification. I got the idea. I will look into it. |
@BanulaKumarage Let's try to fix this on priority. It's not able to decode this character https://bytetool.web.app/en/ascii/code/0x8b/. Seems like a common issue with utf-8 for this character. |
@rtgdk Is this character coming as b'\x02' in the list to decode? |
@jlovejoy I believe the issue is still open based on the comment history. |
Note - this issue is preventing me from deploying the latest code base. |
When running the latest main branch code on my local machine, I'm getting the following exception:
The text was updated successfully, but these errors were encountered: