Not sure whether this is a Web question or a Linux question.
I’ve created a web app using Xojo 2020r2.1 and after rolling out am getting trouble from a list box.
When I run the app as a non root user I get an unhandled exception. Copied below.
The app is self contained and the fault appears to be caused by populating a list box.
The list box appears empty in the browser.
When I run the app as a root user all is well.
Anyone know what I need to grant to the non-root user to avoid the exception.
Unless the web app is trying to use privileged ports it arguably should not require root user. This doesn’t read like its related to listening ports…
My preference would be that you create a new issue to report this as a bug so that it can be fixed.
As a workaround, double check that the user you are running with can write into the temporary location. If not, pass an --UploadPath you can write to. With Lifeboat use the “Manage --UploadPath” switch on the Options tab to do so with one click.
If the stream can not be opened as requested, an IOException will be raised. For instance, this will happen if the file is already opened for writing, or if the app (its user) has no permission to modify this file or to create a file in the affected directory.
Not speculation. The http backend automatically creates a buffer in memory for small payloads and on disk for large payloads. Binary streams are used in both cases for compatibility, flexibility and speed. By default, they are created in the tmp directory.
Here’s what I suggest, go to the tmp directory on the machine and check to see if the temp files for Xojo are put in a folder and if so, what the permissions are. If the owner and group are set to root:root, change the permissions on the folder so that anyone can read, write & execute with:
chmod 777 <Xojo temp dir>
I just can’t remember off the top of my head and it’s too late to check
Thanks @Greg_O and @Tim_Parnell for providing the clues to track down the issue.
The framework is creating a directory in /tmp with the listening port number prefixed by an underscore.
Eg. /tmp/_8080
When the process is terminated this folder is not deleted.
After uploading the app to the server I originally tested it using sudo. So, the _8080 directory was created by root. When I restarted as a normal user the process lacked the permission to write to the _8080 directory. The fix is simply to delete the _8080 directory and allow the framework to recreate it when the web app is started.
Some additional details which may or may not be related.
The web app is being started with nohup.
The web app uses an Audio Player control. As far as I can tell the _8080 folder is created when the audio file is retrieved from it’s URL.
The app is a quick and dirty bit of fluff. Nothing I want starting automatically with the server. It won’t last long enough for the certificate to be renewed.
It’s a learning tool to help me with an amateur radio exam I’ll be taking in a month or so. Feel free to take a look. qcodes dot emsnet dot uk