I’ve just deployed a new web app developed with Xojo.
It’s hosted as a standalone app in a Ubuntu server with Nginx with SSL are using Posgresql as database server.
When the app is launched manually without daemonization in a SSH session (./xxx), everything works well.
If the app is launched daemonized, the app images are not displayed.
I’m talking about images managed in Xojo (imported in the IDE) and linked to WebImageView controls.
Any ideas ?
Nobody experienced this ?
I have zero knowledge of this environment, however I would ask if your application when daemonised has access to the application resources folder?
@Wayne Golding Thanks for your answer.
I can’t imagine that the daemonised app would have different permissions that the same app not-daemonised.
How could this be checked ?
[quote=433223:@Wayne Golding]I have zero knowledge of this environment[/quote] a built version of a Xojo Project will include the images imported in the /resources folder. I would expect that if that folder was not available the images would be blank or not displayed.
Sorry if you were to build a Windows server I could help more.
Yes, on Linux, there’s a “<app_name> Resources” folder containing all the images.
I’ve checked the permission and they’re correct.
Hopefully you’ll get some help when the Americans wake up. Sorry I couldn’t help more.
Check the process list and see what user the app is actually running as. Does it match the permissions?
The app is running with a user named Ubuntu :
ubuntu 25229 1 0 10:28 ? 00:00:25 ./SteadyBase -d
The app is installed in /home/ubuntu directory and this user has all the permissions.
If it was a permission issue, why does the non-daemonised version work perfectly ?
BTW, the -d parameter is the one I check for daemonising or not.
I’ve checked the process list when not daeminised :
ubuntu 26312 23187 27 11:34 pts/0 00:00:03 ./SteadyBase
could you run ls -al *
on the app’s main directory and post that here?
Here it is :
drwxrwxr-x 6 ubuntu ubuntu 4096 Apr 15 10:00 .
drwxr-xr-x 7 ubuntu ubuntu 4096 Apr 13 20:25 ..
-rwxrw-r-- 1 ubuntu ubuntu 9368768 Apr 19 11:45 SteadyBase
drwxrwxr-x 2 ubuntu ubuntu 4096 Apr 15 10:00 'SteadyBase Libs'
drwxrwxr-x 3 ubuntu ubuntu 4096 Apr 15 10:00 'SteadyBase Resources'
drwxrwxr-x 2 ubuntu ubuntu 4096 Apr 15 10:00 css
drwxrwxr-x 3 ubuntu ubuntu 4096 Apr 15 10:00 scripts
This is probably better
-rwxrwxrwx 1 ubuntu ubuntu 9368768 Apr 19 11:45 SteadyBase
'SteadyBase Libs':
total 45308
drwxrwxr-x 2 ubuntu ubuntu 4096 Apr 15 10:00 .
drwxrwxr-x 6 ubuntu ubuntu 4096 Apr 15 10:00 ..
-rw-rw-r-- 1 ubuntu ubuntu 3094173 Apr 19 10:09 PostgreSQLPlugin64.so
-rw-rw-r-- 1 ubuntu ubuntu 36566632 Apr 19 10:10 XojoConsoleFramework64.so
-rw-rw-r-- 1 ubuntu ubuntu 132493 Apr 19 10:09 libGZip64.so
-rw-rw-r-- 1 ubuntu ubuntu 987893 Apr 19 10:09 libRBCrypto64.so
-rw-rw-r-- 1 ubuntu ubuntu 11980 Apr 19 10:09 libRBInternetEncodings64.so
-rw-rw-r-- 1 ubuntu ubuntu 421974 Apr 19 10:09 libRBRegEx64.so
-rw-rw-r-- 1 ubuntu ubuntu 3085970 Apr 19 10:09 libSSLSocket64.so
-rw-rw-r-- 1 ubuntu ubuntu 2068240 Apr 19 10:09 libc++.so.1
'SteadyBase Resources':
total 1804
drwxrwxr-x 3 ubuntu ubuntu 4096 Apr 15 10:00 .
drwxrwxr-x 6 ubuntu ubuntu 4096 Apr 15 10:00 ..
-rw-rw-r-- 1 ubuntu ubuntu 9721 Apr 19 10:10 appicon128.png
-rw-rw-r-- 1 ubuntu ubuntu 25697 Apr 19 10:10 appicon256.png
-rw-rw-r-- 1 ubuntu ubuntu 1612 Apr 19 10:10 btn_first.png
-rw-rw-r-- 1 ubuntu ubuntu 2061 Apr 19 10:10 btn_first@2x.png
-rw-rw-r-- 1 ubuntu ubuntu 1632 Apr 19 10:10 btn_last.png
-rw-rw-r-- 1 ubuntu ubuntu 2107 Apr 19 10:10 btn_last@2x.png
-rw-rw-r-- 1 ubuntu ubuntu 1616 Apr 19 10:10 btn_next.png
-rw-rw-r-- 1 ubuntu ubuntu 2012 Apr 19 10:10 btn_next@2x.png
-rw-rw-r-- 1 ubuntu ubuntu 1660 Apr 19 10:10 btn_previous.png
-rw-rw-r-- 1 ubuntu ubuntu 2050 Apr 19 10:10 btn_previous@2x.png
-rw-rw-r-- 1 ubuntu ubuntu 1217 Apr 19 10:10 burger.png
-rw-rw-r-- 1 ubuntu ubuntu 1296 Apr 19 10:10 burger@2x.png
-rw-rw-r-- 1 ubuntu ubuntu 4426 Apr 19 10:10 centrale.png
-rw-rw-r-- 1 ubuntu ubuntu 1804 Apr 19 10:10 close_btn.png
-rw-rw-r-- 1 ubuntu ubuntu 2803 Apr 19 10:10 close_btn@2x.png
-rw-rw-r-- 1 ubuntu ubuntu 3797 Apr 19 10:10 close_btn@3x.png
-rw-rw-r-- 1 ubuntu ubuntu 1468 Apr 19 10:10 close_panel.png
-rw-rw-r-- 1 ubuntu ubuntu 2022 Apr 19 10:10 close_panel@2x.png
-rw-rw-r-- 1 ubuntu ubuntu 1810 Apr 19 10:10 delete.png
-rw-rw-r-- 1 ubuntu ubuntu 2954 Apr 19 10:10 delete@2x.png
-rw-rw-r-- 1 ubuntu ubuntu 2206 Apr 19 10:10 delete_btn.png
-rw-rw-r-- 1 ubuntu ubuntu 3919 Apr 19 10:10 delete_btn@2x.png
-rw-rw-r-- 1 ubuntu ubuntu 5533 Apr 19 10:10 delete_btn@3x.png
-rw-rw-r-- 1 ubuntu ubuntu 2436 Apr 19 10:10 favicon.ico
-rw-rw-r-- 1 ubuntu ubuntu 4578 Apr 19 10:10 favicon@2x.ico
drwxrwxr-x 3 ubuntu ubuntu 4096 Apr 15 10:00 fr.UTF-8
-rw-rw-r-- 1 ubuntu ubuntu 9743 Apr 19 10:10 homescreen120.png
-rw-rw-r-- 1 ubuntu ubuntu 12598 Apr 19 10:10 homescreen152.png
-rw-rw-r-- 1 ubuntu ubuntu 4305 Apr 19 10:10 homescreen60.png
-rw-rw-r-- 1 ubuntu ubuntu 5563 Apr 19 10:10 homescreen76.png
-rw-rw-r-- 1 ubuntu ubuntu 2006 Apr 19 10:10 info.png
-rw-rw-r-- 1 ubuntu ubuntu 3010 Apr 19 10:10 info@2x.png
-rw-rw-r-- 1 ubuntu ubuntu 12132 Apr 19 10:10 logo.png
-rw-rw-r-- 1 ubuntu ubuntu 42017 Apr 19 10:10 logo@2x.png
-rw-rw-r-- 1 ubuntu ubuntu 1465 Apr 19 10:10 point_bleu.png
-rw-rw-r-- 1 ubuntu ubuntu 1907 Apr 19 10:10 point_bleu@2x.png
-rw-rw-r-- 1 ubuntu ubuntu 1467 Apr 19 10:10 point_orange.png
-rw-rw-r-- 1 ubuntu ubuntu 1903 Apr 19 10:10 point_orange@2x.png
-rw-rw-r-- 1 ubuntu ubuntu 1740 Apr 19 10:10 send.png
-rw-rw-r-- 1 ubuntu ubuntu 2520 Apr 19 10:10 send@2x.png
-rw-rw-r-- 1 ubuntu ubuntu 1488494 Apr 19 10:10 sky_background.png
-rw-rw-r-- 1 ubuntu ubuntu 2546 Apr 19 10:10 solar_pin.png
-rw-rw-r-- 1 ubuntu ubuntu 2608 Apr 19 10:10 tache_done.png
-rw-rw-r-- 1 ubuntu ubuntu 4110 Apr 19 10:10 tache_done@2x.png
-rw-rw-r-- 1 ubuntu ubuntu 2915 Apr 19 10:10 tache_none.png
-rw-rw-r-- 1 ubuntu ubuntu 4435 Apr 19 10:10 tache_none@2x.png
-rw-rw-r-- 1 ubuntu ubuntu 3493 Apr 19 10:10 tache_progress.png
-rw-rw-r-- 1 ubuntu ubuntu 6076 Apr 19 10:10 tache_progress@2x.png
-rw-rw-r-- 1 ubuntu ubuntu 3238 Apr 19 10:10 tache_stuck.png
-rw-rw-r-- 1 ubuntu ubuntu 5143 Apr 19 10:10 tache_stuck@2x.png
-rw-rw-r-- 1 ubuntu ubuntu 1898 Apr 19 10:10 todo_burger.png
-rw-rw-r-- 1 ubuntu ubuntu 2702 Apr 19 10:10 todo_burger@2x.png
css:
total 12
drwxrwxr-x 2 ubuntu ubuntu 4096 Apr 15 10:00 .
drwxrwxr-x 6 ubuntu ubuntu 4096 Apr 15 10:00 ..
-rw-rw-r-- 1 ubuntu ubuntu 800 Apr 19 10:09 steadybase1.css
scripts:
total 296
drwxrwxr-x 3 ubuntu ubuntu 4096 Apr 15 10:00 .
drwxrwxr-x 6 ubuntu ubuntu 4096 Apr 15 10:00 ..
-rw-rw-r-- 1 ubuntu ubuntu 204224 Apr 19 10:09 jquery-ui.min.js
-rw-rw-r-- 1 ubuntu ubuntu 84247 Apr 19 10:09 jquery.min.js
drwxrwxr-x 5 ubuntu ubuntu 4096 Apr 15 10:00 materialize
Some more details :
- when I start the webapp daemonised using root account, the issue is the same (no images displayed)
- when I start the webapp non-daemonised, the images are displayed (no matter witch user is used)
- when I watch the chrome developper console on the page, the images are all replaced with “https://backoffice.steady-sun.com/framework/spacer.gif” instead of the image’s URL.
Hope this helps finding a solution.
It’s becoming urgent, the app is ready but is not useable actually.
Ok, first of all, all of the files in SteadyBase Libs should be set to 755 instead of 664. I don’t think that’s causing this particular issue, but may bite you later.
This statement is very interesting. That means that the WebPictures aren’t getting loaded at all and the default image is being sent.
Do you happen to know if SELinux is running in Enforcing mode on this server?
I’ve set all the libs permissions to 755.
Enforcing is disabled on this server.
What can I try next to solve this ?
[quote=433315:@ValryTarondeau]I’ve set all the libs permissions to 755.
Enforcing is disabled on this server.
What can I try next to solve this ?[/quote]
I gotta be honest, I’m running out of ideas here.
The only other thing I can think of is that maybe the “current directory” is being set to something else when daemonizing your app.
Could you add some code to your App.Open event to write the contents of
System.EnvironmentVariable("PWD")
to disk somewhere, and see what that is? it should be the directory where the app is running from, but I’m guessing that it’s something else.
@Greg O’Lone Thanks for your time, I appreciate your help even if we’re not there yet.
The PWD is /home/ubuntu/SteadyBase
That’s exactly what was excepted (app directory), I suppose.
Is there any other interesting environnement variable I can check ?
I cant think of any others that would help.
Im assuming that youre daemonizing because you want it to keep running when you log out. Have you considered running the app as a service instead?