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

Unknown encoding cp437 #689

Open
vogt31337 opened this issue Jun 4, 2024 · 4 comments
Open

Unknown encoding cp437 #689

vogt31337 opened this issue Jun 4, 2024 · 4 comments

Comments

@vogt31337
Copy link

Expected Behavior

I've built a python web server application which reads zip and xml files, modifies and writes them. Everything works fine until a slimified version is created.


Actual Behavior

Application crashes with - ERROR - unknown encoding: cp437
Without slimification it works fine.

Maybe slim did remove the codepage. This behaviour is nowhere mentioned or documented.


Specifications

  • Version: latest
  • Platform: kubernetes
@kcq
Copy link
Member

kcq commented Jun 4, 2024

@vogt31337 sounds like you might need to define custom http probes for your endpoints. You can use the --http-probe-cmd and --http-probe-cmd-file flags for it. With the most basic setup you just specify the server path for the endpoint. Example: --http-probe-cmd /my/custom/endpoint

Additional info for others when you have non-server CLI apps:

For a CLI app you need to configure the slim command to run the app in the container. There are a few options for that.

You can use the --exec flag to run a shell command in the target container (e.g., your app with sample params).

You can also use the --entrypoint and/or --cmd slim command flags (similar to how the ENTRYPOINT and CMD instructions in Dockerfiles are used) to point to your CLI app and invoke it with specific parameters. If you need file data to references when you are invoking your CLI app and those files don't exist in the container you can mount those files using the --mount flag.

@vogt31337
Copy link
Author

@kcq, thanks for the answer, but I realized that my description wasn't clear enough: The software is running, the webserver is working and processing requests. But when it tries to read an xml file it crashes with this "unknown encoding error".

My idea is that slim removes codepages (I have no clue where in linux they are stored) and therefore reading and processing a file not in utf-8 produces such errors. Since the software is running non dockerized and in a fat container, it must be due to the slimification process...
Maybe @kcq you have some other ideas where I could look?

@kcq
Copy link
Member

kcq commented Jun 11, 2024

@vogt31337 are you using FastAPI for your python server app by any chance? If so, it exposes an openapi spec that can be used to generate additional interactions with the app.

@vogt31337
Copy link
Author

Yeah I am using fastapi, but again that ist Not the Problem (the swagger Style documentation works). Reading an XML File from a mounted storage fails with this encoding Error.
And in the fat Image IT doesn't fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants