-
Notifications
You must be signed in to change notification settings - Fork 280
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
Error 500 after restart the container #34
Comments
Please show us the log file. |
|
@fernandoneto we're after the |
i create a gist |
Looks like you forgot to configure the environment? |
|
That means no encryption key has been set. |
@GrahamCampbell i fallow your documentation. |
@GrahamCampbell i think i found the problem. in setup i select de cache-driver and session-driver as database. if i select APC(u) the container run without problems after restart. can you tell me where I can find the documentation to try to better understand this part of the configuration. |
I'm running into the same problem. I have MySQL as the underlying database, and when choosing Database as the cache and sessions drivers during initial Setup, Cachet docker doesn't restart and gives 500 error, and gives error in laravel logs about the sessions and caches tables not existing in the DB. I did look in the DB and these tables don't exist. So I'm assuming that choosing Database doesn't really create the necessary tables in the DB and hence this fails on restart of docker container. |
@GrahamCampbell are we missing a migration? |
+1 After attempting to follow the instructions in Get started with Docker for both Docker and Docker Compose, I have been unable to successfully run Cachet. Using just Docker I'm able to get Cachet and MySQL up and running (although MySQL doesn't do any provisioning of the cachet user -- this has to be manually done which clears the errors from Cachet@IP not being able to connect). However, the Cachet application is inaccessible from the browser. Using Docker Compose I'm able to get the three containers running. However, after the initial setup, upon container restart the application is never accessible again. Is there updated documentation on how to currently get the service up and running utilizing Docker or Docker Compose? Ideally, I'd be able to author my own |
@jbrooksuk perhaps to your point, after setting up via Docker Compose and restarting the containers, the logs contain an error from Postgres:
|
Not able to reproduce with current master branch, I just fixed #55 which may have been related. |
Just re-pushed 2.2.0 tag and Docker hub build - Can you check and reproduce there? |
There are migrations missing for sure when using DB as the cache and sessions driver. After consulting the laravel documentation, I was able to get cachet working with a docker container restart by adding these commands after the app:install. docker exec -it cachet php artisan session:table These commands will create the migrations for the missing caches and sessions tables in the DB. Regards |
Thanks for that info @ibandak - I had only tested with the APC(u) driver myself. I don't know Laravel really so will need to defer to @jbrooksuk on those command. |
Okay, we seem to be making some progress. Here's where I'm at based on the latest information: Note: commands in succession between two different terminals docker-compose up
docker exec -i cachetdocker_cachet_1 php artisan key:generate
docker exec -i cachetdocker_cachet_1 php artisan app:install Navigate to: http://192.168.99.100/setup docker-compose stop
docker-compose up Navigate to: http://192.168.99.100/setup Able to complete setup and view empty dashboard. docker-compose stop
docker-compose up Navigate to: http://192.168.99.100/ -- successful rendering of timeline After login attempt: Docker Compose logs: nginx_1 | 192.168.99.1 - - [05/Apr/2016:20:48:18 +0000] "GET /auth/login HTTP/1.1" 200 15213 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36" "-"
postgres_1 | ERROR: relation "cache" does not exist at character 15
postgres_1 | STATEMENT: select * from "cache" where "key" = $1 limit 1
nginx_1 | 192.168.99.1 - - [05/Apr/2016:20:48:26 +0000] "POST /auth/login HTTP/1.1" 500 3169 "http://192.168.99.100/auth/login" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36" "-" |
@ibandak using the information you provided, here's what I'm getting: docker exec -i cachetdocker_cachet_1 php artisan session:table
Migration created successfully!
docker exec -i cachetdocker_cachet_1 php artisan cache:table
Migration created successfully!
docker exec -i cachetdocker_cachet_1 php artisan migrate
**************************************
* Application In Production! *
**************************************
Command Cancelled! Navigate to http://192.168.99.100/setup -- Error 500 docker-compose stop
docker-compose up Navigate to http://192.168.99.100/setup -- Success -- complete setup with Database as cache and session driver docker-compose stop
docker-compose up Navigate to: http://192.168.99.100/ -- successful rendering of timeline After login attempt: |
@jadametz, why did you Cancel out of the prompt? docker exec -it cachet php artisan migrate
put "y" for yes and let it complete so it creates the tables, migrate will not destroy anything else it'll only create the 2 new tables.. |
@ibandak the command wasn't cancelled by me. It seems to be detecting that the After some hackery I replaced the line in Migrated: 2016_04_05_210500_create_sessions_table
Migrated: 2016_04_05_210505_create_cache_table As a result, the service successfully persists through container restart. @djdefi @jbrooksuk does this information help to find a more scalable solution to the issue? |
@jadametz , If you use the "--force" flag that will make it run without a prompt on production: |
Ran some tests around this on the latest version of master, please check out #58 |
@djdefi looks like the changes you mentioned in #58 for initializing on initial "up", etc. all worked well. However, after restart of the containers I'm not able to login with the username provided during setup. nginx_1 | 192.168.99.1 - - [11/Apr/2016:20:13:24 +0000] "GET /dashboard HTTP/1.1" 302 384 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36" "-"
nginx_1 | 192.168.99.1 - - [11/Apr/2016:20:13:24 +0000] "GET /auth/login HTTP/1.1" 200 15214 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36" "-"
nginx_1 | 192.168.99.1 - - [11/Apr/2016:20:13:24 +0000] "GET /build/dist/css/all-5d444fe92b.css HTTP/1.1" 304 0 "http://192.168.99.100/auth/login" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36" "-"
nginx_1 | 192.168.99.1 - - [11/Apr/2016:20:13:24 +0000] "GET /build/dist/js/all-84f6fb9f0b.js HTTP/1.1" 304 0 "http://192.168.99.100/auth/login" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36" "-"
nginx_1 | 192.168.99.1 - - [11/Apr/2016:20:13:24 +0000] "GET /fonts/ionicons.ttf?v=2.0.0 HTTP/1.1" 304 0 "http://192.168.99.100/auth/login" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36" "-"
postgres_1 | ERROR: relation "cache" does not exist at character 15
postgres_1 | STATEMENT: select * from "cache" where "key" = $1 limit 1
nginx_1 | 192.168.99.1 - - [11/Apr/2016:20:13:27 +0000] "POST /auth/login HTTP/1.1" 500 3169 "http://192.168.99.100/auth/login" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36" "-" |
Thanks for testing @jadametz - I was getting that same error using cache drivers other than APC(u) - I see above that you were using the "database" driver which I was not able to get working in my tests. Are you still using that driver? I'm no laravel expert so not really sure what is missing from the Docker image for the other cache and session drivers to work... |
Yes, still using the database driver. To be honest, I'm not sure what these drivers are totally doing so if there's documentation somewhere that I'm missing, I'd love a link 😄 |
@jadametz https://docs.cachethq.io/docs/prerequisites is all I know of. That lists APCu and Redis (I have not tested Redis personally). |
All defaults should be set now (see #63). Please open a new issue if you are still having problems with the latest master. |
If i restart the container of cachet when i try to access it im getting this error
everything work just perfect before i restart.
The text was updated successfully, but these errors were encountered: