# Unknown 'InvalidValue' Error

**URL:** <https://community.plotly.com/t/unknown-invalidvalue-error/55040>\
**Category:** Dash Python\
**Created:** [July 26, 2021, 1:04pm UTC](https://community.plotly.com/t/unknown-invalidvalue-error/55040 "2021-07-26T13:04:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![evil\_clown](https://avatars.discourse-cdn.com/v4/letter/e/22d042/32.png) [@evil\_clown](https://community.plotly.com/u/evil_clown)\
**Post date:** [July 26, 2021, 1:04pm UTC](https://community.plotly.com/t/unknown-invalidvalue-error/55040/1 "2021-07-26T13:04:43Z")

</div>

Hi everybody!

I faced an inconsistent error while updating dcc.Graph with px.scatter object via callback.  
It happens right after I run my app and push the button triggering the dcc.Graph update so that it is obviously connected to scatter plot initialization. But the error occurs randomly, sometimes my app works regularly.  
Once I face the error, the app goes OK then.

It really seems to be similar to this case:

> [@Inconsistent Callback Error Updating Scatter Plot](https://community.plotly.com/t/inconsistent-callback-error-updating-scatter-plot/46754):
>
> Hey everyone, I’m having a hard time determining the source of a callback error as it only occurs a small percentage of times during app initialization. The error can occur for any of my graphs but I’ve shared the relevant code for the simplest callback below. import dash import dash\_html\_components as html import pandas as pd import dash\_core\_components as dcc import dash\_html\_components as html import dash\_bootstrap\_components as dbc from dash.dependencies import Input, Output, State from da…

My callback code…

```auto
@app.callback(
    Output('Scatter_plot', 'figure'),
    Output('Histogram', 'figure'),
    Output('Bar_chart', 'figure'),
    Input({'type': 'column_name_buttons', 'index': ALL}, 'n_clicks'),
    State('Histogram_norm_type', 'value'),
    State('Time_checklist', 'value'),
    State('Date_checkbox', 'value'),
    State('Date_picker_range', 'start_date'),
    State('Date_picker_range', 'end_date'),
    prevent_initial_call=True
)
def update_plots(*input_parameters):
    changed_id = dash.callback_context.triggered[0]['prop_id'].split('","type"')[0].split('"index":"')[1]
    dff, date_axis = aggregate_by_date_time(input_parameters[-1],
                                            input_parameters[-2],
                                            input_parameters[-3],
                                            input_parameters[-4]
                                            )

    xaxis = date_axis if date_axis is None else dff['Date_Time']

    fig_scatter = px.scatter(data_frame=dff, x=xaxis, y=changed_id, color='ErrorMessage')
    fig_scatter.update_layout(paper_bgcolor='#f0f8ff', plot_bgcolor='#f0f8ff')

    fig_hist = px.histogram()
    if input_parameters[-5] == 'count': # index [-5] is a 'Histogram_norm_type' - 'value'
        fig_hist = px.histogram(dff, y=changed_id, x=xaxis, color='ErrorMessage', marginal='box',
                                histfunc='count')
    elif input_parameters[-5] == 'percent': # index [-5] is a 'Histogram_norm_type' - 'value'
        fig_hist = px.histogram(dff, y=changed_id, x=xaxis, color='ErrorMessage', marginal='box',
                                histfunc='count', histnorm='percent')
    fig_hist.update_layout(paper_bgcolor='#f0f8ff', plot_bgcolor='#f0f8ff')
    fig_hist.update_traces(opacity=0.72)

    fig_bar = px.histogram(dff, x='ErrorMessage', histfunc='count', color='ErrorMessage')
    fig_bar.update_layout(paper_bgcolor='#f0f8ff', plot_bgcolor='#f0f8ff', barmode='stack')
    fig_bar.update_traces(opacity=0.72)

    return fig_scatter, fig_hist, fig_bar,

```

Error message:

Traceback (most recent call last):  
File “/Users/igorderiabin/Yandex.Disk.localized/HFU/BCM/Thesis/PREFERML\_test/app.py”, line 426, in update\_plots  
fig\_scatter = px.scatter(data\_frame=dff, x=xaxis, y=changed\_id, color=‘ErrorMessage’)  
File “/Users/igorderiabin/Yandex.Disk.localized/HFU/BCM/Thesis/PREFERML\_test/venv/lib/python3.7/site-packages/plotly/express/\_chart\_types.py”, line 64, in scatter  
return make\_figure(args=locals(), constructor=go.Scatter)  
File “/Users/igorderiabin/Yandex.Disk.localized/HFU/BCM/Thesis/PREFERML\_test/venv/lib/python3.7/site-packages/plotly/express/\_core.py”, line 1877, in make\_figure  
apply\_default\_cascade(args)  
File “/Users/igorderiabin/Yandex.Disk.localized/HFU/BCM/Thesis/PREFERML\_test/venv/lib/python3.7/site-packages/plotly/express/\_core.py”, line 945, in apply\_default\_cascade  
scatter.marker.symbol for scatter in args[“template”].data.scatter  
File “/Users/igorderiabin/Yandex.Disk.localized/HFU/BCM/Thesis/PREFERML\_test/venv/lib/python3.7/site-packages/plotly/express/\_core.py”, line 945, in   
scatter.marker.symbol for scatter in args[“template”].data.scatter  
File “/Users/igorderiabin/Yandex.Disk.localized/HFU/BCM/Thesis/PREFERML\_test/venv/lib/python3.7/site-packages/plotly/graph\_objs/scatter/\_marker.py”, line 1042, in symbol  
return self[“symbol”]  
File “/Users/igorderiabin/Yandex.Disk.localized/HFU/BCM/Thesis/PREFERML\_test/venv/lib/python3.7/site-packages/plotly/basedatatypes.py”, line 4693, in **getitem**  
elif self.\_props is not None and prop in self.\_props:  
File “/Users/igorderiabin/Yandex.Disk.localized/HFU/BCM/Thesis/PREFERML\_test/venv/lib/python3.7/site-packages/plotly/basedatatypes.py”, line 4388, in \_props  
return self.parent.\_get\_child\_props(self)  
File “/Users/igorderiabin/Yandex.Disk.localized/HFU/BCM/Thesis/PREFERML\_test/venv/lib/python3.7/site-packages/plotly/basedatatypes.py”, line 4402, in \_get\_child\_props  
if self.\_props is None:  
File “/Users/igorderiabin/Yandex.Disk.localized/HFU/BCM/Thesis/PREFERML\_test/venv/lib/python3.7/site-packages/plotly/basedatatypes.py”, line 4388, in \_props  
return self.parent.\_get\_child\_props(self)  
File “/Users/igorderiabin/Yandex.Disk.localized/HFU/BCM/Thesis/PREFERML\_test/venv/lib/python3.7/site-packages/plotly/basedatatypes.py”, line 4422, in \_get\_child\_props  
child\_ind = BaseFigure.\_index\_is(children, child)  
File “/Users/igorderiabin/Yandex.Disk.localized/HFU/BCM/Thesis/PREFERML\_test/venv/lib/python3.7/site-packages/plotly/basedatatypes.py”, line 3952, in \_index\_is  
raise ValueError(“Invalid value”)  
ValueError: Invalid value

P.S. The error still occurs even if I use plotly.express.scatter() with no arguments, like:  
_px.scatter() instead_ of _px.scatter(data\_frame=dff, x=xaxis, y=changed\_id, color=‘ErrorMessage’)_

---

<div class="post-metadata">

**Author:** ![RachelGomez161999](https://avatars.discourse-cdn.com/v4/letter/r/e19adc/32.png) [@RachelGomez161999](https://community.plotly.com/u/RachelGomez161999)\
**Post date:** [November 17, 2022, 7:26am UTC](https://community.plotly.com/t/unknown-invalidvalue-error/55040/2 "2022-11-17T07:26:24Z")

</div>

I had the same problem, and resolved it. In my case it was error due to the non-proper format. Please check the first and last coordinates array in geometry coordinates they must be same then and only then it will work. Hope it may help you!

Regards,  
Rachel Gomez
