"change URL" in package check doesn't work. Manually works

e.g.: YunoRunner for CI for master <- testing by jedie · Pull Request #17 · YunoHost-Apps/django_example_ynh · GitHub

If i manually change the path in YunoHost admin, then everything works, as expected.
Any idea?

Hm… I have an idea: Bad Request (400) may be come from django, because ALLOWED_HOSTS = ['__DOMAIN__'] was not correct replaced with domain.tld ?

If i see it correct in full log here: https://ci-apps-dev.yunohost.org/ci/logs/django_example_amd64_stable_complete.log

then this happend:

...
33645 e[37me[1mDEBUG e[m+ match_string=__DOMAIN__

33645 e[37me[1mDEBUG e[m+ match_string=__DOMAIN__

33645 e[37me[1mDEBUG e[m+ replace_string=sub.domain.tld

33646 e[37me[1mDEBUG e[m+ replace_string=sub.domain.tld

33646 e[37me[1mDEBUG e[m+ replace_string=sub.domain.tld

33649 e[37me[1mDEBUG e[m+ sed --in-place s@__DOMAIN__@sub.domain.tld@g /opt/yunohost/django_example_ynh/settings.py
...
e[1me[33mWarning: Test URL: domain.tld/path
Real URL: https://domain.tld/path/
HTTP code: 400
Page title: 
Page extract:e[0m
Running curl domain.tld/path/
Return code: 0
Working time: 2 seconds (06:56:35)

<!doctype html>
<html lang="en">
<head>
  <title>Bad Request (400)</title>
</head>
<body>
  <h1>Bad Request (400)</h1><p></p>
</body>
</html>

So i assume this is a bug in yunorunner?!?

Maybe it’s in my change_url script and that’s the fix: Bugfix "change_url" by jedie · Pull Request #19 · YunoHost-Apps/django_example_ynh · GitHub ?

Can’t wait for the result: YunoRunner for CI

https://ci-apps-dev.yunohost.org/ci/summary/3268.png

EDIT: Maybe it’s a boring idea to make:

old_domain=$YNH_APP_OLD_DOMAIN
old_path=$YNH_APP_OLD_PATH

new_domain=$YNH_APP_NEW_DOMAIN
new_path=$YNH_APP_NEW_PATH

Think it’s better to change this to:

old_domain=$YNH_APP_OLD_DOMAIN
old_path=$YNH_APP_OLD_PATH

domain=$YNH_APP_NEW_DOMAIN
path=$YNH_APP_NEW_PATH

Isn’t it?

The example_ynh make also this kind of “mistake”: example_ynh/change_url at master · YunoHost/example_ynh · GitHub
Because if scripts after domain="$old_domain" used the domain variable than it’s the old one and not the new one…

No: https://github.com/YunoHost-Apps/django_example_ynh/pull/19/commits/30e1d756973554774db07410a661d5bb2a8b1002 ist not the fix :frowning:

grafik

ci run: YunoRunner for CI
full log: https://ci-apps-dev.yunohost.org/ci/logs/django_example_amd64_stable_complete.log

Now i see, that change_url has many steps:

  1. Changing the URL from sub.domain.tld/ to sub.domain.tld/pathworked
  2. Changing the URL from sub.domain.tld/path to sub.domain.tld/path_2worked
  3. Changing the URL from sub.domain.tld/path_2 to sub.domain.tld/worked
  4. Changing the URL from sub.domain.tld/ to domain.tld/pathworked
  5. Changing the URL from domain.tld/path to sub.domain.tld/pathfailed

Strange…

I compared my script with example_ynh/change_url at master · YunoHost/example_ynh · GitHub but didn’t see any relevant differences…

EDIT: Maybe my django_example_ynh is a bad example, because change_url doesn’t work in the past… But my Yunohost Dashboard has green change_url in the past and testing based on django_example_ynh sources.

It seems that this change is the problem: Comparing f069d8c9ee7cef2b6edfb1914d68d743522c24a8...testing · YunoHost-Apps/pyinventory_ynh · GitHub

I will now try this:

domain=$YNH_APP_NEW_DOMAIN
path=$YNH_APP_NEW_PATH

ynh_add_config --template="settings.py" --destination="$final_path/settings.py"

and wait for: YunoRunner for CI

Hm! I make some tests… The Problem is the __PATH_URL__ was wrong.

Think Bugfix "change_url" by jedie · Pull Request #20 · YunoHost-Apps/django_example_ynh · GitHub will fix this.

Let’s wait for: YunoRunner for CI