SEPIA-Framework / sepia-docs

Documentation and Wiki for SEPIA. Please post your questions and bug-reports here in the issues section! Thank you :-)
https://sepia-framework.github.io/
237 stars 16 forks source link

[Headless Client Installation Error] sed: can't read /root/clexi/www/sepia/settings.js: No such file or directory #60

Closed Byolock closed 4 years ago

Byolock commented 4 years ago

I Tried to use installation variant 1 out of this documentation : https://github.com/SEPIA-Framework/sepia-installation-and-setup/tree/master/sepia-client-installation/rpi but got 2 errors.

The first one was when running

bash setup.sh

that run.sh was not found in /root/sepia-client/run.sh. Following the install instructions it was in /root/install/sepia-client/run.sh.

So i moved everything inside /root/install/ to /root/ . That way run.sh was found correctly.

If I now use bash setup.sh and choose option 5, enter the ip of my SEPIA Server and press enter I get :

sed: can't read /root/clexi/www/sepia/settings.js: No such file or directory

I've got no folder /root/clexi/ and no idea where these files should come from or where to get them What did i forgot / did wrong?

Byolock commented 4 years ago

Seems Like installation Script was interrupted. It froze at "processin triggers for man-db" but then exited without an error, so for me it looked like it was complete. I just cleaned up the system, and tried the installation a second time and it took a while longer and i got a more proper output at the end of the installation script (DONE!).

The freeze at processing triggers for man-db is more likely an OS issue than anything related to SEPIA Framework so im closing this issue.

fquirin commented 4 years ago

Just a small additional comment, it looks like you're running everything from root. I wouldn't recommend that in general. For the client this might be working but the server for example will break because the database will refuse to start as root (probably an Elasticsearch security feature).

Byolock commented 4 years ago

@fquirin Server is running as the official Docker Container and the docker container has no root privileges on the host so I think its fine on the server side. I have some issues on this client but also with the android app which does not connect successfully so it might be a more general problem. I'm still trying to find out what exactly works and what not in my setup. I think its probably the best to get the App working first, before trying to get the DIY Client working.

fquirin commented 4 years ago

I think its probably the best to get the App working first, before trying to get the DIY Client working.

Yes. I'd recommend to start with the simple browser client because this will allow you to debug via the dev console (F12) ;-)

Byolock commented 4 years ago

That would be this one : https://github.com/SEPIA-Framework/sepia-html-client-app ?

When you've installed SEPIA-Home the default link is: http://[sepia-home-IP]:20721/app/index.html

I've install SEPIA-Home but can't reach the client with this address, I get a 404 Not Found. Wanted to take a look at the nginx error log but can't access it because the admin user has no permission to read the logs.

admin@7e0c249e3d97:/var/log/nginx$ ls -la                                                                      
total 84                                                                                                       
drwxr-xr-x 1 root     adm     38 Jun  7 17:34 .                                                                
drwxr-xr-x 1 root     root   108 Jun  7 17:34 ..                                                               
-rw-r----- 1 www-data adm  74939 Jul 15 11:05 access.log                                                       
-rw-r----- 1 www-data adm   5475 Jul 15 11:05 error.log                                                        
admin@7e0c249e3d97:/var/log/nginx$ tail error.log                                                              
tail: cannot open 'error.log' for reading: Permission denied                                                   
admin@7e0c249e3d97:/var/log/nginx$                                                                             
fquirin commented 4 years ago

That would be this one : https://github.com/SEPIA-Framework/sepia-html-client-app ?

Yes that's the client that is hosted by the SEPIA server (SEPIA Home).

I've install SEPIA-Home but can't reach the client with this address, I get a 404 Not Found.

If I understood your setup correctly than the server is running in a Docker container and you are now trying to access the server from a browser on your host system right? As you already mentioned in the other issue http://[sepia-home-IP]:20721/app/index.html the info on the display can be a bit misleading since the Docker container is usually only forwarding the proxy port 20726 when you use the default command to start it docker run --rm --name=sepia_home -p 20726:20726 -it -v sepia-home-share:/home/admin/SEPIA sepia/home:v2.5.0. This means the correct path to the app should be: http://localhost:20726/sepia/assist/app/index.html (as mentioned in the Docker description section 'Connect').

Did you try to install self-signed SSL certificates inside the Docker container? If that is the case please check out this issue as well.

Byolock commented 4 years ago

I made a simplified drawing to explain my planned Setup. image

My Docker Host is a Synology NAS (for better understanding of the following : its internal IP Address is 192.168.1.10) , it does not have a browser, so i connect from my physical PC (not in drawing) or my Windows Server VM (Im logged into that with RDP).

Regarding the Port Issue I Simply forgot to change it in my answer on github but i actually used the right one to access the html-client-app, sorry for that.

So currently im accessing my Docker Host (NAS) from my Windows Server VM.

I can connect to the SEPIA Control HUB through entering http://192.168.1.10:20726/sepia/assist/tools/index.html#!home

But I can not connect to the html-client-app through entering http://192.168.1.10:20726/app/index.html that gives me an 404 Not Found Error from nginx/1.14.2. That means I reach the Container and the nginx inside it, but nginx can not serve me the html-client-app for some reason.

As already mentioned I also can not view the nginx log file inside the docker container because the admin user of the container has no access to them. Didn't find a way around this issue yet.

Did you try to install self-signed SSL certificates inside the Docker container? If that is the case please check out this issue as well.

No I wanted to keep it as simple as possible (http & ip:port access) till the basics work.

sepia-assistant commented 4 years ago

Thanks for the drawing and explanation :+1:

I can connect to the SEPIA Control HUB through entering http://192.168.1.10:20726/sepia/assist/tools/index.html#!home

But I can not connect to the html-client-app through entering http://192.168.1.10:20726/app/index.html

I see the problem now ^^, when you change the URL from direkt access (port 20721) to proxy (20726) the path changes from :20721/app/ to :20726/sepia/assist/app/, basically the same as in the Control HUB URL just with app instead of tools. That is because the proxy redirects /sepia/assist/ to ..:20721/.

As already mentioned I also can not view the nginx log file inside the docker container because the admin user of the container has no access to them. Didn't find a way around this issue yet.

Did you try something like sudo su? The admin user should be in the sudo group if I remember correctly. You can find the Nginx config (or at least the template) here as well.