Server Edition - PDF/Email Issues

For My Server(win x64) version v25.11.26.3142, PDF, Email and Copy to Clipboard in report is not working.

@lubos Getting this

The pdf only worked when i had to install the chrome manually. It broke later when made it to automatically install the dependencies. Btw this is happening on AMD.

I am also experiencing the same error on Windows OS with Intel processors when clicking the PDF or Email button. This occurs in Manager Desktop when accessed through a browser (Edge or Firefox), but it works fine inside Electron.

Hey,

I’m hosting Manager server edition on an arm64 linux server and I got pdf downloading to work.

You can just install chromium via the distro package manager (since they cross compile it for arm64):

sudo apt update
sudo apt install chromium-browser

Next, you want to tell PuppeteerSharp (the library Manager uses internally) to use this chromium binary by setting it as an environment variable, but you also want to pass certain flags (--no-sandbox --disable-gpu) to the chromium binary so it works, and unfortunately Manager/PuppeteerSharp don’t forward those flags. To get around this you need to create a wrapper script that will open chromium with the required flags.

You can create the file with this command:

sudo tee /usr/local/bin/chromium-wrapper << 'EOF'
#!/bin/bash
exec /snap/bin/chromium --no-sandbox --disable-gpu "$@"
EOF
sudo chmod +x /usr/local/bin/chromium-wrapper

I’m running Ubuntu so apt installs chromium to the /snap/bin folder. If you’re running Debian or something else then it might be installed to /usr/bin/chromium. You can run which chromium or which chromium-browser to find the path and update the command above.

Now you can tell PuppeteerSharp to run chromium-wrapper instead of chromium.

In my case I run Manager as a systemd service, so I updated my service file to:

[Unit]
Description=Manager.io Server
After=network.target

[Service]
Type=simple
User=root
# OUR WRAPPER SCRIPT BELOW
Environment="PUPPETEER_EXECUTABLE_PATH=/usr/local/bin/chromium-wrapper"
ExecStart=/usr/share/manager-server/ManagerServer -port 8080
Restart=always
RestartSec=3

[Install]
WantedBy=multi-user.target

Of-course restart the service and Manager should work :slight_smile:

sudo systemctl daemon-reload
sudo systemctl restart manager-server # your service name

PS: I also have a daily backup script I can share if anyone’s interested. Thank you for the great software!

@_SK Thank you for the detailed steps, have followed the steps but unfortunately there is no change in the error. Still facing the same error.

That’s strange, it makes me think PuppeteerSharp is not opening the correct chromium binary. Can you try running this command to first make sure the arm build of chromium is installed and working:

/snap/bin/chromium --no-sandbox --disable-gpu --headless --dump-dom https://example.com

If that works, then you’re either not setting the environment variable properly (Environment="PUPPETEER_EXECUTABLE_PATH=/usr/local/bin/chromium-wrapper") or for some reason it’s being ignored/overridden by Manager/PuppeteerSharp.

Thanks @_SK.

I tried your setup and it isn’t working. Would you mind having a look to see if you can spot my mistake?

Clicking the PDF button on a sales invoice (or anywhere else) does not cause anything to hit the logs. I watched journalctl --unit=manager-server --follow

It does cause the following javascript error
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading ‘digest’)
at sha256Hex (pdf.js?version=25.11.27.3143:33:38)
at getBlob (pdf.js?version=25.11.27.3143:52:23)
at async getPdf (pdf.js?version=25.11.27.3143:97:22)

Here’s my setup

I’m running 25.11.27.3143 on Debian GNU/Linux 13 (trixie) headless

I tweaked your instructions a bit to fit my setup.

apt update && apt install chromium
which chromium
/usr/bin/chromium

chromium --version
Chromium 142.0.7444.175 built on Debian GNU/Linux 13 (trixie)

/gecko/manager-chromium-wrapper

#!/bin/bash
exec /usr/bin/chromium --no-sandbox --disable-gpu --headless “$@”

I confirmed that /gecko/manager-chromium-wrapper --print-to-pdf https://google.com works

/etc/systemd/system/manager-server.service

[Unit]
After=network.target

[Service]
LimitNOFILE=1048576
Environment=“PUPPETEER_EXECUTABLE_PATH=/gecko/manager-chromium-wrapper”
ExecStart=/srv/manager.io/ManagerServer -port 8088
Restart=on-failure
StartLimitInterval=600

[Install]
WantedBy=multi-user.target

that looks like it’s happening on the client side instead of the server. I found this: https://stackoverflow.com/questions/57146558/typeerror-digest-of-undefined-in-development-environment

The gist of that discussion above is that your browser will only allow some features if you have an SSL certificate on the domain the code is running in.

Are you accessing Manager over HTTP instead of HTTPS? In my setup I have it behind a subdomain through Cloudflare so I can access it via a URL like https://manager.my-website.com.

That was it. Thank you. I’m now running via HTTPS behind a proxy server.

For anyone else watching, none of the other changes were necessary for me. I just needed to run over https.

I have installed a new clean Ubuntu 24.04 ARM64 server just to make sure I am not doing something wrong. Installed latest manager version, nginx and installed ssl certificate. Then I tried above steps but unfortunately same error is appearing on new server.

<h1>Internal Error</h1><hr />Manager 25.12.2.3146<hr /><pre>PuppeteerSharp.ProcessException: Failed to launch browser! 
   at PuppeteerSharp.States.ProcessStartingState.StartCoreAsync(LauncherBase p) in /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/States/ProcessStartingState.cs:line 83
   at PuppeteerSharp.States.ProcessStartingState.StartCoreAsync(LauncherBase p) in /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/States/ProcessStartingState.cs:line 89
   at PuppeteerSharp.Launcher.LaunchAsync(LaunchOptions options) in /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/Launcher.cs:line 77
   at PuppeteerSharp.Launcher.LaunchAsync(LaunchOptions options) in /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/Launcher.cs:line 110
   at ManagerServer.HttpHandlers.Pdf.Post() in /home/runner/work/Manager/Manager/ManagerServer/HttpHandlers/Pdf.cs:line 38
   at ManagerServer.HttpServer.<>c.<<Build>b__0_16>d.MoveNext() in /home/runner/work/Manager/Manager/ManagerServer/HttpServer.cs:line 270
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|7_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.<Invoke>g__Awaited|10_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task)</pre><p><a href="javascript:window.history.back();">Go back</a>

Any solutions yet. As of version 25.12.6.3147 these functions are still not working. Miss the old days.

Am using X64

Any updates regarding this issue ?

Can you try running:

/snap/bin/chromium --no-sandbox --disable-gpu --headless --dump-dom https://example.com

That should at least tell us if chromium is working on your server or not.
Note: it might not be installed at /snap/bin/chromium. See my previous posts in this thread to find out how to find where your chromium binary is installed.

This is the message while running the above command:

ubuntu@mncuae:~$ /snap/bin/chromium --no-sandbox --disable-gpu --headless --dump-dom https://example.com
TU: error: ../src/freedreno/vulkan/tu_knl.cc:385: failed to open device /dev/dri/renderD128 (VK_ERROR_INCOMPATIBLE_DRIVER)
[237820:237820:1212/103353.778072:ERROR:dbus/object_proxy.cc:573] Failed to call method: org.freedesktop.DBus.ListActivatableNames: object_path= /org/freedesktop/DBus: org.freedesktop.DBus.Error.AccessDenied: An AppArmor policy prevents this sender from sending this message to this recipient; type=“method_call”, sender=“:1.2” (uid=1001 pid=237820 comm=“/snap/chromium/3323/usr/lib/chromium-browser/chrom” label=“snap.chromium.chromium (enforce)”) interface=“org.freedesktop.DBus” member=“ListActivatableNames” error name=“(unset)” requested_reply=“0” destination=“org.freedesktop.DBus” (bus)
[237820:237820:1212/103353.786383:ERROR:dbus/object_proxy.cc:573] Failed to call method: org.freedesktop.DBus.ListActivatableNames: object_path= /org/freedesktop/DBus: org.freedesktop.DBus.Error.AccessDenied: An AppArmor policy prevents this sender from sending this message to this recipient; type=“method_call”, sender=“:1.2” (uid=1001 pid=237820 comm=“/snap/chromium/3323/usr/lib/chromium-browser/chrom” label=“snap.chromium.chromium (enforce)”) interface=“org.freedesktop.DBus” member=“ListActivatableNames” error name=“(unset)” requested_reply=“0” destination=“org.freedesktop.DBus” (bus)
[237820:237820:1212/103353.792431:ERROR:dbus/object_proxy.cc:573] Failed to call method: org.freedesktop.DBus.ListActivatableNames: object_path= /org/freedesktop/DBus: org.freedesktop.DBus.Error.AccessDenied: An AppArmor policy prevents this sender from sending this message to this recipient; type=“method_call”, sender=“:1.2” (uid=1001 pid=237820 comm=“/snap/chromium/3323/usr/lib/chromium-browser/chrom” label=“snap.chromium.chromium (enforce)”) interface=“org.freedesktop.DBus” member=“ListActivatableNames” error name=“(unset)” requested_reply=“0” destination=“org.freedesktop.DBus” (bus)
[237820:237820:1212/103353.827048:ERROR:dbus/object_proxy.cc:573] Failed to call method: org.freedesktop.DBus.Properties.GetAll: object_path= /org/freedesktop/UPower/devices/DisplayDevice: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files

Example Domainbody{background:#eee;width:60vw;margin:15vh auto;font-family:system-ui,sans-serif}h1{font-size:1.5em}div{opacity:0.8}a:link,a:visited{color:#348}

Example Domain

This domain is for use in documentation examples without needing permission. Avoid use in operations.

Learn more

Hi guys, Gemini provide me “fix” on these issues and I would like to share.…(I know NTH about coding or networking, such fix may be look “stupid” but at lease it works for me).

1. Run as an Application (.exe) First

If you usually run Manager as a Windows Service (starting automatically in the background), the PDF engine might fail to download because services often lack “user permissions” to access the internet or write to local folders.

  • Action: 1. Stop your Manager Service. 2. Open your server folder and double-click ManagerServer.exe manually (as shown in your previous screenshot). 3. Open your browser, go to an invoice, click PDF (and wait for up to 60 seconds). 4. Once the PDF generates successfully, you can close the window and go back to running it as a service.

2: The “Quick Fix” for Client Browsers

The reason it works on the Server Side but not the Client Side is due to a security setting in modern web browsers (Chrome, Edge, etc.) called “Secure Contexts.”

Why is this happening?

The new PDF generator uses a specific JavaScript function (crypto.subtle.digest) to process the PDF. For security, browsers only allow this function to run in a “Secure Context”:

  1. On the Server: Browsers automatically treat localhost as secure. This is why it works there.

  2. On the Client Side: When Client or others access the server via an IP address (e.g., http://192.168.1.10:5000), the browser sees it as an “Insecure Context” because it is http and not https. It then blocks the PDF script from running.

You can tell the browsers on the client computers to trust your server’s IP address. Follow these steps on each computer that needs to access Manager:

  1. Open Chrome or Edge on the client computer.

  2. In the address bar, type: chrome://flags/#unsafely-treat-insecure-origin-as-secure (or edge://flags/... for Edge).

  3. Find the setting “Insecure origins treated as secure”.

  4. Set it to Enabled.

  5. In the text box below it, type your server’s URL, for example: http://192.168.1.10:5000

  6. Click Relaunch at the bottom of the browser.

The PDF button should now work perfectly on that computer.

Hi, all.

I was finally able to fix this issue as well. I wish I saw the solution provided by Leung_KS just 1 day sooner, but I didn’t, so I went with a complex Linux fix.

By the way, I found that the “Copy to clipboard” features are also impacted, which I need for third party accounting firms. So, this fix for many people might be more of a “MUST” than just being a nice feature.

So just to share a bit of my experience: The main issues are:

  1. Manager Server needs to run as HTTPS for the browser interaction to work correctly (PDF/Mail). Fixing this is the most complex part, but using Linux (Linux Mint for me) made some parts of it easier than on MS Windows. I failed at getting simple Windows tools to work, like Caddy, used to do the whole HTTPS certificate thing.
  2. Chromium headless. This is not as simple on Linux, but much easier to fix than the HTTPS issue.

It took me about an hour and a lot of AI help to sort this out, so I’m not going to elaborate on it right now. If anyone would like me to paste a high-level overview of my process here, feel free to let me know. In short, my final setup runs as https://myIPAddress:5000 (Not localhost, not 127.0.0.1 if you want to use other computers on the network)

Good day to you all!

Good news!! After days of troubleshooting I got the fix specific for Ubuntu 24.04 ARM64 server (email & PDF issue). below are the steps provided by Gemini which fixed the issue:

The Fix: Install the Native ARM64 (Non-Snap) Chromium

We will use a trusted PPA that provides a real, non-Snap version of Chromium for ARM64.

1. Add the PPA and Install

Run these commands to get a version of Chromium that doesn’t use Snap:

Bash

sudo add-apt-repository ppa:xtradeb/apps -y
sudo apt update
sudo apt install -y chromium

2. Verify the New Path

After installation, check where the new binary is:

Bash

which chromium

It should return /usr/bin/chromium.

3. Update the Managerio Service

Now, update your service file to use this specific binary and the “headless” flags required for your ARM64 server.

sudo nano /etc/systemd/system/managerio.service

Set the Environment lines exactly like this:

Ini, TOML

Environment=HOME=/opt/managerio
Environment="PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium"
Environment="PUPPETEER_EXECUTABLE_PATH_ARGS=--headless --no-sandbox --disable-setuid-sandbox --disable-dev-shm-usage --disable-gpu --remote-debugging-port=9222"

4. Critical: Grant the “Unconfined” Permission

Because Ubuntu 24.04 is very strict about browsers, you must tell the kernel that the managerio user is allowed to run this browser engine:

Bash

sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
echo "kernel.apparmor_restrict_unprivileged_userns=0" | sudo tee /etc/sysctl.d/60-apparmor-namespace.conf

5. Apply and Restart

Bash

sudo systemctl daemon-reload
sudo systemctl restart managerio

I was having the PDF problem (Manager 25.12.21.3153)

After much trial and error, I got PDF generation working in a Docker container. You don’t need to install Chrome itself - PuppeteerSharp downloads its own Chrome binary. What you need are the system libraries that Chrome depends on.

Two things are required:

  1. Install Chrome’s dependencies (not Chrome itself):
    apt-get install -y
    libglib2.0-0 libnss3 libnspr4 libatk1.0-0 libatk-bridge2.0-0
    libcups2 libdrm2 libdbus-1-3 libxcb1 libxkbcommon0 libx11-6
    libxcomposite1 libxdamage1 libxext6 libxfixes3 libxrandr2
    libgbm1 libpango-1.0-0 libcairo2 libasound2 libatspi2.0-0
    libwayland-client0 fonts-liberation

  2. Run Manager as a non-root user:

Chrome refuses to run as root (you’ll get “Running as root without --no-sandbox is not supported”). Create a dedicated user and run Manager as that user.

If you’re getting errors about missing .so files like libglib-2.0.so.0, you’re missing the dependencies. If you’re getting the “no-sandbox” error, you’re running as root.

Hope this helps someone - took me a while to figure out!

Got it! Using a binary wrapper and missing libraries.

My Setup

  • Debian 10.13
  • Manager 26.1.5.3159 running as root via service
  • nginx proxy with custom port, own domain and ssl

Brief

Details

  1. Install missing libraries
root:~# apt install libglib2.0-0 libnss3 libnspr4 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 libdbus-1-3 libxcb1 libxkbcommon0 libx11-6 libxcomposite1 libxdamage1 libxext6 libxfixes3 libxrandr2 libgbm1 libpango-1.0-0 libcairo2 libasound2 libatspi2.0-0 libwayland-client0 fonts-liberation
  1. Create wrapper
    Note: I’m using native Puppeteer auto-downloaded binary chrome
root:~# vim manager-crome-wrapper
#!/bin/bash
exec /root/.local/share/PuppeteerSharp/Chrome/Linux-138.0.7204.101/chrome-linux64/chrome --no-sandbox --disable-gpu --headless "$@"
  1. Make wrapper executable
root:~# chmod +x manager-crome-wrapper
  1. Test
root:~# /root/manager-crome-wrapper --dump-dom https://example.com
root:~# /root/manager-crome-wrapper --print-to-pdf https://example.com
  1. Modify the service to use the wrapper
    Note: Environment SHOULD go BEFORE ExecStart
root:~# vim /etc/systemd/system/manager-server.service
[Service]
Environment="PUPPETEER_EXECUTABLE_PATH=/root/manager-crome-wrapper"
ExecStart=/usr/share/manager-server/ManagerServer -port 0000
  1. Restart daemon & service
root:~# systemctl daemon-reload
root:~# systemctl restart manager-server.service
  1. Done:
    :check_box_with_check: PDF working
    :check_box_with_check: Email with PDF preview and as atachment working
    :check_box_with_check: Copy to clipboard working

thanks to all for comments, help and details, reading all comments allow me to adapt the solution to my env.