monicahq / monica

Personal CRM. Remember everything about your friends, family and business relationships.
https://beta.monicahq.com
GNU Affero General Public License v3.0
21.51k stars 2.15k forks source link

Run monica in docker on synology #6191

Open felix-wa opened 2 years ago

felix-wa commented 2 years ago

Describe the bug Hey all, I followed this instruction to install monica on my Synology NAS with Portainer. It is spinning up the containers and everything seems to work. Whey I try to call the page I get an error (see screenshot below) and thats it. When I check the std out of the container I can see this outputs:

2022-06-16 12:17:34,stderr,[Thu Jun 16 12:17:34.166213 2022] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'

2022-06-16 12:17:34,stderr,[Thu Jun 16 12:17:34.166110 2022] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.53 (Debian) PHP/8.0.18 configured -- resuming normal operations

2022-06-16 12:17:34,stderr,"AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.3. Set the 'ServerName' directive globally to suppress this message
"
2022-06-16 12:17:34,stderr,"Database ready.AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.3. Set the 'ServerName' directive globally to suppress this message
"
2022-06-16 12:17:32,stdout,"Monica v3.7.0 is set up, enjoy.
"
2022-06-16 12:17:32,stdout,

2022-06-16 12:17:32,stdout,Application is now live.

When I call it I get this:

2022-06-16 12:21:35,stdout,172.18.0.1 - - [16/Jun/2022:12:21:35 +0000] "GET /favicon.ico HTTP/1.1" 200 296 "http://MY-INTERNAL-IP:4166/" "BROWSER_INFO"

2022-06-16 12:21:35,stdout,172.18.0.1 - - [16/Jun/2022:12:21:34 +0000] "GET / HTTP/1.1" 500 1915 "-" "BROWSER_INFO"

Where I replaced my internal IP by MY-INTERNAL-IP and my connection string info by BROWSER_INFO

Screenshots

grafik

Is this a known issue? I could not find anything like this around

Thanks :-)

particleflux commented 2 years ago

The log output of apache with the qualified domain name is fine.

The 500 is not.

Can you check storage/logs/laravel.log in webroot? It should have more information about the error.

EDIT: oh lol, it actually says it cannot write the log, did not see that message :D Since the storage dir is a volume mount in that guide, maybe the guide is outdated or recent changes to the actual docker files changed the owner/perms.

felix-wa commented 2 years ago

Hello @particleflux, thanks for your reply. I think the error message is not accurate. I have the mentioned logfile. Here is the output I get when call the homepage:

[2022-06-19 08:18:01] local.ERROR: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'monica.cache' doesn't exist (SQL: select * from `cache` where `key` = laravel_cachecloudflare.proxies limit 1) {"exception":"[object] (Illuminate\\Database\\QueryException(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'monica.cache' doesn't exist (SQL: select * from `cache` where `key` = laravel_cachecloudflare.proxies limit 1) at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:712)
[stacktrace]
#0 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(672): Illuminate\\Database\\Connection->runQueryCallback('select * from `...', Array, Object(Closure))
#1 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(376): Illuminate\\Database\\Connection->run('select * from `...', Array, Object(Closure))
#2 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2414): Illuminate\\Database\\Connection->select('select * from `...', Array, true)
#3 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2402): Illuminate\\Database\\Query\\Builder->runSelect()
#4 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2936): Illuminate\\Database\\Query\\Builder->Illuminate\\Database\\Query\\{closure}()
#5 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2403): Illuminate\\Database\\Query\\Builder->onceWithColumns(Array, Object(Closure))
#6 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Concerns/BuildsQueries.php(294): Illuminate\\Database\\Query\\Builder->get(Array)
#7 /var/www/html/vendor/laravel/framework/src/Illuminate/Cache/DatabaseStore.php(94): Illuminate\\Database\\Query\\Builder->first()
#8 /var/www/html/vendor/laravel/framework/src/Illuminate/Cache/Repository.php(97): Illuminate\\Cache\\DatabaseStore->get('cloudflare.prox...')
#9 /var/www/html/vendor/laravel/framework/src/Illuminate/Cache/CacheManager.php(418): Illuminate\\Cache\\Repository->get('cloudflare.prox...', Object(Closure))
#10 /var/www/html/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(261): Illuminate\\Cache\\CacheManager->__call('get', Array)
#11 /var/www/html/vendor/monicahq/laravel-cloudflare/src/Http/Middleware/TrustProxies.php(25): Illuminate\\Support\\Facades\\Facade::__callStatic('get', Array)
#12 /var/www/html/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(37): Monicahq\\Cloudflare\\Http\\Middleware\\TrustProxies->setTrustedProxyIpAddresses(Object(Illuminate\\Http\\Request))
#13 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Http\\Middleware\\TrustProxies->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#14 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#15 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(142): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#16 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(111): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request))
#17 /var/www/html/public/index.php(55): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request))
#18 {main}

[previous exception] [object] (PDOException(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'monica.cache' doesn't exist at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:368)
[stacktrace]
#0 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(368): PDO->prepare('select * from `...')
#1 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(705): Illuminate\\Database\\Connection->Illuminate\\Database\\{closure}('select * from `...', Array)
#2 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(672): Illuminate\\Database\\Connection->runQueryCallback('select * from `...', Array, Object(Closure))
#3 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(376): Illuminate\\Database\\Connection->run('select * from `...', Array, Object(Closure))
#4 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2414): Illuminate\\Database\\Connection->select('select * from `...', Array, true)
#5 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2402): Illuminate\\Database\\Query\\Builder->runSelect()
#6 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2936): Illuminate\\Database\\Query\\Builder->Illuminate\\Database\\Query\\{closure}()
#7 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2403): Illuminate\\Database\\Query\\Builder->onceWithColumns(Array, Object(Closure))
#8 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Concerns/BuildsQueries.php(294): Illuminate\\Database\\Query\\Builder->get(Array)
#9 /var/www/html/vendor/laravel/framework/src/Illuminate/Cache/DatabaseStore.php(94): Illuminate\\Database\\Query\\Builder->first()
#10 /var/www/html/vendor/laravel/framework/src/Illuminate/Cache/Repository.php(97): Illuminate\\Cache\\DatabaseStore->get('cloudflare.prox...')
#11 /var/www/html/vendor/laravel/framework/src/Illuminate/Cache/CacheManager.php(418): Illuminate\\Cache\\Repository->get('cloudflare.prox...', Object(Closure))
#12 /var/www/html/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(261): Illuminate\\Cache\\CacheManager->__call('get', Array)
#13 /var/www/html/vendor/monicahq/laravel-cloudflare/src/Http/Middleware/TrustProxies.php(25): Illuminate\\Support\\Facades\\Facade::__callStatic('get', Array)
#14 /var/www/html/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(37): Monicahq\\Cloudflare\\Http\\Middleware\\TrustProxies->setTrustedProxyIpAddresses(Object(Illuminate\\Http\\Request))
#15 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Http\\Middleware\\TrustProxies->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#16 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#17 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(142): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#18 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(111): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request))
#19 /var/www/html/public/index.php(55): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request))
#20 {main}
"} 

Looks like that there is a table missing, is there a way to set this up on my own?

particleflux commented 2 years ago

I'm not sure how exactly docker on synology works, tho you might want to try a docker exec <container> php artisan migrate. Usually those migration scripts take care of the database setup/updates.

Or maybe a php artisan monica:update --force as detailed here: https://github.com/monicahq/monica/blob/main/docs/installation/update.md#generic-instructions

diminou91 commented 2 years ago

Got the same issue, not using synology NAS but docker as well : image

Referring it here : https://github.com/monicahq/docker/issues/112

Basically, once I change the log file perm, the error change to : image "An error happened when adding the user"

Posting here as well since the docker repo seems to be forgotten by the team. Thanks in advance to anyone taking time to read/help :)