Many of our clients use FileMaker WebDirect to give users access to their FileMaker apps via browser. In the recent days of Claris’s FileMaker Server 19.5.1 and 19.5.2 (specifically on Ubuntu 20.04 / Nginx) releases we had a number of FileMaker hosting support tickets regarding WebDirect timeout issues.

The WebDirect Error

Notice the message at the end: Invalid JSON from server: 1|X

If your WebDirect session was set to log out in less than 40 minutes, you may not have seen this error.If you changed the settings for an extended login time, greater than 40 minutes in 19.5.1 and greater than 80 minutes in 19.5.2, you surely would have noticed.

A post in the Claris Community Pages discusses how you can modify the wpe.prefs file to get around the maximum 60-minute timeout that the FileMaker Admin Console imposes on WebDirect Connections.

In our case, our users specified 480 minutes or 28800000 ms, and prior to the Nginx change, this worked.

Testing FileMaker WebDirect Timeout

We adjusted the /opt/FileMaker/FileMaker Server/Web Publishing/publishing engine/conf/wpe.prefs line: 14 (server/parameters/config/iwp-session-timeout) to 28800000 (8 Hours).

We tested in 19.5.1 and 19.5.2 and saw different max timeout times.

FileMaker Server 19.5.1: 2500000 ms or 41.66 minutes

FileMaker Server 19.5.2: 5000000 ms or 83.2 minutes

In the browser developer tools and console, we saw the following warning:

Websocket closed, reason: Connection was closed abnormally (that is, with no close frame being sent). – wasClean: false

log @ vaadinPush.js?v=8.12.3.fmi:1

warn @ vaadinPush.js?v=8.12.3.fmi:1

ax.onclose @ vaadinPush.js?v=8.12.3.fmi:1

Note that once this warning occurs the web page creates new WebSocket connections at the URI: /fmi/webd/PUSH

wss://server.fqdn.com/fmi/webd/PUSH?v-uiId=3&v-pushId=413193e2-e78c-4d5e-825e-b0054445aa72&X-Atmosphere-tracking-id=e6ff4fcc-68f7-44ac-b6a0-5db28e9943cf&X-Atmosphere-Framework=2.3.2.vaadin1-javascript&X-Atmosphere-Transport=websocket&X-Atmosphere-TrackMessageSize=true&Content-Type=application/json;%20charset=UTF-8&X-atmo-protocol=true

The Communication Issue

The communication is timing out to the back-end Tomcat service, which is utilizing something called Long Polling.

According to other sources referencing Load Balancers and Vaadin Push, we were able to determine that the issue is related to a Load Balancer or Reverse Proxy (Nginx is the reverse proxy in this case) timing out the WebSocket connection after the aforementioned timeouts.

The Workaround for FileMaker WebDirect

In order to avoid the communication error, we edited the Nginx conf located here: /opt/FileMaker/FileMaker Server/NginxServer/conf/fms_nginx.conf

In the server block we added a directive: proxy_read_timeout 86400. Then we saved and rebooted.

After this, we noted that FileMaker Server 19.5.1/19.5.2 running on Ubuntu 20.04 (Nginx) then obeyed the iwp-session-timeout in the wpe.prefs without issue.

**Please note: there is a reason Claris sets the max timeout in the FileMaker Server Admin Console UI to 60 minutes. When sessions run for long periods of time, WebDirect can cause a memory leak and require a cycle every so many hours. It is best practice to change your workflow to function within the 60 minute timeout period or setup automations to cycle the scripting engine. There are also security concerns leaving a web session logged in for long periods of time.**

FileMaker WebDirect and Ottomatic

At Proof+Geist, we know that the Claris platform is a key puzzle piece to any business tech ecosystem. And having a sturdy cloud hosting platform is a must-have in a world where innovation is constantly happening in the cloud. That’s why we created Ottomatic, a worldwide, low latency hosting platform crafted to make your FileMaker apps soar.

With our world-class hosting platform, professional development tools, and expertise in both Claris FileMaker and web technologies, Proof+Geist is ready to innovate and help support your business.

Learn more about the Modern FileMaker Revolution.