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

Stop creation of log and tmp folder #501

Open
bhavya0901 opened this issue Mar 27, 2024 · 10 comments
Open

Stop creation of log and tmp folder #501

bhavya0901 opened this issue Mar 27, 2024 · 10 comments

Comments

@bhavya0901
Copy link

bhavya0901 commented Mar 27, 2024

Actual behaviour
highcharts-export-server create log and tmp folder during chart image download process but kubernetes does not allow to create a folder like this.

Expected behaviour
chart image will download without creation log and tmp folder.

I think after adding options.logging.level = 0 log folder not created, same as log folder which code require to stop creation of tmp folder

const exportSettings = {
          export: {
            type: "png",
            options: report_config.data,
          },
        };
        
        const options = exporter.setOptions(exportSettings);
        options.logging.level = 0 // to remove log folder when image download
        await exporter.initPool(options);
        
        exporter.startExport(exportSettings, async function (res, err) {
          if (err) {
            log.info("Error in exporting chart : " + err); // error comes from here when code deployed on live server
            return resp.status(500).send({ msg: err.message });
          }
          log.info("buffer data getting")
          const binaryData = Buffer.from(res.data, "base64");
          exporter.killPool();

I've write above code to get chart image and it's perfectly working fine in my local but I'm getting In pool.postWork: [pool] Error when acquiring available entry: Error when code deployed on live server

I think tmp folder doesn't created on live server and due to this reason I'm getting this error may be Kubernetes does not allow to create tmp folder on live server

Do you have any solution to resolve this issue ?

@jszuminski
Copy link
Contributor

Thanks for reporting @bhavya0901!

Puppeteer requires a directory like /tmp. After all the prioritized issues related to server health are fixed, we will consider adding an option which would allow you to change that directory.

In the meantime, if possible, adjust your Kubernetes deployment to allow the creation of temporary folders. This might involve modifying security policies or the filesystem to permit such actions. This approach is pretty straightforward and acts as a good workaround.

@bhavya0901
Copy link
Author

Thank you for answering my question @jszuminski

Hope soon you will adding an option which would allow us to change tmp directory.

@bhavya0901
Copy link
Author

bhavya0901 commented Apr 15, 2024

Thanks for reporting @bhavya0901!

Puppeteer requires a directory like /tmp. After all the prioritized issues related to server health are fixed, we will consider adding an option which would allow you to change that directory.

In the meantime, if possible, adjust your Kubernetes deployment to allow the creation of temporary folders. This might involve modifying security policies or the filesystem to permit such actions. This approach is pretty straightforward and acts as a good workaround.

Hi @jszuminski
Have you added option which would allow us to change that directory ? Is any update on it ?

@jszuminski
Copy link
Contributor

jszuminski commented May 16, 2024

Hi @bhavya0901, we have not yet added this option. We're currently working on improving the performance and health of the Export Server before the next release (which is going to be a major change). We will get back to your feature request once all the prioritized issues are solved (upcoming months).

I will keep you posted.

@bhavya0901
Copy link
Author

Hi @jszuminski

Thank you for the update. I understand that improving the performance and health of the Export Server is a priority right now. I appreciate your diligence in addressing these issues first. Looking forward to hearing back about the feature request once the current priorities are resolved.

@mikemeerschaert
Copy link

In the meantime, if possible, adjust your Kubernetes deployment to allow the creation of temporary folders. This might involve modifying security policies or the filesystem to permit such actions. This approach is pretty straightforward and acts as a good workaround.

This is unfortunately not an option with AWS Lambda so the Highcharts export server is incompatible with lambda until the ability to change the temp folder location has been added.

@bhavya0901
Copy link
Author

Hi @jszuminski ,
Any update on this enhancement?

1 similar comment
@bhavya0901
Copy link
Author

Hi @jszuminski ,
Any update on this enhancement?

@nhitchins
Copy link

nhitchins commented Jul 23, 2024

@bhavya0901 You can specify the tmp directory using puppeteer args in export settings

"puppeteer": { "args": ["--user-data-dir=./new-puppeteer-tmp-path"] },

@DanielRuf
Copy link

DanielRuf commented Aug 26, 2024

Waiting for a path setting which is for logs and tmp folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants