What is the cause of Callback Failure?

Hello,

I have been experiencing this since last week I started using Dash.

The app will run for sometime and most time will return` Callback failed: the server did not respond.

The same thing I tried to do when callback failed, will also work at another time after I will restart my pc or restart visual studio.

I will like to get to the bottom of it as it is becoming annoying.

Can someone explain to me what is probably the cause of Callback failure.

Let me give an idea of the app as it is now a big one, I can’t copy the code here.
So, it is an app that plot a graph of data. I have a radio button containing different category of data.
Based on the category you choose such e.g. “Field”,
a dropdown already there will be populated with available field data that can be plotted.

Based on the dropdown, you can select one or more than one plots that you want and a line plot of what you selected will be added to the main content of the app.
So sometimes I experience the callback failure when I try to select a radio button or plots to be plotted.
Sometimes it will plot.

What is the explanation of the callback failure. A link to read up on it will be appreciated too.

Hi @trinityimma :wave:

Unfortunately, there could be many reasons for a callback failure…
My first guess would be that there’s something wrong in the code that made the server shut down.

You can get a lot more information about error messages if you expand the message by simply clicking on it.
You could probably get more info as well on your terminal (or command line) from which you launched your app.

It would also really help if you could share your code.

But if you don’t want to share it, maybe you can start with sharing more info on the error messages :slight_smile:

@jhupiterz ok thanks.

I will look at the error and also try to put the short form of the codes.

@jhupiterz this is what it shows in the error drop down

image

And it shows nothing on the terminal.

Well, I don’t know if this solve the problem but I kind of tried to optimize my code.

So, I had a dropdown of which has its value as an input and the options as an output in one call back.


@app.callback(
    [
        Output('unit-selctd', 'children'),
        Output('unit-selctd-dpdn', 'options'),
        Output('figs-to-plot', 'options')
    ],
    [
        Input('unit', 'value'),
        Input('unit-selctd-dpdn', 'value')
    ]
)

So, maybe that was the cause of the problem because I have separated them into two different callbacks and I have not experience callback failure so far.