Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server fails at startup with timeout (AVV_ERR_PLUGIN_EXEC_TIMEOUT) #156

Open
2 tasks done
chrisbenincasa opened this issue Jun 19, 2024 · 2 comments
Open
2 tasks done

Comments

@chrisbenincasa
Copy link

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Fastify version

4.26.0

Plugin version

4.0.0

Node.js version

20.11.1

Operating system

Linux

Operating system version (i.e. 20.04, 11.3, 10)

6.6.16-linuxkit

Description

This was forwarded to me from a user of an app I maintain (original issue): chrisbenincasa/tunarr#550

This happened to the user before when the app used an earlier version of this plugin. I have since bumped the version and this issue has come back. I am unable to reproduce it unfortunately, so I don't have a lot more detail to provide. It does seem like swagger-ui gets into a state where it simply cannot start, because once the user hits the error, they are unable to start the server at all. Any thoughts on what could prevent the done callback from firing? Or is there a way we could enable/add extra logging to see the cause here?

FastifyError [Error]: Plugin did not start in time: '@fastify/swagger-ui'. You may have forgotten to call 'done' function or to resolve a Promise
    at Timeout._onTimeout (file:///tunarr/server/build/bundle.js:181438:35)
    at listOnTimeout (node:internal/timers:573:17)
    at process.processTimers (node:internal/timers:514:7) {
  code: 'AVV_ERR_PLUGIN_EXEC_TIMEOUT',
  statusCode: 500,
  fn: <ref *1> [AsyncFunction: fastifySwaggerUi] {
    default: [Circular *1],
    fastifySwaggerUi: [Circular *1],
    [Symbol(skip-override)]: true,
    [Symbol(fastify.display-name)]: '@fastify/swagger-ui',
    [Symbol(plugin-meta)]: {
      fastify: '4.x',
      name: '@fastify/swagger-ui',
      dependencies: [Array]
    }
  }
}

Link to code that reproduces the bug

No response

Expected Behavior

No response

@chrisbenincasa chrisbenincasa changed the title Server fails at startup with Server fails at startup with timeout (AVV_ERR_PLUGIN_EXEC_TIMEOUT) Jun 19, 2024
chrisbenincasa added a commit to chrisbenincasa/tunarr that referenced this issue Jun 19, 2024
We've seen reports like
#550 where swagger-ui
prevents the server from starting, permanently. I haven't been able to
reproduce this yet. We've opened an issue on the plugin repo to see if
they have ideas:
fastify/fastify-swagger-ui#156

For now, we're not really in need of this anyway, so just remove it.

I've also updated a bunch of deps and shimmed in the "DOM" types in our
tsconfig since there are lots of errors when compiling during the lib
check phase for things like esbuild, vitest.
chrisbenincasa added a commit to chrisbenincasa/tunarr that referenced this issue Jun 19, 2024
We've seen reports like
#550 where swagger-ui
prevents the server from starting, permanently. I haven't been able to
reproduce this yet. We've opened an issue on the plugin repo to see if
they have ideas:
fastify/fastify-swagger-ui#156

For now, we're not really in need of this anyway, so just remove it.

I've also updated a bunch of deps and shimmed in the "DOM" types in our
tsconfig since there are lots of errors when compiling during the lib
check phase for things like esbuild, vitest.
@mcollina
Copy link
Member

It appears you are doing some bundling. fastify-swagger-ui assumes to be able to read from the file system to load some of the styles/html files. You should be able to tune your bundler to do so.

@chrisbenincasa
Copy link
Author

The files are included in the file bundle / container. Generally, we've found that the plugin works in the bundle for some time and then somehow can get corrupted. Do you think this could be from a missing file or if the target directory changes somehow?

chrisbenincasa added a commit to chrisbenincasa/tunarr that referenced this issue Jun 22, 2024
We've seen reports like
#550 where swagger-ui
prevents the server from starting, permanently. I haven't been able to
reproduce this yet. We've opened an issue on the plugin repo to see if
they have ideas:
fastify/fastify-swagger-ui#156

For now, we're not really in need of this anyway, so just remove it.

I've also updated a bunch of deps and shimmed in the "DOM" types in our
tsconfig since there are lots of errors when compiling during the lib
check phase for things like esbuild, vitest.
markdavella pushed a commit to markdavella/tunarr that referenced this issue Jun 24, 2024
…asa#551)

We've seen reports like
chrisbenincasa#550 where swagger-ui
prevents the server from starting, permanently. I haven't been able to
reproduce this yet. We've opened an issue on the plugin repo to see if
they have ideas:
fastify/fastify-swagger-ui#156

For now, we're not really in need of this anyway, so just remove it.

I've also updated a bunch of deps and shimmed in the "DOM" types in our
tsconfig since there are lots of errors when compiling during the lib
check phase for things like esbuild, vitest.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants