Docker osTicket HTTP Errors - docker

I'm having troubles getting the Docker containers for osTicket up and running.
I've created and linked the MariaDB and osTicket containers following the getting started directions:
$ docker run --name osticket_mysql -d -e MYSQL_ROOT_PASSWORD=secret \
-e MYSQL_USER=osticket -e MYSQL_PASSWORD=secret -e MYSQL_DATABASE=osticket mariadb
$ docker run --name osticket -d --link osticket_mysql:mysql -p 8080:80 osticket/osticket
I am then suppose to be able to go to http://localhost:8080/scp but I get a HTTP-404 Nginx message.
Going to http://localhost:8080 gives me a 403-Restricted Nginx error
The Nginx Error log from inside of the osTicket container is as follows:
# cat nginx-error.log
2018/07/03 01:38:17 [error] 40#40: *1 directory index of "/var/www/src/public/" is forbidden, client: 172.17.0.1, server: _, request: "GET / HTTP/1.1", host: "localhost:8080"
2018/07/03 01:38:17 [error] 40#40: *1 open() "/var/www/src/public/favicon.ico" failed (2: No such file or directory), client: 172.17.0.1, server: _, request: "GET /favicon.ico HTTP/1.1", host: "localhost:8080"
2018/07/03 01:38:17 [error] 40#40: *1 open() "/var/www/src/public/favicon.ico" failed (2: No such file or directory), client: 172.17.0.1, server: _, request: "GET /favicon.ico HTTP/1.1", host: "localhost:8080"
2018/07/03 01:41:52 [error] 40#40: *3 directory index of "/var/www/src/public/" is forbidden, client: 172.17.0.1, server: _, request: "GET / HTTP/1.1", host: "0.0.0.0:8080"
2018/07/03 01:41:52 [error] 40#40: *3 open() "/var/www/src/public/favicon.ico" failed (2: No such file or directory), client: 172.17.0.1, server: _, request: "GET /favicon.ico HTTP/1.1", host: "0.0.0.0:8080"
2018/07/03 01:41:52 [error] 40#40: *3 open() "/var/www/src/public/favicon.ico" failed (2: No such file or directory), client: 172.17.0.1, server: _, request: "GET /favicon.ico HTTP/1.1", host: "0.0.0.0:8080"
2018/07/03 01:45:32 [error] 40#40: *4 directory index of "/var/www/src/public/" is forbidden, client: 172.17.0.1, server: _, request: "GET / HTTP/1.1", host: "0.0.0.0:8080"
2018/07/03 01:47:21 [error] 40#40: *4 FastCGI sent in stderr: "PHP message: PHP Parse error: syntax error, unexpected 'echo' (T_ECHO), expecting ',' or ';' in /bin/webhook.php on line 12" while reading response header from upstream, client: 172.17.0.1, server: _, request: "GET /webhook.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "0.0.0.0:8080"
Any ideas what I'm doing wrong?
Thanks!

As #AndrewSavinykh pointed out in the comments, the osticket/osticket container image is out of date.
Using the container by Campbell Software Solutions LINK solved the issues.

Related

Reverse proxying containerized angular app

We have an angular_app that upon running docker-compose up is accessible from
under localhost.
Now, we have another dockerized Nginx app that reverses proxies several apps. /app_A /app_B /agular_app. Now A and B work already but the angular_app gives 502.
A snippet from Nginx
location / {
proxy_pass http://agular_app:5001;
}
A snippet from the docker file
agular_app:
image: docker_repo/agular_app:latest
ports:
- 5001:80
The angular_app is accessible from localhost:5001
but not accessible from localhost (gives 502)
I have tried the following things:
Yes, changing 5001:5001, the dame 502
Different Nginx config such as adding proxy_set_header etc
Tried not using redirects over proxy_pass
For me... The missing puzzle piece is... Why reverse proxy does not work. Again, the dockerized angular image running manually (not containerized) on Nginx works fine.
Here is the docker file for angular_app
# Stage 1
FROM node:12-alpine3.12 as build-step
RUN mkdir -p /app
WORKDIR /app
COPY package.json /app
RUN npm install
COPY . /app
RUN npm run build --prod
# Stage 2
FROM nginx:1.14.2-alpine
COPY --from=build-step /app/frontend/dist /usr/share/nginx/html
COPY ./nginx_docker.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
Error from Nginx log upon calling localhost:
gateway | 2021/05/27 06:52:07 [error] 28#28: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 172.18.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "http://172.18.0.2:5
001/", host: "localhost"
gateway | 2021/05/27 06:52:07 [error] 28#28: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 172.18.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "http://172.18.0.2:5
001/502.html", host: "localhost"
gateway | 172.18.0.1 - - [27/May/2021:06:52:07 +0000] "GET / HTTP/1.1" 502 552 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" "-"
gateway | 2021/05/27 06:52:07 [error] 28#28: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 172.18.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", upstream: "http://1
72.18.0.2:5001/favicon.ico", host: "localhost", referrer: "http://localhost/"
gateway | 2021/05/27 06:52:07 [error] 28#28: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 172.18.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", upstream: "http://1
72.18.0.2:5001/502.html", host: "localhost", referrer: "http://localhost/"

Rails 5, Mongoid, MongoDB app not running on AWS Elastic Beanstalk

Symptoms:
When navigating to the EB URL, page never loads.
I can provide parts of my project config if needed. Here is a portion of the log from my AWS EB instance:
2018/02/18 09:35:22 [warn] 3060#0: conflicting server name "localhost" on 0.0.0.0:80, ignored
2018/02/18 09:46:48 [error] 3064#0: *167 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 172.31.4.6, server: _, request: "GET /users HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/users", host: "idea-jotter-api-env.ukn765e3m3.ap-southeast-1.elasticbeanstalk.com"
2018/02/18 09:46:49 [error] 3064#0: *167 connect() to unix:///var/run/puma/my_app.sock failed (111: Connection refused) while connecting to upstream, client: 172.31.4.6, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/favicon.ico", host: "idea-jotter-api-env.ukn765e3m3.ap-southeast-1.elasticbeanstalk.com", referrer: "http://idea-jotter-api-env.ukn765e3m3.ap-southeast-1.elasticbeanstalk.com/users"
2018/02/19 13:11:50 [error] 3064#0: *24659 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 172.31.31.179, server: _, request: "GET / HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock/", host: "52.221.25.234"

Rails - Elastick Beanstalk nginx/error.log

Trying to upload my rails app to elastic beanstalk. I have successfully deployed my app and created postgres database. My app works on sqlite3 on development server.
my eb status is ready and health is green.
my eb logs file;
/var/log/nginx/error.log
-------------------------------------
2016/05/27 11:15:44 [warn] 2797#0: conflicting server name "localhost" on 0.0.0.0:80, ignored
2016/05/27 11:27:26 [crit] 2805#0: *140 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.26.77, server: _, request: "GET / HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/", host: "viravira-env.bu2eqpbwny.us-west-2.elasticbeanstalk.com"
2016/05/27 11:27:26 [crit] 2805#0: *140 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.26.77, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/favicon.ico", host: "viravira-env.bu2eqpbwny.us-west-2.elasticbeanstalk.com", referrer: "http://viravira-env.bu2eqpbwny.us-west-2.elasticbeanstalk.com/"
2016/05/27 11:34:45 [crit] 2805#0: *262 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.46.145, server: _, request: "GET / HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/", host: "viravira-env.bu2eqpbwny.us-west-2.elasticbeanstalk.com"
2016/05/27 11:34:45 [crit] 2805#0: *262 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.46.145, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/favicon.ico", host: "viravira-env.bu2eqpbwny.us-west-2.elasticbeanstalk.com", referrer: "http://viravira-env.bu2eqpbwny.us-west-2.elasticbeanstalk.com/"
2016/05/27 11:40:48 [crit] 2805#0: *353 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.46.145, server: _, request: "GET / HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/", host: "viravira-env.bu2eqpbwny.us-west-2.elasticbeanstalk.com"
2016/05/27 11:40:49 [crit] 2805#0: *353 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.46.145, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/favicon.ico", host: "viravira-env.bu2eqpbwny.us-west-2.elasticbeanstalk.com", referrer: "http://viravira-env.bu2eqpbwny.us-west-2.elasticbeanstalk.com/"
-------------------------------------
/var/log/puma/puma.log
-------------------------------------
=== puma startup: 2016-05-27 11:52:07 +0000 ===
=== puma startup: 2016-05-27 11:52:07 +0000 ===
[23871] - Worker 0 (pid: 23875) booted, phase: 0
[23871] - Gracefully shutting down workers...
[23871] === puma shutdown: 2016-05-27 12:36:32 +0000 ===
[23871] - Goodbye!
=== puma startup: 2016-05-27 12:36:35 +0000 ===
=== puma startup: 2016-05-27 12:36:35 +0000 ===
[24886] - Worker 0 (pid: 24890) booted, phase: 0
I am fairly new to eb so I wonder if the problem occurs because of the followings;
I have not installed node that is why it can not connect
Or I have problems with the security groups. I have 4 total as seen in the picture.
my network interfaces;
when I try to detach RDS security group, it gives an error no authorization, even though I signed in as root.
I have been trying to solve the problem for hours now and really appreciate any help!
EDIT
I think I m having same issue as here. But could not understand how to solve it
Your problem is very clear from the Nginx log:
connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream
It reads:
No such file or directory
This means that your socket doesn't not exist at this path:
/var/run/puma/my_app.sock
You need to setup the path to be the same as in your Rails/Puma
upstream(i.e. configuration)
When you will do that don't forget to make sure that Nginx user
can access that socket it will need RW access.

How I can resolve 502 error on Gitlab?

So, I try to install Gitlab and I have some problems. At the end of Installation from source, when I try to start all services, I have a 502 error. I have this message when I try sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production :
Check GitLab API access: FAILED. code: 502
gitlab-shell self-check failed
Try fixing it:
Make sure GitLab is running;
Check the gitlab-shell configuration file:
sudo -u git -H editor /home/git/gitlab-shell/config.yml
Please fix the error above and rerun the checks.
After some search, I think it's a unicorn error. That's what I find in the file log tail -n 15 /home/git/gitlab/log/unicorn.stderr.log :
F, [2015-08-17T14:08:25.266483 #15125] FATAL -- : error adding listener addr="188.213.26.27":80
/home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/socket_helper.rb:147:in `initialize': Permission denied - bind(2) for "188.213.26.27" port 80 (Errno::EACCES)
I don't know how I can change this and if it's the real problem. If it can help, this is the Nginx log tail -f /var/log/nginx/gitlab_error.log :
2015/08/16 16:46:24 [error] 14932#0: *33 limiting connections by zone "limit_per_ip", client: 188.213.26.27, server: gitlab.nova.ovh, request: "GET / HTTP/1.0", host: "gitlab.nova.ovh"
2015/08/16 17:00:41 [error] 14932#0: *71 limiting connections by zone "limit_per_ip", client: 188.213.26.27, server: gitlab.nova.ovh, request: "GET / HTTP/1.0", host: "gitlab.nova.ovh"
2015/08/16 17:01:04 [error] 19194#0: *33 limiting connections by zone "limit_per_ip", client: 188.213.26.27, server: gitlab.nova.ovh, request: "GET / HTTP/1.0", host: "gitlab.nova.ovh"
2015/08/16 17:03:01 [error] 19713#0: *33 limiting connections by zone "limit_per_ip", client: 188.213.26.27, server: gitlab.nova.ovh, request: "GET / HTTP/1.0", host: "gitlab.nova.ovh"
2015/08/17 12:18:09 [error] 18616#0: *3 connect() to unix:/home/git/gitlab/tmp/sockets/gitlab.socket failed (111: Connection refused) while connecting to upstream, client: 82.127.11.127, server: gitlab.nova.ovh, request: "GET / HTTP/1.1", upstream: "http://unix:/home/git/gitlab/tmp/sockets/gitlab.socket:/", host: "gitlab.nova.ovh"
2015/08/17 12:18:26 [error] 18616#0: *6 connect() to unix:/home/git/gitlab/tmp/sockets/gitlab.socket failed (111: Connection refused) while connecting to upstream, client: 188.213.26.27, server: gitlab.nova.ovh, request: "GET //api/v3/internal/check HTTP/1.1", upstream: "http://unix:/home/git/gitlab/tmp/sockets/gitlab.socket://api/v3/internal/check", host: "gitlab.nova.ovh"
2015/08/17 13:47:09 [error] 18616#0: *38 connect() to unix:/home/git/gitlab/tmp/sockets/gitlab.socket failed (111: Connection refused) while connecting to upstream, client: 188.213.26.27, server: gitlab.nova.ovh, request: "GET //api/v3/internal/check HTTP/1.1", upstream: "http://unix:/home/git/gitlab/tmp/sockets/gitlab.socket://api/v3/internal/check", host: "gitlab.nova.ovh"
2015/08/17 13:48:05 [error] 18616#0: *42 connect() to unix:/home/git/gitlab/tmp/sockets/gitlab.socket failed (111: Connection refused) while connecting to upstream, client: 188.213.26.27, server: gitlab.nova.ovh, request: "GET //api/v3/internal/check HTTP/1.1", upstream: "http://unix:/home/git/gitlab/tmp/sockets/gitlab.socket://api/v3/internal/check", host: "gitlab.nova.ovh"
Unicorn must not bind port 80 which it is denied anyways (hence the error message). Binding ports below 1024 requires root privileges. Also port 80 is used by nginx. Configure unicorn to not listen to TCP ports at all if you're using unix socket or any high port (e.g. 8080 or 8081) for use with TCP socket.

504 after user creation with devise

Working with some inherited code using devise and active admin.
I have a form to create an admin_user (email, password, password confirm) After clicking submit the browsers hangs for bit before showing me a 504. The user is created and in the db.
This issue kind of came out of nowhere. The few commits I have done didn't touch this part of the project.
Here is the code that creates the admin user form. What happens after this I am still unclear on:
ActiveAdmin.register AdminUser do
menu :parent => "Sys Admin", :priority => 2
index do
column :email
column :current_sign_in_at
column :last_sign_in_at
column :sign_in_count
default_actions
end
filter :email
form do |f|
f.inputs "Admin Details" do
f.input :email
f.input :password
f.input :password_confirmation
end
f.buttons
end
controller do
#https://coderwall.com/p/xfrujq
def update_resource(object, attributes)
update_method = attributes.first[:password].present? ? :update_attributes : :update_without_password
object.send(update_method, *attributes)
end
end
end
2013/10/17 11:58:32 [error] 1609#0: *293930 connect() failed (111: Connection refused) while connecting to upstream, client: ***IP****, server: www.*******.com, request: "HEAD / HTTP/1.0", upstream: "http://***IP****:8080/", host: "www.*******.com"
2013/10/17 11:58:46 [error] 1610#0: *293932 connect() failed (111: Connection refused) while connecting to upstream, client: ***IP****, server: www.*******.com, request: "HEAD / HTTP/1.0", upstream: "http://***IP****:8080/", host: "www.*******.com"
2013/10/17 11:58:50 [error] 1610#0: *293934 connect() failed (111: Connection refused) while connecting to upstream, client: ***IP****, server: www.*******.com, request: "HEAD / HTTP/1.0", upstream: "http://***IP****:8080/", host: "www.*******.com"
2013/10/17 11:59:23 [error] 1610#0: *293936 connect() failed (111: Connection refused) while connecting to upstream, client: ***IP****, server: www.*******.com, request: "HEAD / HTTP/1.0", upstream: "http://***IP****:8080/", host: "www.*******.com"
2013/10/17 11:59:47 [error] 1610#0: *293938 connect() failed (111: Connection refused) while connecting to upstream, client: ***IP****, server: www.*******.com, request: "GET /*****/4960 HTTP/1.1", upstream: "http://***IP****:8080/*****/4960", host: "www.*******.com", referrer: "https://www.*******.com/*****/4960"
2013/10/17 11:59:48 [error] 1610#0: *293938 connect() failed (111: Connection refused) while connecting to upstream, client: ***IP****, server: www.*******.com, request: "GET /*****/assets/btn_menu_close.png HTTP/1.1", upstream: "http://***IP****:8080/*****/assets/btn_menu_close.png", host: "www.*******.com", referrer: "https://www.*******.com/*****/4960"
2013/10/17 12:30:12 [error] 1611#0: *294268 open() "/home/deployer/apps/*******/current/public/assets/wufoo.js" failed (2: No such file or directory), client: ***IP****, server: www.*******.com, request: "GET /assets/wufoo.js HTTP/1.1", host: "www.*******.com", referrer: "https://www.*******.com/pioneer"
2013/10/17 12:38:17 [error] 1610#0: *294379 upstream prematurely closed connection while reading response header from upstream, client: ***IP****, server: www.*******.com, request: "POST /admin/admin_users HTTP/1.1", upstream: "http://***IP****:8080/admin/admin_users", host: "www.*******.com", referrer: "https://www.*******.com/admin/admin_users/new"
2013/10/17 12:40:05 [error] 1610#0: *294404 upstream prematurely closed connection while reading response header from upstream, client: ***IP****, server: www.*******.com, request: "GET /patients HTTP/1.1", upstream: "http://***IP****:8080/patients", host: "www.*******.com", referrer: "https://www.*******.com/users/sign_in"
2013/10/17 13:14:28 [error] 1608#0: *294872 upstream prematurely closed connection while reading response header from upstream, client: ***IP****, server: www.*******.com, request: "GET /api/v1/*****/2018/**_*****.json HTTP/1.1", upstream: "http://***IP****:8080/api/v1/*****/2018/**_*****.json", host: "www.*******.com"
2013/10/17 13:15:45 [error] 1609#0: *295095 upstream prematurely closed connection while reading response header from upstream, client: ***IP****, server: www.*******.com, request: "GET /api/v1/*****/2224/**_*****.json HTTP/1.1", upstream: "http://***IP****:8080/api/v1/*****/2224/**_*****.json", host: "www.*******.com"
2013/10/17 13:17:34 [error] 1608#0: *295160 upstream prematurely closed connection while reading response header from upstream, client: ***IP****, server: www.*******.com, request: "GET /api/v1/medications.json HTTP/1.1", upstream: "http://***IP****:8080/api/v1/medications.json", host: "www.*******.com"
2013/10/17 13:20:51 [error] 1609#0: *295800 upstream prematurely closed connection while reading response header from upstream, client: ***IP****, server: www.*******.com, request: "GET /api/v1/*****/3698/**_*****.json HTTP/1.1", upstream: "http://***IP****:8080/api/v1/*****/3698/**_*****.json", host: "www.*******.com"
2013/10/17 13:58:21 [error] 1608#0: *298069 upstream prematurely closed connection while reading response header from upstream, client: ***IP****, server: www.*******.com, request: "GET /api/v1/*****/3457/**_*****.json HTTP/1.1", upstream: "http://***IP****:8080/api/v1/*****/3457/**_*****.json", host: "www.*******.com"
2013/10/17 16:44:39 [error] 1611#0: *301472 upstream prematurely closed connection while reading response header from upstream, client: ***IP****, server: www.*******.com, request: "POST /admin/admin_users HTTP/1.1", upstream: "http://***IP****:8080/admin/admin_users", host: "www.*******.com", referrer: "https://www.*******.com/admin/admin_users/new"
2013/10/17 19:09:24 [error] 1608#0: *302423 upstream prematurely closed connection while reading response header from upstream, client: ***IP****, server: www.*******.com, request: "POST /api/v1/images/4650/upload_file.json HTTP/1.1", upstream: "http://***IP****:8080/api/v1/images/4650/upload_file.json", host: "www.*******.com"

Resources