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

Server fails to write crash file #384

Open
mybuntu-git2 opened this issue Mar 25, 2023 · 12 comments
Open

Server fails to write crash file #384

mybuntu-git2 opened this issue Mar 25, 2023 · 12 comments
Labels
bug Something isn't working

Comments

@mybuntu-git2
Copy link

Thanks for your help I am really stuck at this point.
I have an OC docker image (latest) with data folder mounted and permissions set to 777 and external redis and mariadb. I run it on an Odroid N2+ (arm) Ubuntu 22.04 headless as root.
I start the container with docker-compose (details at the end) and the server starts correctly but then when attempting access it crashes due to permission to write php crash files.

docker log until crash:

root@odroid:/home/owncloud# docker logs owncloud_server
Creating volume folders...
Creating hook folders...
Waiting for MySQL...
services are ready!
Waiting for Redis...
services are ready!
Removing custom folder...
Linking custom folder...
Removing config folder...
Linking config folder...
Writing config file...
Fixing base perms...
Fixing data perms...
Fixing hook perms...
Upgrading server database...
Writing objectstore config...
Writing php config...
Updating htaccess config...
Writing apache config...
Enabling cron background...
Writing crontab file...
Touching cron configs...
Starting cron daemon...
Starting apache daemon...
[Sat Mar 25 07:41:34.713959 2023] [mpm_prefork:notice] [pid 122] AH00163: Apache/2.4.41 (Ubuntu) configured -- resuming normal operations
[Sat Mar 25 07:41:34.714055 2023] [core:notice] [pid 122] AH00094: Command line: '/usr/sbin/apache2 -f /etc/apache2/apache2.conf -D FOREGROUND'
127.0.0.1 - - [25/Mar/2023:07:42:00 +0000] "GET /status.php HTTP/1.1" 200 303 "-" "curl/7.68.0"
[Sat Mar 25 07:42:17.725423 2023] [php7:warn] [pid 123] [client 10.8.0.6:50858] PHP Warning:  file_put_contents(/var/www/owncloud/data/crash-2023-03-25.log): failed to open stream: No such file or directory in /var/www/owncloud/lib/base.php on line 1038
[Sat Mar 25 07:42:17.725523 2023] [php7:warn] [pid 123] [client 10.8.0.6:50858] PHP Warning:  file_put_contents(/var/www/owncloud/data/crash-2023-03-25.log): failed to open stream: No such file or directory in /var/www/owncloud/lib/base.php on line 1038
10.8.0.6 - - [25/Mar/2023:07:42:17 +0000] "GET / HTTP/1.1" 599 363 "-" "Mozilla/5.0 (iPhone; CPU iPhone OS 16_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.2 Mobile/15E148 Safari/604.1"

this is the compose file:

version: "3"

services:
  owncloud:
    image: owncloud/server:latest
    deploy:
      resources:
        limits:
         cpus: '3'
         memory: 800M
    container_name: owncloud_server
    #restart: unless-stopped
    ports:
      - 8080:8080
    environment:
      - HTTP_PORT=8080
      - OWNCLOUD_DOMAIN=192.168.17.3
      - OWNCLOUD_TRUSTED_DOMAINS=localhost,192.168.17.1,192.168.100.1,192.168.1.1,10.8.0.1,0.0.0.0
      - OWNCLOUD_TRUSTED_PROXIES=192.168.17.3
      - OWNCLOUD_DB_TYPE=mysql
      - OWNCLOUD_DB_NAME=owncloud_docker_1
      - OWNCLOUD_DB_USERNAME=owncloud
      - OWNCLOUD_DB_PASSWORD=mypass
      - OWNCLOUD_DB_HOST=192.168.17.3
      - OWNCLOUD_ADMIN_USERNAME=myuser
      - OWNCLOUD_ADMIN_PASSWORD=mypassword
      - OWNCLOUD_MYSQL_UTF8MB4=true
      - OWNCLOUD_REDIS_ENABLED=true
      - OWNCLOUD_REDIS_HOST=192.168.17.3
    healthcheck:
      test: ["CMD", "/usr/bin/healthcheck"]
      interval: 30s
      timeout: 10s
      retries: 5
    volumes:
      - /home/owncloud/docker_mnt/data:/mnt/data

I verified and there is no crash file under data persistent folder, and I run the compose as root. As long as I do not attempt accessing the webui, the server is up and running.

@xoxys xoxys added the question Further information is requested label Mar 27, 2023
@mybuntu-git2
Copy link
Author

Hi, I see there is a question label, let me know if I have to provide more information.

@xoxys
Copy link
Contributor

xoxys commented Apr 3, 2023

As this is most likely a setup issue, please use the forum https://central.owncloud.org/ for general questions next time.

I'm not able to reproduce it. While using your compose file, I can use the Web UI as intended without any issue. Besides that, the crash file line in your log is just a warning and not an error. Do you get an error on the Web UI? Please also check the owncloud.log.

@xoxys
Copy link
Contributor

xoxys commented Apr 3, 2023

Need to correct myself. During a server crash, the regular logger isn't used, and the UI might now show anything as well. Need to check with the engineering team.

@xoxys xoxys added bug Something isn't working and removed question Further information is requested labels Apr 3, 2023
@xoxys
Copy link
Contributor

xoxys commented Apr 3, 2023

We still need to find a way to handle the crash log properly within the container, but as a workaround, can you add another mount to /var/www/owncloud/data/ to collect the crash log? I'm wondering why the server crashes at all.

@mybuntu-git2
Copy link
Author

Hi, I added another line

- /home/owncloud/docker_mnt_test:/var/www/owncloud/data

In the docker-compose and did chown 777 docker_mnt_test
Now when I start with docker-compose up or docker-compose up -d, it crashes during startup.

@xoxys
Copy link
Contributor

xoxys commented Apr 3, 2023

And whats the error?

@mybuntu-git2
Copy link
Author

I don’t have any crash file as before. The new mount is empty, the old one contains as usual apps, config, sessions, files

@xoxys
Copy link
Contributor

xoxys commented Apr 3, 2023

Yes but if the container startup fails now there has to be something in the docker logs.

@mybuntu-git2
Copy link
Author

Ok, slight improvement after rerunning and reboot. The machine still crashes when I try to access the webui of owncloud after the latest changes, but I do have a log, and it ends like this:
[Mon Apr 03 15:46:48.918551 2023] [mpm_prefork:notice] [pid 126] AH00163: Apache/2.4.41 (Ubuntu) configured -- resuming normal operations [Mon Apr 03 15:46:48.918625 2023] [core:notice] [pid 126] AH00094: Command line: '/usr/sbin/apache2 -f /etc/apache2/apache2.conf -D FOREGROUND' 127.0.0.1 - - [03/Apr/2023:15:47:14 +0000] "GET /status.php HTTP/1.1" 200 303 "-" "curl/7.68.0" .
still docker_mnt_test is empty.

@xoxys
Copy link
Contributor

xoxys commented Apr 4, 2023

I don't know how to help further. The log snippet you have posted does not indicate any error, it's just a regular log of the ownCloud container. I'm still not able to reproduce any behavior. Mounting /var/www/owncloud/data works for me, and even forcing the server to crash works and creates an accessible crash log at /var/www/owncloud/data now.

@mybuntu-git2
Copy link
Author

Hi, are you testing the arm docker build?

@xoxys
Copy link
Contributor

xoxys commented Apr 5, 2023

Tested arm64 on a Raspberry Pi, the arm (32 bit) image is discontinued and no longer maintained. However, I don't think the issue is related to the arch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants