docker-groupoffice icon indicating copy to clipboard operation
docker-groupoffice copied to clipboard

Gettin errors when using for the first time

Open edersong opened this issue 6 months ago • 15 comments

Deployed the GroupOffice using the docker compose provided but it's failing for the first use reporting:

Uncaught exception: Could not create folder /home/groupoffice/cache/clientscript

This error can be seen at /install page.

edersong avatar Jun 20 '25 15:06 edersong

you should mount etc/groupoffice:/etc/groupoffice to the docker from this project

czyt avatar Jun 21 '25 06:06 czyt

It's already mounted. Here is my compose.yml:

services:
  groupoffice:
    container_name: groupoffice
    image: intermesh/groupoffice:25.0
    restart: unless-stopped
#    ports:
#      - "9090:80"
    links:
      - db
    volumes:
      - /volumes/group-office/data:/var/lib/groupoffice:cached
      - /volumes/group-office/etc/groupoffice:/etc/groupoffice:cached
      - /volumes/group-office/studio:/usr/local/share/groupoffice/go/modules/studio:cached
      - /volumes/group-office/src/studio:/usr/local/share/groupoffice/go/modules/studio
#      - /volumes/group-office/ssl/groupoffice:/etc/ssl/groupoffice
    environment:
      - MYSQL_USER=username
      - MYSQL_PASSWORD=password
      - MYSQL_DATABASE=groupoffice
    networks:
      - proxy
      - groupoffice

  db:
    container_name: groupoffice_db
    image: mariadb:11.1.2
    restart: unless-stopped    
    environment:
      - MYSQL_USER=username
      - MYSQL_PASSWORD=password
      - MYSQL_DATABASE=groupoffice
      - MYSQL_ROOT_PASSWORD=other_password
      - MARIADB_AUTO_UPGRADE=1
    volumes:
      - /volumes/group-office/dbdata:/var/lib/mysql:cached
    networks:
      - groupoffice

networks:
  proxy:
    external: true
  groupoffice:
    name: groupoffice

edersong avatar Jun 21 '25 08:06 edersong

The default location for the files is /var/lib/groupoffice and not /home/groupoffice. The dockerfile creates this location:

https://github.com/Intermesh/docker-groupoffice/blob/3c12a1c38cbe620bb827a5c4817ed461c8c3b701/Dockerfile#L77

Try mounting it there and adjust your config.php.

mschering avatar Jun 23 '25 08:06 mschering

I think that's the problem, because I'm already mounting /var/lib/groupoffice but there is nothing there.

edersong avatar Jun 23 '25 08:06 edersong

groupoffice container logs are reporting the following:

groupoffice  | 2025-06-23T06:52:10.172365890Z groupoffice.site.com 192.168.128.45 - - [23/Jun/2025:06:52:10 +0000] "GET /install/ HTTP/1.1" 500 112
groupoffice  | 2025-06-23T08:26:32.235457574Z PHP Deprecated:  PHP Startup: session.sid_length INI setting is deprecated in Unknown on line 0
groupoffice  | 2025-06-23T08:26:32.235499144Z PHP Deprecated:  PHP Startup: session.sid_bits_per_character INI setting is deprecated in Unknown on line 0
groupoffice  | 2025-06-23T08:26:32.368087293Z [Mon Jun 23 08:26:32.315244 2025] [mpm_prefork:notice] [pid 12:tid 12] AH00163: Apache/2.4.62 (Debian) OpenSSL/3.0.16 configured -- resuming normal operations
groupoffice  | 2025-06-23T08:26:32.368111172Z [Mon Jun 23 08:26:32.315303 2025] [core:notice] [pid 12:tid 12] AH00094: Command line: 'apache2 -D FOREGROUND'
groupoffice  | 2025-06-23T08:26:47.342491463Z groupoffice.site.com [Mon Jun 23 08:26:47 2025] [notice] [pid 23] [client 192.168.128.45:57094] go\\core\\db\\DbException in /usr/local/share/groupoffice/go/core/db/Connection.php at line 212: Database exception: SQLSTATE[HY000] [2002] No such file or directory, Full SQL: show create table `core_module`;
groupoffice  | 2025-06-23T08:26:47.357492409Z groupoffice.site.com 192.168.128.45 - - [23/Jun/2025:08:26:47 +0000] "GET / HTTP/1.1" 302 -
groupoffice  | 2025-06-23T08:26:47.501662180Z groupoffice.site.com [Mon Jun 23 08:26:47 2025] [notice] [pid 24] [client 192.168.128.45:57098] Exception in /usr/local/share/groupoffice/go/core/fs/Folder.php at line 367: Could not create folder /home/groupoffice/cache/clientscripts
groupoffice  | 2025-06-23T08:26:47.505048493Z groupoffice.site.com 192.168.128.45 - - [23/Jun/2025:08:26:47 +0000] "GET /install/ HTTP/1.1" 500 112

edersong avatar Jun 23 '25 08:06 edersong

But is there $config['file_storage_path'] = '/var/lib/groupoffice'; in your config.php?

I don't understand where the /home/groupoffice path comes from.

mschering avatar Jun 23 '25 09:06 mschering

You are mounting your own config.php. I don't know why you choose to do this but normally the docker container creates it like this:

<?php
require "docker-config.php";

$config['db_port'] = 3306;
$config['file_storage_path'] = "/var/lib/groupoffice";
$config['tmpdir'] = "/tmp/groupoffice";
$config['debug'] = false;
$config['business'] = array (
	'studio' =>
		array (
			'package' => 'studio',
		)
);

mschering avatar Jun 23 '25 09:06 mschering

I just follow the docker compose instructions and you can review that above. There is no files under /var/lib/groupoffice, so I cant see config.php file there to check.

If there is anything that you can suggest to check, please, let me know.

edersong avatar Jun 23 '25 09:06 edersong

But you mount host directories here:

volumes:
      - /volumes/group-office/data:/var/lib/groupoffice:cached
      - /volumes/group-office/etc/groupoffice:/etc/groupoffice:cached
      - /volumes/group-office/studio:/usr/local/share/groupoffice/go/modules/studio:cached
      - /volumes/group-office/src/studio:/usr/local/share/groupoffice/go/modules/studio
#      - /volumes/group-office/ssl/groupoffice:/etc/ssl/groupoffice

I suggest you start with the supplied compose.yaml file. That works as expected.

mschering avatar Jun 23 '25 09:06 mschering

Just tried that and getting the same error.

edersong avatar Jun 23 '25 10:06 edersong

I just tried the version released some minutes ago and noticed that the error changed to:

Uncaught exception: Could not create folder /var/lib/groupoffice/cache/clientscripts at 2025-06-23T16:12:20+00:00

edersong avatar Jun 23 '25 16:06 edersong

Any idea?

edersong avatar Jun 24 '25 09:06 edersong

My only guess left is that /volumes/group-office/data is not writable.

If I try the standard compose.yaml then it works straight away on a fresh install.

mschering avatar Jun 24 '25 09:06 mschering

Hi,

I can replicate this issue. The cause is not data but etc.

When you just pull the repo and run it, etc is created via volume goetc and it works out of the box. Thats because both config files are present, config.php based on the copy of ./etc/groupoffice/config.php and docker-config.php based on the environment data.

When you set the volume for etc manually to a folder only the docker-config.php is created, the config.php is missing. My guess is, that there is some kind of race condition difference between bind mounts and volume mounts - I haven't found another explanation.

@mschering You can replicate it this way: Pull the repo, replace

-      - "goetc:/etc/groupoffice:cached"
+      - "./data/etc:/etc/groupoffice:cached"

and start the container -> resulting in the described error message when calling GO. Since config.php with $config['file_storage_path'] is missing it will fallback on some hardcoded /home-Path I guess.

@edersong You should be able to fix this by just copying the config.php manually inside the /volumes/group-office/etc/groupoffice folder.

Best regards Daniel

itzonban avatar Jul 04 '25 09:07 itzonban

Thanks for helping out. I'll look into this.

mschering avatar Jul 08 '25 08:07 mschering