mlco2 / mlco2/codecarbon

Error(s) when running carbonboard

Open
#918 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
1.9k
Forks
323
Avg merge
1d 12h
Merged PRs (30d)
12

Description

When running carbonboard --filepath="examplePathToEmissions.csv" I get the following errors. The dashboard still loads on localhost, but

  1. the icons don't load
  2. there is one available project in the drop down called "codecarbon;" my actual projects are not available to view.

Here is what is returned when I run the above code:

Serving Flask app 'codecarbon.viz.carbonboard'

  • Debug mode: off
    WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
  • Running on http://127.0.0.1:8050
    Press CTRL+C to quit
    127.0.0.1 - - [26/Aug/2025 11:35:19] "GET / HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:35:19] "GET /_dash-layout HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:35:19] "GET /_dash-dependencies HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:35:19] "GET /_dash-component-suites/dash/dcc/async-dropdown.js HTTP/1.1" 304 -
    127.0.0.1 - - [26/Aug/2025 11:35:19] "GET /_dash-component-suites/dash/dcc/async-graph.js HTTP/1.1" 304 -
    127.0.0.1 - - [26/Aug/2025 11:35:19] "GET /_dash-component-suites/plotly/package_data/plotly.min.js HTTP/1.1" 304 -
    127.0.0.1 - - [26/Aug/2025 11:35:19] "POST /_dash-update-component HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:35:19] "GET /_dash-component-suites/dash/dash_table/async-highlight.js HTTP/1.1" 304 -
    127.0.0.1 - - [26/Aug/2025 11:35:19] "GET /_dash-component-suites/dash/dash_table/async-table.js HTTP/1.1" 304 -
    127.0.0.1 - - [26/Aug/2025 11:35:19] "POST /_dash-update-component HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:35:19] "POST /_dash-update-component HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:35:20] "POST /_dash-update-component HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:35:20] "GET /assets/house_icon.png HTTP/1.1" 404 -
    127.0.0.1 - - [26/Aug/2025 11:35:20] "GET /assets/car_icon.png HTTP/1.1" 404 -
    127.0.0.1 - - [26/Aug/2025 11:35:20] "GET /assets/tv_icon.png HTTP/1.1" 404 -
    127.0.0.1 - - [26/Aug/2025 11:35:22] "POST /_dash-update-component HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:35:22] "POST /_dash-update-component HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:35:22] "POST /_dash-update-component HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:35:22] "POST /_dash-update-component HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:35:22] "POST /_dash-update-component HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:35:36] "GET / HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:35:36] "GET /_dash-component-suites/dash/deps/prop-types@15.v3_2_0m1756117275.8.1.min.js HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:35:36] "GET /_dash-component-suites/dash/deps/react@18.v3_2_0m1756117275.3.1.min.js HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:35:36] "GET /_dash-component-suites/dash/deps/polyfill@7.v3_2_0m1756117275.12.1.min.js HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:35:36] "GET /_dash-component-suites/dash/dcc/dash_core_components-shared.v3_2_0m1756117275.js HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:35:36] "GET /_dash-component-suites/dash/deps/react-dom@18.v3_2_0m1756117275.3.1.min.js HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:35:36] "GET /_dash-component-suites/dash/dash_table/bundle.v6_0_4m1756117274.js HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:35:36] "GET /_dash-component-suites/dash_bootstrap_components/_components/dash_bootstrap_components.v2_0_4m1756117313.min.js HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:35:36] "GET /_dash-component-suites/dash/dash-renderer/build/dash_renderer.v3_2_0m1756117274.min.js HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:35:36] "GET /_dash-component-suites/dash/dcc/dash_core_components.v3_2_0m1756117275.js HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:35:36] "GET /_dash-component-suites/dash/html/dash_html_components.v3_0_4m1756117275.min.js HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:35:36] "GET /_dash-layout HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:35:36] "GET /_dash-dependencies HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:35:36] "GET /_dash-component-suites/dash/dcc/async-dropdown.js HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:35:36] "GET /_dash-component-suites/dash/dcc/async-graph.js HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:35:36] "GET /_favicon.ico?v=3.2.0 HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:35:36] "GET /_dash-component-suites/plotly/package_data/plotly.min.js HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:35:37] "POST /_dash-update-component HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:35:37] "GET /_dash-component-suites/dash/dash_table/async-highlight.js HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:35:37] "GET /_dash-component-suites/dash/dash_table/async-table.js HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:35:37] "POST /_dash-update-component HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:35:37] "POST /_dash-update-component HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:35:37] "POST /_dash-update-component HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:35:37] "POST /_dash-update-component HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:35:37] "POST /_dash-update-component HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:35:37] "POST /_dash-update-component HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:35:37] "POST /_dash-update-component HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:35:37] "GET /assets/house_icon.png HTTP/1.1" 404 -
    127.0.0.1 - - [26/Aug/2025 11:35:37] "GET /assets/car_icon.png HTTP/1.1" 404 -
    127.0.0.1 - - [26/Aug/2025 11:35:37] "GET /assets/tv_icon.png HTTP/1.1" 404 -
    127.0.0.1 - - [26/Aug/2025 11:35:38] "POST /_dash-update-component HTTP/1.1" 200 -
    [codecarbon.viz.carbonboard ERROR @ 11:35:40] Exception on /_dash-update-component [POST]
    Traceback (most recent call last):
    File "C:\Users\lightcol\AppData\Local\Programs\Python\Python311\Lib\site-packages\flask\app.py", line 1463, in wsgi_app
    response = self.full_dispatch_request()
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\lightcol\AppData\Local\Programs\Python\Python311\Lib\site-packages\flask\app.py", line 872, in full_dispatch_request
    rv = self.handle_user_exception(e)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\lightcol\AppData\Local\Programs\Python\Python311\Lib\site-packages\flask\app.py", line 870, in full_dispatch_request
    rv = self.dispatch_request()
    ^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\lightcol\AppData\Local\Programs\Python\Python311\Lib\site-packages\flask\app.py", line 855, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\lightcol\AppData\Local\Programs\Python\Python311\Lib\site-packages\asgiref\sync.py", line 277, in call
    return call_result.result()
    ^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\lightcol\AppData\Local\Programs\Python\Python311\Lib\concurrent\futures_base.py", line 449, in result
    return self.__get_result()
    ^^^^^^^^^^^^^^^^^^^
    File "C:\Users\lightcol\AppData\Local\Programs\Python\Python311\Lib\concurrent\futures_base.py", line 401, in __get_result
    raise self._exception
    File "C:\Users\lightcol\AppData\Local\Programs\Python\Python311\Lib\site-packages\asgiref\sync.py", line 353, in main_wrap
    result = await self.awaitable(*args, **kwargs)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\lightcol\AppData\Local\Programs\Python\Python311\Lib\site-packages\dash\dash.py", line 1478, in async_dispatch
    response_data = ctx.run(partial_func)
    ^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\lightcol\AppData\Local\Programs\Python\Python311\Lib\site-packages\dash_callback.py", line 688, in add_context
    raise err
    File "C:\Users\lightcol\AppData\Local\Programs\Python\Python311\Lib\site-packages\dash_callback.py", line 679, in add_context
    output_value = _invoke_callback(func, *func_args, **func_kwargs) # type: ignore[reportArgumentType]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\lightcol\AppData\Local\Programs\Python\Python311\Lib\site-packages\dash_callback.py", line 59, in _invoke_callback
    return func(*args, **kwargs) # %% callback invoked %%
    ^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\lightcol\AppData\Local\Programs\Python\Python311\Lib\site-packages\codecarbon\viz\carbonboard.py", line 79, in update_project_data
    project_summary = data.get_project_summary(project_data.data)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\lightcol\AppData\Local\Programs\Python\Python311\Lib\site-packages\codecarbon\viz\data.py", line 26, in get_project_summary
    last_run = project_data[-1]
    ~~~~~~~~~~~~^^^^
    IndexError: list index out of range
    127.0.0.1 - - [26/Aug/2025 11:35:40] "POST /_dash-update-component HTTP/1.1" 500 -
    127.0.0.1 - - [26/Aug/2025 11:37:00] "GET /organizations/1a8001b2-54a7-4330-815b-befaa93524b6 HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:37:31] "GET /organizations/1a8001b2-54a7-4330-815b-befaa93524b6 HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:37:57] "GET /organizations/1a8001b2-54a7-4330-815b-befaa93524b6 HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:41:26] "GET /organizations HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:41:44] "GET /organizations/1a8001b2-54a7-4330-815b-befaa93524b6 HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:42:02] "GET / HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:42:02] "GET /_dash-layout HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:42:02] "GET /_dash-dependencies HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:42:03] "GET /_favicon.ico?v=3.2.0 HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:42:03] "GET /_dash-component-suites/dash/dcc/async-dropdown.js HTTP/1.1" 304 -
    127.0.0.1 - - [26/Aug/2025 11:42:03] "GET /_dash-component-suites/dash/dcc/async-graph.js HTTP/1.1" 304 -
    127.0.0.1 - - [26/Aug/2025 11:42:03] "GET /_dash-component-suites/plotly/package_data/plotly.min.js HTTP/1.1" 304 -
    127.0.0.1 - - [26/Aug/2025 11:42:03] "POST /_dash-update-component HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:42:03] "GET /_dash-component-suites/dash/dash_table/async-highlight.js HTTP/1.1" 304 -
    127.0.0.1 - - [26/Aug/2025 11:42:03] "GET /_dash-component-suites/dash/dash_table/async-table.js HTTP/1.1" 304 -
    127.0.0.1 - - [26/Aug/2025 11:42:03] "POST /_dash-update-component HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:42:03] "POST /_dash-update-component HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:42:03] "POST /_dash-update-component HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:42:03] "POST /_dash-update-component HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:42:03] "POST /_dash-update-component HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:42:03] "POST /_dash-update-component HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:42:03] "POST /_dash-update-component HTTP/1.1" 200 -
    127.0.0.1 - - [26/Aug/2025 11:42:03] "GET /assets/house_icon.png HTTP/1.1" 404 -
    127.0.0.1 - - [26/Aug/2025 11:42:03] "GET /assets/car_icon.png HTTP/1.1" 404 -
    127.0.0.1 - - [26/Aug/2025 11:42:03] "GET /assets/tv_icon.png HTTP/1.1" 404 -
    127.0.0.1 - - [26/Aug/2025 11:42:04] "POST /_dash-update-component HTTP/1.1" 200 -
    127.0.0.1 - - [27/Aug/2025 10:16:54] "GET / HTTP/1.1" 200 -
    127.0.0.1 - - [27/Aug/2025 10:16:54] "GET /_dash-layout HTTP/1.1" 200 -
    127.0.0.1 - - [27/Aug/2025 10:16:54] "GET /_dash-dependencies HTTP/1.1" 200 -
    127.0.0.1 - - [27/Aug/2025 10:16:54] "GET /_dash-component-suites/dash/dcc/async-graph.js HTTP/1.1" 304 -
    127.0.0.1 - - [27/Aug/2025 10:16:55] "GET /_dash-component-suites/dash/dcc/async-dropdown.js HTTP/1.1" 304 -
    127.0.0.1 - - [27/Aug/2025 10:16:55] "POST /_dash-update-component HTTP/1.1" 200 -
    127.0.0.1 - - [27/Aug/2025 10:16:55] "GET /_dash-component-suites/dash/dash_table/async-highlight.js HTTP/1.1" 304 -
    127.0.0.1 - - [27/Aug/2025 10:16:55] "GET /_dash-component-suites/dash/dash_table/async-table.js HTTP/1.1" 304 -
    127.0.0.1 - - [27/Aug/2025 10:16:55] "POST /_dash-update-component HTTP/1.1" 200 -
    127.0.0.1 - - [27/Aug/2025 10:16:55] "POST /_dash-update-component HTTP/1.1" 200 -
    127.0.0.1 - - [27/Aug/2025 10:16:55] "POST /_dash-update-component HTTP/1.1" 200 -
    127.0.0.1 - - [27/Aug/2025 10:16:55] "POST /_dash-update-component HTTP/1.1" 200 -
    127.0.0.1 - - [27/Aug/2025 10:16:55] "POST /_dash-update-component HTTP/1.1" 200 -
    127.0.0.1 - - [27/Aug/2025 10:16:55] "POST /_dash-update-component HTTP/1.1" 200 -
    127.0.0.1 - - [27/Aug/2025 10:16:55] "POST /_dash-update-component HTTP/1.1" 200 -
    127.0.0.1 - - [27/Aug/2025 10:16:55] "GET /assets/house_icon.png HTTP/1.1" 404 -
    127.0.0.1 - - [27/Aug/2025 10:16:56] "GET /assets/car_icon.png HTTP/1.1" 404 -
    127.0.0.1 - - [27/Aug/2025 10:16:56] "GET /assets/tv_icon.png HTTP/1.1" 404 -
    127.0.0.1 - - [27/Aug/2025 10:16:57] "POST /_dash-update-component HTTP/1.1" 200 -
    127.0.0.1 - - [27/Aug/2025 10:16:57] "GET /_dash-component-suites/plotly/package_data/plotly.min.js HTTP/1.1" 304 -
    127.0.0.1 - - [27/Aug/2025 10:17:12] "GET / HTTP/1.1" 200 -

Details:

  • OS: Windows 11
  • Python Version 3.11.0
  • CodeCarbon Version 3.0.4
Image

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

Reproduce with carbonboard --filepath="examplePathToEmissions.csv" and start at codecarbon.viz.carbonboard.py:update_project_data and codecarbon.viz.data.py:get_project_summary, where the traceback shows an empty-data IndexError. Inspect the 404 requests for assets/house_icon.png, assets/car_icon.png, and assets/tv_icon.png. Done means the dashboard loads the supplied projects, handles empty project data without a 500 response, and loads the icons.

Written by the indexing model from the issue text.

Assessment

Tech stack
flask, python
Domain
backend, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.