ccloud-chargeback-helper
ccloud-chargeback-helper copied to clipboard
Dockerfile issue-
@waliaabhishek When I use Dockerfile to create image,Image is created but at run time got error-
File "/app/main.py", line 4, in
Which branch are you using the Dockerfile from ? They might be a little different between the releases and main/WIP branches, etc.
@waliaabhishek from branch 1.0.4
I have seen this happen when the numpy version is not pinned but pandas picks up an incompatible version for that. Unfortunately the current requirements.txt does not pint he numpy version at all.
Can you add the following line to the top of the requirements.txt file? Run the compile and share the latest result please. The line is:
numpy==1.25.2
Let me know if that solves your issue. I might have to add this as a patch fix.
@waliaabhishek Now got this error-
Traceback (most recent call last):
File "/app/main.py", line 23, in
Clarification on Configuration File Availability
The config/config_internal.yaml file is present in the repository and should be accessible during standard operations. If you're encountering a FileNotFoundError, it might be due to one of the following reasons:
-
Repository Cloning Issues: Ensure that the repository was cloned correctly and that the config directory and its contents are intact.
-
Modifications to Docker Configuration: Alterations to the Dockerfile or docker-compose.yml can affect the file paths and working directories, leading to such errors.
-
Execution Outside Docker Compose: Running the application outside the prescribed Docker Compose setup might result in the application not locating the configuration file as expected.
Regarding Container Rebuilding
The prebuilt container is available on Docker Hub and is designed to work out-of-the-box. Rebuilding the container isn't necessary unless you have specific customization requirements. If you choose to rebuild:
-
Verify the Repository Structure: Ensure that the directory structure remains unchanged, especially the location of the config directory.
-
Avoid Unintended Modifications: Refrain from altering the Dockerfile or docker-compose.yml unless necessary, as changes can impact the application's behavior.
Scope of Support
Please note that support for issues arising from personal forks or modifications falls outside the scope of this project's support. While I can offer guidance, troubleshooting such issues is the responsibility of the individual maintainer.
@waliaabhishek FileNotFoundError: [Errno 2] No such file or directory: './config/config_internal.yaml' But file location is -deployables/assets/chargeback_handler/config/config_internal.yaml
@waliaabhishek I run without any modification.
@waliaabhishek I changed default="./config/config.yaml"
now getting below image
2025-04-21 16:30:34,677 workflow_runner INFO Starting Workflow Runner
2025-04-21 16:30:34,678 workflow_runner INFO File path
2025-04-21 16:30:34,678 workflow_runner INFO ./config/config.yaml
Traceback (most recent call last):
File "/app/main.py", line 23, in
@waliaabhishek If I use below command - docker run -d abhiwalia/ccloud_chargeback_handler:1.0.4
I got same error-
Traceback (most recent call last):
File "/app/main.py", line 23, in
I see what you mean. The Docker Compose actually overrides the config file flag with a volume mounted config file. Is the Docker compose not working for you ?
if you want to make the container run as standalone you will need to add the following argument to the docker run command
--config-file "/app/config/config.yaml" or if you add a volume mount you can change it to what your mount path is. I will fix this in a patch release soon.
@waliaabhishek I tried this also-
docker run -d abhiwalia/ccloud_chargeback_handler:1.0.4 --config-file "/app/config/config.yaml"
got error-
2025-04-29 13:32:37,734 workflow_runner INFO Starting Workflow Runner
Traceback (most recent call last):
File "/app/main.py", line 23, in
This is expected. You are not providing a value for environment variables which the code needs. The Docker Compose shares what all variables are needed. https://github.com/waliaabhishek/ccloud-chargeback-helper/blob/bbf66450368aeae8e6c83ac9bd9184645c3c1d9b/docker-compose.yml#L17
@waliaabhishek Its working now .Thanks
@waliaabhishek I have one question regarding CCLOUD_LOOKBACK_DAYS.If I specify 200 days,After 200 days do we need to delete the all files from ccloud-chargeback-helper/deployables/datastore.
Nope. The datastore is the location where all the prometheus data set is persisted. You delete that, you delete the Prometheus data and the chargeback + billing data long with it.
@waliaabhishek So why it stops working after CCLOUD_LOOKBACK_DAYS passed.
I am not sure what do you mean by it stops working ? Does it not do anything? Does it slow down ? Does it error out? Does it just wait ? What do the logs say is going on ? I need some more details before i can help with the debug
@waliaabhishek I again got this error -
When I run docker image
requests.exceptions.ConnectionError: HTTPConnectionPool(host='prometheus_for_chargeback', port=9090): Max retries exceeded with url: /api/v1/query (Caused by NameResolutionError("<urllib3.connection.HTTPConnection object at 0xf526d5cd72d0>: Failed to resolve 'prometheus_for_chargeback' ([Errno -5] No address associated with hostname)"))