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

[BUG] WebInterface got 404 for apps installed on custom path #329

Closed
1 task done
adminelix opened this issue Jul 1, 2023 · 10 comments
Closed
1 task done

[BUG] WebInterface got 404 for apps installed on custom path #329

adminelix opened this issue Jul 1, 2023 · 10 comments

Comments

@adminelix
Copy link

adminelix commented Jul 1, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

after the update from 26.0.2 to 27.0.0 all apps installed on a custom_apps location does not shown in Web Interface anymore. There are working as expected via other APIs like REST or DAV. So calender is still synchronizing with smartphone for instance.

The browser debugger shows that all requests are running into a 404 for apps that are installed on a other folder than /apps.

image

Expected Behavior

App are shown on Web Interface.

Steps To Reproduce

  1. run nextcloud with
sudo docker run -d \                    
--name=nextcloud \
-e PUID=1000 \
-e PGID=1000 \
-e TZ=Etc/UTC \
-p 443:443 \
--restart unless-stopped \
lscr.io/linuxserver/nextcloud:latest
  1. create account on https://localhost/
  2. exec docker with sudo docker exec -it nextcloud /bin/bash
  3. create folder for custom_apps
mkdir config/www/nextcloud/custom_apps
chown --reference config/www/nextcloud/apps mkdir config/www/nextcloud/custom_apps
  1. add following config into
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/config/www/nextcloud/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 => 
    array (
      'path' => '/config/www/nextcloud/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
    ),
  ),
  1. call https://localhost/ again and install the notes app for instance. if you try to hit the notes icon after a page reload you will see nothing.

Workaround:
the current workaround I see but not checked yet is to move all my apps from custom_apps to apps folder.

Environment

- OS: unraid 6.12.1
- How docker service was installed: via unraid, but reproduced issue on Fedora 38

CPU architecture

x86-64

Docker creation

sudo docker run -d \                    
  --name=nextcloud \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Etc/UTC \
  -p 443:443 \
  --restart unless-stopped \
  lscr.io/linuxserver/nextcloud:latest


### Container logs

```bash
docker logs nextcloud

[migrations] started
[migrations] 01-nginx-site-confs-default: executing...
[migrations] 01-nginx-site-confs-default: succeeded
[migrations] 02-default-location: executing...
grep: /config/nginx/site-confs/default.conf: No such file or directory
[migrations] 02-default-location: succeeded
[migrations] done
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗ 
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝ 

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1000
User GID:    1000
───────────────────────────────────────

Setting resolver to  192.168.1.1
Setting worker_processes to 16
generating self-signed keys in /config/keys, you can replace these with your own keys if required
.....+..+............+....+..+...+.......+.....+....+...+...+..+......+.........+......+++++++++++++++++++++++++++++++++++++++*.....+...+.....+......+.+++++++++++++++++++++++++++++++++++++++*.+......+.....+............+...+.......+......+......+.........+......+...+...+...+.................+....+...++++++
.+..+....+........+++++++++++++++++++++++++++++++++++++++*...+...+..+...+...+.+......+.....+............+.......+...+......+.................+++++++++++++++++++++++++++++++++++++++*.....+......+........+...+...+............+....+...+........+.........+.+.................+.+.....+.+......+..+...+.......+...+.........+......+..+...+...+......+...+......+.+...+......+...........+....+......+.........+......+...+...........................+...........+....+......+.....+.........+................+...+.........+........+...................+...+...+.........+.....+.+...+.........+...+..+............+......+..........+..+...+....+...+..+..........+...+.....+......+....+..+.+...+.....+.......+.....+...+....+...........+....++++++
-----
Initializing nextcloud 27.0.0.8 (this can take a while) ...
Setting permissions
New nextcloud instance
Please run the web-based installer on first connect!
Initializing finished
After completing the web-based installer, restart the Nextcloud container to apply default memory caching and transactional file locking configurations.
Alternatively, you can apply your own configurations by editing /config/www/nextcloud/config/config.php following the documentation:
https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/caching_configuration.html
https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/files_locking_transactional.html
# do daily/weekly/monthly maintenance
# min   hour    day     month   weekday command
*/15    *       *       *       *       run-parts /etc/periodic/15min
0       *       *       *       *       run-parts /etc/periodic/hourly
0       2       *       *       *       run-parts /etc/periodic/daily
0       3       *       *       6       run-parts /etc/periodic/weekly
0       5       1       *       *       run-parts /etc/periodic/monthly
# nextcloud cron
*/5     *       *       *       *       s6-setuidgid abc php -f /app/www/public/cron.php
cp: not replacing '/config/crontabs/root'
[custom-init] No custom files found, skipping...
[ls.io-init] done.
Exception: Not installed in /app/www/public/lib/base.php:285
Stack trace:
#0 /app/www/public/lib/base.php(705): OC::checkInstalled()
#1 /app/www/public/lib/base.php(1173): OC::init()
#2 /app/www/public/cron.php(43): require_once('...')
#3 {main}
[migrations] started
[migrations] 01-nginx-site-confs-default: skipped
[migrations] 02-default-location: skipped
[migrations] done
usermod: no changes
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗ 
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝ 

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1000
User GID:    1000
───────────────────────────────────────

using keys found in /config/keys
System config value memcache.local set to string \OC\Memcache\APCu
System config value filelocking.enabled set to string true
System config value memcache.locking set to string \OC\Memcache\APCu
[custom-init] No custom files found, skipping...
[ls.io-init] done.
@github-actions
Copy link

github-actions bot commented Jul 1, 2023

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

@nemchik
Copy link
Member

nemchik commented Jul 1, 2023

Could you try executing this inside the container:

        rm -rf "/app/www/public/custom_apps"
        ln -s "/config/www/nextcloud/custom_apps" "/app/www/public/custom_apps"
        lsiown abc:abc "/config/www/nextcloud/custom_apps" "/app/www/public/custom_apps"

@adminelix
Copy link
Author

Thanks for your reply.
It is working with the symlink but after a recreation of the container (by updating image), the symlink will be lost.

Would it be possible to provide a permanent solution in the next release?

@nemchik
Copy link
Member

nemchik commented Jul 2, 2023

Thanks for your reply. It is working with the symlink but after a recreation of the container (by updating image), the symlink will be lost.

Would it be possible to provide a permanent solution in the next release?

Sorry, I should have mentioned that was kind of a test to see if it fixed the problem.

Another test (that actually might be a permanent fix) would be to add a location to /config/nginx/site-confs/default.conf

    location /custom_apps {
        root /config/www/nextcloud/custom_apps;
        # try_files $uri $uri/; # this line might need to be uncommented, or might need to be modified, but i'm not sure exactly yet
    }

I would add this directly above line 158 that reads location / {

I am not positive that this will work correctly, but if it does you shouldn't need the symlink, and this change will be persistent. If this doesn't work, the concept should still be correct, but we might need additional configuration lines inside the location braces.

As for a permanent fix being included in the image, I know nextcloud docs mention custom_apps and how to configure nextcloud for it, but in theory you could name the folder anything, or have multiple, so I don't think we'll be able to include a universal permanent fix, but I'm open to ideas.

@partymild
Copy link

Thanks for your reply. It is working with the symlink but after a recreation of the container (by updating image), the symlink will be lost.
Would it be possible to provide a permanent solution in the next release?

Sorry, I should have mentioned that was kind of a test to see if it fixed the problem.

Another test (that actually might be a permanent fix) would be to add a location to /config/nginx/site-confs/default.conf

    location /custom_apps {
        root /config/www/nextcloud/custom_apps;
        # try_files $uri $uri/; # this line might need to be uncommented, or might need to be modified, but i'm not sure exactly yet
    }

I would add this directly above line 158 that reads location / {

I am not positive that this will work correctly, but if it does you shouldn't need the symlink, and this change will be persistent. If this doesn't work, the concept should still be correct, but we might need additional configuration lines inside the location braces.

As for a permanent fix being included in the image, I know nextcloud docs mention custom_apps and how to configure nextcloud for it, but in theory you could name the folder anything, or have multiple, so I don't think we'll be able to include a universal permanent fix, but I'm open to ideas.

I've got the same issue and unfortunately creating this entry in the /config/nginx/site-confs/default.conf file doesn't work.
The temporary fix by creating the symlink works.

As I currently understand the main issue is the possibility to create a custom apps folder and refer to it in the nextcloud config.php. The only valid location (without creating a symlink) for it is in the nextcloud server root which has moved now to /app/ (from /config/).
/app/ gets recreated on reset of the docker container. Unfortunately I've got no real idea for a valid fix..

@nemchik
Copy link
Member

nemchik commented Jul 21, 2023

It's also possible to make a volume on your container with the path /app/www/public/custom_apps, you could even put this beneath your nextcloud config volume so it would basically be in the same place as /config/www/nextcloud/custom_apps would have been. Then you don't need to modify the nginx config or do symlinks, just config.php.

@partymild
Copy link

Yes, that works, too. I wasn't really considering this because I somehow thought the folder gets deleted when I recreate the container (due to nextcloud installing again in the /app/www/public/ path).

@nemchik
Copy link
Member

nemchik commented Jul 25, 2023

I'm going to mark this as resolved with the best recommendation being the volume at this point.

@nemchik nemchik closed this as completed Jul 25, 2023
@adminelix
Copy link
Author

I am OK with that.
But a I guess a sidenote in the migration guide would be pretty useful for other people.

@nemchik
Copy link
Member

nemchik commented Jul 26, 2023

I am OK with that. But a I guess a sidenote in the migration guide would be pretty useful for other people.

There is now documentation for a volume for custom apps https://github.com/linuxserver/docker-nextcloud#custom-app-directories

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

3 participants