Skip to main content
This page describes common issues and how to troubleshoot them.

Preview URLs return a 502 server error

This error occurs when the server running inside the sandbox is binding to localhost. As a result, it is only reachable inside the sandbox; the external preview URL will not be able to access it. To resolve this error, configure your server to bind to IP address 0.0.0.0, so that it listens on all available network interfaces. To avoid IPv4/IPv6 compatibility issues, we recommend using the environment variable HOST instead of setting the address to a static value. For example, in code:
const host = process.env.HOST || '0.0.0.0';
app.listen(3000, host, () => {
  console.log(`Server is running`);
});
or at the command line:
npm serve -- -host 0.0.0.0

Deployment fails with STARTUP TCP probe failed or DEADLINE_EXCEEDED error

This error occurs when the server running inside the sandbox is not binding to the correct host and port. To resolve this error, configure your server to bind to the host and port designated by the HOST and PORT environment variables. Blaxel automatically injects these variables during deployment. For example:
const port = parseInt(env.PORT || "80");
const host = process.env.HOST || "0.0.0.0";
app.listen(port, host, () => {
  console.log(`Server is running`);
});

Models return a 429 error

This error occurs when a model reaches its maximum token limit. To resolve this error, adjust the model’s token usage policy. Token usage policies control the maximum number of tokens your model APIs can handle within a specific time period. You can configure the maximum number of input tokens, output tokens and/or total tokens using these policies.

Volume creation fails with an error

This error occurs when a volume is smaller than the template data. To resolve this error, always provision extra space for your volume beyond the template content size. We recommend provisioning at least 20-30% extra space.

Hot reloads fail on Webpack previews

This error occurs when a Webpack server is configured to use the same port as local development, but the sandbox preview URL is mapped to a different port. As a result, when hot reloading previews, your client is trying to connect to the local development port instead of the sandbox’s preview URL port. To resolve this error, add a conditional in the webSocketURL of your webpack/config.dev.js to handle the different ports:
///... rest of webpack/config.dev.js

module.exports = {
  devServer: {
    host: "::",
    port: 3000,
    allowedHosts: [".bl.run", ".beamlit.net", "localhost", "127.0.0.1"],
    client: {
      webSocketURL: {
        port: process.env.BL_CLOUD === "true" ? 443 : 3000,
      },
    },
    headers: {
      ...
    },
  },
  /// ... est of webpack/config.dev.js