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

puppeteer not working on runtime v4 and nodejs 16 #815

Closed
johnayoub opened this issue Nov 23, 2022 · 12 comments
Closed

puppeteer not working on runtime v4 and nodejs 16 #815

johnayoub opened this issue Nov 23, 2022 · 12 comments

Comments

@johnayoub
Copy link

johnayoub commented Nov 23, 2022

I was previously able to run puppeteer on runtime v3. however, when upgrading to v4 I encountered missing dependencies. running ldd on chrome returns the following:

  • libatk-bridge-2.0.so.0 => not found
  • libdrm.so.2 => not found
  • libatspi.so.0 => not found
  • libgbm.so.1 => not found
  • libxkbcommon.so.0 => not found
  • libasound.so.2 => not found

I'm using the App Service plan version not consumption which was working as of V3.

@johnayoub
Copy link
Author

@CooperLink @pragnagopa could you check please why V4 Node is missing those dependencies?

@CooperLink
Copy link
Collaborator

Thank you for filing @johnayoub . Could you please let me know how your app was setup on v3? Specifically which Node version were you using. I will investigate this now.

@johnayoub
Copy link
Author

@CooperLink I can confirm that both node 12 & 14 work on V3. We are using Linux with an app service plan.

@CooperLink
Copy link
Collaborator

Alright thank you John, as of now we don't have plans to include Puppeteer dependencies in the v4 node images. We will discuss adding them in our January release. I am going to leave the issue open for now. In general, we try not to include dependencies unrelated to functions in the images. But, we will evaluate this case.

In the meantime, another possible solution would be to create a custom image using the instructions here. You could add the necessary puppeteer dependencies to the existing v4 images using this. I understand this takes engineering work and I will keep you updated here after the holidays with any changes to the plan
https://learn.microsoft.com/en-us/azure/azure-functions/functions-create-function-linux-custom-image?tabs=in-process%2Cbash%2Cazure-cli&pivots=programming-language-typescript

@johnayoub
Copy link
Author

@CooperLink Yes, we currently cannot upgrade to V4 and are blocked by those missing dependencies as they were available in V3 and this is now a breaking change. I understand that we can use a custom image but would really like to avoid using them in this case. I already see that the dependencies are commented out in the docker file and one of the PRs was meant to add it back. Please see the following issue. Also, this was advertised by @anthonychu in a blog post so I'm not sure why the change in direction. Will wait to hear from you after the holidays. Thanks!

@rvdlaarschot
Copy link

rvdlaarschot commented Dec 5, 2022

I am running into the same issue with Node 14 on Elastic Premium 1 plan for V4. Consumption plan works just fine on Node 14 with V4. On V3 both consumption and elastic premium plans work without issues. This seems like an inconsistency?
This is breaking for our production environment and with the upcoming deprecation of V3 we would like to be able to transition to V4 smoothly on our elastic premium plan as well.
The libs that were missing for me were:

  • libgobject-2.0-0
  • libnss3
  • libatk1.0-0
  • libatk-bridge2.0-0
  • libx11-xcb1
  • libcups2
  • libdrm2
  • libgtk2.0-0
  • libxkbcommon-x11-0
  • libgtk-3-0
  • libgbm-dev
  • libasound2

@CooperLink
Copy link
Collaborator

Thank you for filing Ramon. I am collecting information about this for our meeting on it in January. I will keep the issue open to collect more feedback. I will update this issue when I have more information

@jinsiltwo
Copy link

Same issue here. Luckily I'm not the only one who faced the same issue.

@nippoolg
Copy link

nippoolg commented Jan 30, 2023

Same here, stopped working after switching to Runtime 4. Node 14 or Node 16 no matter, fails in both cases. Node 14 EOL is pretty soon, so have to update to Runtime 4.

I see these dependencies added in this commit to older node version: https://github.com/Azure/azure-functions-docker/pull/225/files

Any status update about that?

@CooperLink
Copy link
Collaborator

Brief update here : our team is currently discussing bringing these dependencies back into the images. I cannot say anything for certain at this time. But, it looks like we will bring back these dependencies starting in the next Linux Docker Image release 4.16.0. Sorry for the inconvenience and I will update this thread when I have more certain information.

@CooperLink
Copy link
Collaborator

Happy to announce that the Chrome Headless dependencies have been added to the v4 node Functions images. They should be available as a result of our next release 4.16.0. My projected timeline for that is mid February with full release by March. If anyone would like to test with the image you can do a Docker Build on the node14.Dockerfile or other versions.

One callout for the future, we will not be including these dependencies in Functions v5 releases. In the future, custom use cases like this will likely require custom images.

@nippoolg
Copy link

@CooperLink Are these dependencies available only when using the image? I'm not using explicitely image, but deploying code as zip package to function environment.

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

5 participants