Dokku view logs? (hosted on digitalocean) - dokku

So I just started using dokku (with postegres). My app works on Heroku so I'm pretty sure it's a deployment issue. The app seems to be running but is however hitting issues at log in. I did dokku logs my_app_name however the logs seems to be old. On heroku whenever there is an issue there is an corresponding log, but here I cannot find.
Any ideas are appreciated! Thanks!

To get a continuous log you can type:
dokku logs yourappname -t
It acts as the tail -f command on linux and mac systems.
Dokku logs - docs

I think you can try to use docker logs -f `cat /home/dokku/<app-name>/CONTAINER for getting access to the logs.
In case if you want to see the logs of the specific container:
docker ps
then find your container with postgresql for example and run docker logs -f <CONTAINER_ID>
I hope it could help you to find out the problem.
Out of the topic I found dokku-alt and using it in my current DO image. If you are working with Ruby it's working out of the box comparing with original dokku project.

The easiest:
dokku logs -t *app_name*
up to 300000 lines:
dokku logs -t -n 300000 *app_name* > logs.txt
complete log of container: (needs to be executed on server)
docker container list # to get the container id
docker logs *container_id* > logs.txt

It may not be the answer you are looking for but I was seeing the same issue. I just waited about 30 seconds and the logs were updated. I don't know why they are updated live, but they eventually came through.

Related

How do I enter my container if dokku enter <app> does nothing?

I have a simple dokku app using herokuish buildpack-php with a procfile: web: vendor/bin/heroku-php-apache2 public/
If I try to enter the app with dokku enter <appname> nothing happens, and I am simply returned to my host shell.
I can run dokku run <appname> bash and get a shell, but is, as far as I understand from the documentation placing me in a new container and not in the existing/running one I need access to:
The run command can be used to run a one-off process for a specific command. This will start a new container and run the desired command within that container.
How can I fix this so I can enter my running container?
If you are in the local directory for your app, doing the following will take you into the running container for it:
dokku enter web.1
I've done this a few times today!
As a workaround, you can enter your container using docker. For doing so, run docker ps and note the container ID. Afterwards, run docker exec -it container_id /bin/bash.

Website available even with no NGINX processes running

I have pulled into my web server so it has the latest code from my repo, i try to restart nginx - this doesnt do anything.
So I try the command
sudo nginx -s stop, and get the response that its failed because there is no such file or directory "run/nginx.pid" failed.
Trying to run the command ps aux | grep nginx gives me the response: unsupported option (BSD syntax) -- it actually comes out as ps aux > grep nginx in the digital ocean console.
Basically it seems that even though there are apparently no nginx processes running (although the command to check isnt working) my website is still running and using the old code, is there a way for me to check more definitively on the running processes?
Thanks if you can help.
Try sudo netstat -plunt to check if there's any nginx process running. See if there's anything running on port 80 or 443 and then look at the corresponding program name. You might have another server running possibly apache since it ships by default with most distributions which may be why nginx failed to start.
Another reason why it won't start might be due to faulty config. Go to /etc/nginx/ and double check that it's correct. You can also run sudo nginx -t to ensure that the config syntax is correct.
Alternatively, just check your nginx access log to see if it's actually serving any requests. You can also check the error log to see why it might fail to start. These resides in /var/log/nginx by default or check your nginx.conf for any custom path to logs.

Docker shows inconsistent behaviour when creating container from image

I am developing a web application which depends on a moodle system, as it uses moodles webservices. For my automated tests, I wanted to use docker to provide a preconfigured moodle-application on all my machines. Therefore I created a docker image, which I import from a .tar.gz file.
However, creating a new container-instance from this image behaves inconsistently. Sometimes the container boots up correctly and everything works fine. However, sometimes the container starts but the moodle-website is not reachable. If I connect my bash to the container using docker exec -it <container> bash I see that apache is running. The error logs do not show any entries which might be related to this issue.
If I kill the container instance and boot it up again, everything works as expected (sometimes this step has to be repeated multiple times). Do you have any idea what could be the reason for this strange behaviour? Anyone experiencing similar issues?
Docker is running on Ubuntu 14:04. The problem appears on several machines. The script which imports the image and starts the container looks like this:
#!/usr/bin/env bash
docker rm -f moodle
docker load < my-moodle.tar.gz
docker run -d -p 8080:80 -p 8443:443 -p 3306:3306 --name moodle moodle-image
Thanks in advance!
Successful container startup depends on your container entrypoint and external resources (if the entrypoint has external dependencies). What is the entrypoint? Does it depend on external resources?

Why is Play application not able to resolve dependencies from inside docker container?

I am trying to get a Play Framework application running inside a docker container on an Ubuntu Server 14.04 machine.
$ docker pull mzkrelx/playframework2-dev:2.2.3
$ docker run -i -t -v /path/to/play/app:/opt/workspace -p 9000:9000 mzkrelx/playframework2-dev:2.2.3
bash-4.1# play
[play-application] $ run
The last command results in attempts to resolving dependencies but only puts out errors, warnings and infos such as You probably access the destination server through a proxy server that is not well configured.
What do I do wrong?
It seems as if my problems were network-related and subject to caching behaviour. The same setup now works perfectly. After a shutdown of the machine and a play clean.
Thanks for your help nevertheless!

Gitlab: Problems running Unicorn, Resque with Passenger/Nginx

I have installed a Gitlab on a brand new Ubuntu (10.04) and it is working almost correctly. Gitlab is reachable on HTTP, I can push/pull data via git to the server. There is one thing missing though, the activity feed is not updating. So I thought there is something wrong with the git hooks. I completely followed the installation process from Gitlab except I'd like to use Passenger to run Nginx in order to deploy multiple apps.
I was running the the sudo -u gitlab -H bundle exec rake gitlab:env:info RAILS_ENV=production to see if everything is set up correctly, but it said, Redis is not running. ps aux says, redis-server is up. So it is not the git hooks. Gitlab docu says, restart the gitlab service to solve that problem. In this case I get an error which I think is the problem I need to solve:
$ sudo /etc/init.d/gitlab restart
Error, unicorn not running!
My question is, how can I get around this problem? How can I run unicorn, I thought the gitlab service would start it? Am I not using Nginx? Before I start reinstalling the whole thing firstly without using Passenger, I thought I might ask the question here beforehand.
As mentioned by the OP pabera, nginx and mysql must be started, for the other components of GitLab (redis, unicorn, and now sidekiq) to run properly.
The official /etc/init.d/gitlab is here.
I have my own version of gitlabd (here), because I manage sidekiq in my own script, and I don't need to run the script as root.
You can see the run order for all the services in this script:
ssh
Apache and/or NGiNX
mysql
redis
GitLab (which will start unicorn and sidekiq)
Kind of a poke in the dark...
In the GitLab installation.md README is states:
"
Start your GitLab instance:
sudo service gitlab start
# or
sudo /etc/init.d/gitlab restart
"
I did the first AND the second and got this exact error. However, I skipped the "or" and continued to the Nginx commands and it seems to work.
Hope this helps!

Resources