Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirected to yunohost main page #2

Open
lapineige opened this issue Dec 20, 2022 · 28 comments
Open

Redirected to yunohost main page #2

lapineige opened this issue Dec 20, 2022 · 28 comments
Labels
help wanted Extra attention is needed

Comments

@lapineige
Copy link
Member

lapineige commented Dec 20, 2022

When I enter any URL, I'm sent back to Yunohost main page (SSO).
It's as if I was asking for the wrong webpage and then it redirects me… But it's a public app so it should not be blocking any subpage…

@wasi-master do you know what might be wrong in my Nginx config or so ?

@lapineige lapineige changed the title Redirect to yunohost main page Redirected to yunohost main page Dec 20, 2022
@emiliien
Copy link

Same probleme here.

@wasi-master
Copy link

I don't really know why it's happening 🤔

@lapineige
Copy link
Member Author

How can I help you to debug this ?

@dotInTheWind
Copy link

Hi,

Same problem here.

In the admin panel, the service "13ft" is down. Here is the error message:

janv. 26 12:43:06 systemd[1]: Started 13ft launcher service.
janv. 26 12:43:06 systemd[446]: 13ft.service: Failed to set up standard output: No such file or directory
janv. 26 12:43:06 systemd[446]: 13ft.service: Failed at step STDOUT spawning /var/www/13ft/venv/bin/python3: No such file or directory
janv. 26 12:43:08 systemd[1]: 13ft.service: Main process exited, code=exited, status=209/STDOUT
janv. 26 12:43:08 systemd[1]: 13ft.service: Failed with result 'exit-code'.
janv. 26 12:58:49 systemd[1]: Started 13ft launcher service.
janv. 26 12:58:49 systemd[11060]: 13ft.service: Failed to set up standard output: No such file or directory
janv. 26 12:58:49 systemd[11060]: 13ft.service: Failed at step STDOUT spawning /var/www/13ft/venv/bin/python3: No such file or directory
janv. 26 12:58:49 systemd[1]: 13ft.service: Main process exited, code=exited, status=209/STDOUT
janv. 26 12:58:49 systemd[1]: 13ft.service: Failed with result 'exit-code'.

@lapineige
Copy link
Member Author

lapineige commented Jan 28, 2023

Failed at step STDOUT spawning /var/www/13ft/venv/bin/python3: No such file or directory

Uh wait what ?
It should be there 🤔

What's the result of /var/www/13ft/venv/bin/python3 /var/www/13ft/index.py ?

Can you try to install/upgrade to this branch ? #6

@dotInTheWind
Copy link

dotInTheWind commented Jan 28, 2023

What's the result of /var/www/13ft/venv/bin/python3 /var/www/13ft/index.py ?

Traceback (most recent call last):
  File "/var/www/13ft/index.py", line 2, in <module>
    import requests
ModuleNotFoundError: No module named 'requests'

Can you try to install/upgrade to this branch ? #6

Sorry, I'm not a github expert. What URL should I use to update from this branch?

Edit: upgrading from https://github.com/YunoHost-Apps/13ft_ynh/tree/testing makes the error message disappear. But doesn't solve the first problem as you noticed.

@lapineige
Copy link
Member Author

Ok, so we have the same issue.
The branch you tested, and that I just merged (normal upgrade will do now :).

The service is now working, but I don't know what the issue…

@wasi-master
Copy link

wasi-master commented Jan 29, 2023

The 13ft code is very simple, I do not see any reasons that this should happen. You could try adding some print statements in between the code (in the file used for yunohost) and then see what happens.

https://github.com/wasi-master/13ft/blob/main/index.py

@emiliien
Copy link

i'have this logs

-- Journal begins at Sun 2022-12-04 21:17:01 CET, ends at Sun 2023-01-29 22:48:31 CET. -- janv. 24 22:55:27 systemd[1]: Started 13ft launcher service. janv. 24 22:55:27 systemd[157494]: 13ft.service: Failed to set up standard output: No such file or directory janv. 24 22:55:27 systemd[157494]: 13ft.service: Failed at step STDOUT spawning /var/www/13ft/venv/bin/python3: No such file or directory janv. 24 22:55:27 systemd[1]: 13ft.service: Main process exited, code=exited, status=209/STDOUT janv. 24 22:55:27 systemd[1]: 13ft.service: Failed with result 'exit-code'. -- Boot 9f5953ab12ce41568375fe76aaa64bc7 -- janv. 29 22:45:16 systemd[1]: Started 13ft launcher service. janv. 29 22:45:16 systemd[665195]: 13ft.service: Failed to set up standard output: No such file or directory janv. 29 22:45:16 systemd[665195]: 13ft.service: Failed at step STDOUT spawning /var/www/13ft/venv/bin/python3: No such file or directory janv. 29 22:45:16 systemd[1]: 13ft.service: Main process exited, code=exited, status=209/STDOUT janv. 29 22:45:16 systemd[1]: 13ft.service: Failed with result 'exit-code'.

@lapineige lapineige added the help wanted Extra attention is needed label Jan 30, 2023
@lapineige
Copy link
Member Author

Even with the latest version ?

@karolfilarski
Copy link

karolfilarski commented Feb 22, 2023

i'have this logs

-- Journal begins at Sun 2022-12-04 21:17:01 CET, ends at Sun 2023-01-29 22:48:31 CET. --
janv. 24 22:55:27 systemd[1]: Started 13ft launcher service. 
janv. 24 22:55:27 systemd [157494]: 13ft.service: Failed to set up standard output: No such file or directory
janv. 24 22:55:27 systemd [157494]: 13ft.service: Failed at step STDOUT spawning /var/www/13ft/venv/bin/python3: No such file or directory
janv. 24 22:55:27 systemd[1]: 13ft.service: Main process exited, code=exited, status=209/STDOUT
janv. 24 22:55:27 systemd[1]: 13ft.service: Failed with result 'exit-code'. -- Boot 9f5953ab12ce41568375fe76aaa64bc7 -- 
janv. 29 22:45:16 systemd [1]: Started 13ft launcher service.
janv. 29 22:45:16 systemd[665195]: 13ft.service: Failed to set up standard output: No such file or directory
janv. 29 22:45:16 systemd[665195]: 13ft.service: Failed at step STDOUT spawning /var/www/13ft/venv/bin/python3: No such file or directory 
janv. 29 22:45:16 systemd [1]: 13ft.service: Main process exited, code=exited, status=209/STDOUT
janv. 29 22:45:16 systemd[1]: 13ft.service: Failed with result 'exit-code'.`

Same here in main and testing branch

@lapineige
Copy link
Member Author

lapineige commented Feb 22, 2023

Can you check if /var/www/13ft/venv/bin/python3 exists ?

And if yes, can you run /var/www/13ft/venv/bin/python3 /var/www/13ft/index.py and share the result here ?

@irrweg
Copy link

irrweg commented Feb 22, 2023

Can you check if /var/www/13ft/venv/bin/python3 exists ?

And if yes, can you run /var/www/13ft/venv/bin/python3 /var/www/13ft/index.py and share the result here ?

xxx@xxx:~$ sudo /var/www/13ft/venv/bin/python3 /var/www/13ft/index.py
 * Serving Flask app 'index'
 * Debug mode: on
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on http://127.0.0.1:5000
Press CTRL+C to quit
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: 135-782-041

xxx@xxx:~$ sudo tree /var/www/13ft/venv/bin/
/var/www/13ft/venv/bin/
├── activate
├── activate.csh
├── activate.fish
├── Activate.ps1
├── easy_install
├── easy_install-3.9
├── flask
├── normalizer
├── pip
├── pip3
├── pip3.9
├── python -> python3
├── python3 -> /usr/bin/python3
└── python3.9 -> python3

@lapineige
Copy link
Member Author

I don't understand the issue, the file is here, the service can start, but it failed 🤔

@irrweg
Copy link

irrweg commented Feb 23, 2023

maybe it helps using files from python instead linking to it in the folder.

@lapineige
Copy link
Member Author

I don't understand your point. You mean file from the system python installation ? We use a virtual environment to avoid messing up with other packages.

@BrunoSpy
Copy link

Hello,

I managed to successfully launch the service by creating /var/log/13ft/ which didn't existed

systemctl status 13ft
● 13ft.service - 13ft launcher service
Loaded: loaded (/etc/systemd/system/13ft.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2023-05-23 12:15:42 CEST; 41s ago
Main PID: 62963 (python3)
Tasks: 3 (limit: 8691)
Memory: 41.6M
CPU: 523ms
CGroup: /system.slice/13ft.service
├─62963 /var/www/13ft/venv/bin/python3 /var/www/13ft/index.py
└─62965 /var/www/13ft/venv/bin/python3 /var/www/13ft/index.py

Now the service is ok but still every request is redirected to the SSO.

Nothing in the logs :

/var/log/13ft# tail -f 13ft.log

  • Serving Flask app 'index'
  • Debug mode: on
    WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
  • Running on http://127.0.0.1:5000
    Press CTRL+C to quit
  • Restarting with stat
  • Debugger is active!
  • Debugger PIN: 534-857-092

@lapineige lapineige mentioned this issue May 23, 2023
2 tasks
@dgraziotin
Copy link

Hi, sorry, not hugely familiar with Yunohost.

But this file: https://github.com/YunoHost-Apps/13ft_ynh/blob/master/conf/nginx.conf

Results into /etc/nginx/conf.d/yourdomain.conf.d/13ft.conf

#sub_path_only rewrite ^/$ / permanent;
location / {

  # Path to source
  alias /var/www/13ft/;

  # Include SSOWAT user panel.
  include conf.d/yunohost_panel.conf.inc;
}
ls /var/www/13ft
index.html  index.py  LICENSE  portable.py  README.md  requirements.txt  screenshots  venv

Shouldn't there be a reverse proxy to http://127.0.0.1:5000 or something, instead?

@dgraziotin
Copy link

dgraziotin commented May 26, 2023

Yes, this quick edit:

#sub_path_only rewrite ^/$ / permanent;
location / {

  # Path to source
  #alias /var/www/13ft/;
  # static files
  proxy_pass http://localhost:5000;
  proxy_set_header Host $http_host;
  more_set_headers "X-Frame-Options: ALLOWALL";
  # Include SSOWAT user panel.
  include conf.d/yunohost_panel.conf.inc;
}

Makes it work again :-) it still requires @BrunoSpy part.

@lapineige
Copy link
Member Author

Thank a lot !

lapineige added a commit that referenced this issue May 26, 2023
@lapineige
Copy link
Member Author

lapineige commented May 28, 2023

It fails :(

Service is running but the issue is still there.

@lapineige
Copy link
Member Author

WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.

@wasi-master any idea ? 😅

@dgraziotin
Copy link

It fails :(

Service is running but the issue is still there.

it’s working fine here. Please note that mine is a quick fix. It will work when serving at the root of a (sub)domain, but not in a sub-folder, for example.

@lapineige
Copy link
Member Author

lapineige commented May 28, 2023

Oh that's the thing !
I use a subfolder. What should it be in that case ?

@wasi-master
Copy link

wasi-master commented May 29, 2023

WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.

@wasi-master any idea ? 😅

@lapineige that means the app is online. I didn't use a production grade server because I thought people would not deploy it online and just self host. Now I guess I need to use one.

@lapineige
Copy link
Member Author

I thought people would not deploy it online and just self host.

What do you mean ? Self-host on their personal computer and not in a separated server (even at home) ?

@wasi-master
Copy link

I thought people would not deploy it online and just self host.

What do you mean ? Self-host on their personal computer and not in a separated server (even at home) ?

I guess the warning doesn’t matter. The development server is not designed to be particularly efficient, stable, or secure. But if someone is using it at home. I guess they can just use the development server.

@lapineige
Copy link
Member Author

I don't get what's the issue :

May 26 17:24:28 systemd[4514]: 13ft.service: Failed to set up standard output: No such file or directory
May 26 17:24:28 systemd[4514]: 13ft.service: Failed at step STDOUT spawning /var/www/13ft/venv/bin/python3: No such file or directory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

8 participants