[2019-01-03T18:20:08.983] [INFO] shiny-server - Shiny Server v1.5.9.923 (Node.js v8.11.3)
[2019-01-03T18:20:08.986] [INFO] shiny-server - Using config file "/etc/shiny-server/shiny-server.conf"
[2019-01-03T18:20:09.047] [WARN] shiny-server - Running as root unnecessarily is a security risk! You could be running more securely as non-root.
[2019-01-03T18:20:09.055] [INFO] shiny-server - Starting listener on http://[::]:3838
[2019-01-03T18:20:09.060] [ERROR] shiny-server - HTTP server error (http://[::]:3838): listen EAFNOSUPPORT :::3838
[2019-01-03T18:20:09.060] [INFO] shiny-server - Shutting down worker processes
This is the shiny server status:
shiny-server stop/waiting
How can I resolve this problem?
Related
I am working on a Windows 10 machine using Ubuntu inside WSL. I did this because I cannot get gunicorn to work as I've researched it is not available in Windows. I can successfully run my app using my docker-compose file within my WSL Ubuntu perfectly fine. I then run the gunicorn myapp.wsgi command and the server spins up with the terminal giving me the following output:
[2021-09-16 19:11:53 +0000] [25] [INFO] Starting gunicorn 20.1.0
[2021-09-16 19:11:53 +0000] [25] [INFO] Listening at: http://127.0.0.1:8000 (25)
[2021-09-16 19:11:53 +0000] [25] [INFO] Using worker: sync
[2021-09-16 19:11:53 +0000] [26] [INFO] Booting worker with pid: 26
However, I cannot connect to my site at localhost:8000. I also did a curl request against the localhost:8000 from inside my docker container and got a 302 error.
I've researched using gunicorn, mod_wsgi and uwsgi, all given as options in the Django documentation. However, I want to use gunicorn or uwsgi to have access to either nginx or Apache (plus the documentation on mod_wsgi has a dead link for the windows install file). Does anyone have suggestions on how I can get this to work?
Following the VSOMEIP tutorial Vsomeip in 10 minutes everything works up to the point of Communication between 2 devices.
Current Setup:
Ubuntu 16.04 (two machines - Server & Client)
Two Machines connected over ethernet
Files used:
server.cpp
client.cpp
client_config.json
server_config.json
Output of Server
[info] Parsed vsomeip configuration in 1ms
[info] Using configuration file: "../clie_prop.json".
[info] Default configuration module loaded.
[info] Initializing vsomeip application "Hello".
[info] SOME/IP client identifier configured. Using 0033 (was: 1313)
[info] Instantiating routing manager [Proxy].
[info] Client [33] is connecting to [0] at /tmp/vsomeip-0
[info] Listening at /tmp/vsomeip-33
[info] Application(Hello, 33) is initialized (11, 100).
[info] Starting vsomeip application "Hello" using 2 threads
[warning] local_client_endpoint::connect: Couldn't connect to: /tmp/vsomeip-0 (Connection refused / 111)
[info] io thread id from application: 0033 (Hello) is: 7f80f5cd88c0 TID: 1497
[info] routing_manager_proxy::on_disconnect: Client 0x33 calling host_->on_state with DEREGISTERED
[info] io thread id from application: 0033 (Hello) is: 7f80f15e7700 TID: 1501
[info] shutdown thread id from application: 0033 (Hello) is: 7f80f1de8700 TID: 1500
[info] main dispatch thread id from application: 0033 (Hello) is: 7f80f25e9700 TID: 1499
[warning] local_client_endpoint::connect: Couldn't connect to: /tmp/vsomeip-0 (Connection refused / 111)
[info] routing_manager_proxy::on_disconnect: Client 0x33 calling host_->on_state with DEREGISTERED
[warning] local_client_endpoint::connect: Couldn't connect to: /tmp/vsomeip-0 (Connection refused / 111)
[info] routing_manager_proxy::on_disconnect: Client 0x33 calling host_->on_state with DEREGISTERED
[warning] local_client_endpoint::connect: Couldn't connect to: /tmp/vsomeip-0 (Connection refused / 111)
[info] routing_manager_proxy::on_disconnect: Client 0x33 calling host_->on_state with DEREGISTERED
[warning] local_client_endpoint::connect: Couldn't connect to: /tmp/vsomeip-0 (Connection refused / 111)
[info] routing_manager_proxy::on_disconnect: Client 0x33 calling host_->on_state with DEREGISTERED
[warning] local_client_endpoint::connect: Couldn't connect to: /tmp/vsomeip-0 (Connection refused / 111)
[info] routing_manager_proxy::on_disconnect: Client 0x33 calling host_->on_state with DEREGISTERED
Output of Client
[info] Parsed vsomeip configuration in 0ms
[info] Using configuration file: "../serv_prop.json".
[info] Default configuration module loaded.
[info] Initializing vsomeip application "World".
[warning] Routing Manager seems to be inactive. Taking over...
[info] SOME/IP client identifier configured. Using 1212 (was: 1212)
[info] Instantiating routing manager [Host].
[info] init_routing_endpoint Routing endpoint at /tmp/vsomeip-0
[info] Client [1212] is connecting to [0] at /tmp/vsomeip-0
[info] Service Discovery enabled. Trying to load module.
[info] Service Discovery module loaded.
[info] Application(World, 1212) is initialized (11, 100).
[info] OFFER(1212): [1234.5678:0.0]
[info] Starting vsomeip application "World" using 2 threads
[info] Watchdog is disabled!
[info] io thread id from application: 1212 (World) is: 7fa68723d8c0 TID: 5370
[info] Network interface "enp0s3" state changed: up
[info] vSomeIP 2.10.21 | (default)
[info] Sent READY to systemd watchdog
[info] io thread id from application: 1212 (World) is: 7fa6828f3700 TID: 5374
[info] shutdown thread id from application: 1212 (World) is: 7fa6838f5700 TID: 5372
[info] main dispatch thread id from application: 1212 (World) is: 7fa6840f6700 TID: 5371
[warning] Releasing client identifier 0003. Its corresponding application went offline while no routing manager was running.
[info] Application/Client 0003 is deregistering.
All the code used is the same as the code used in Request/Response in the vsomeip tutorial. The config files are the same as the config file specified in the communication between 2 devices section with the IP Addresses changed to match my machine addresses.
Any help would be greatly appreciated, thanks.
I found a solution!!
If you navigate to the /build/examples folder in the vsomeip or vsomeip-master directory, you will find executables (response-sample, subscribe-sample, etc.). If you run them in such a way that they use the same configuration files as used in the vsomeip in 10 mintutes (changing unicast addresses, etc.) it should work perfectly.
This is the configuration file I used.
{
"unicast" : "192.168.43.6",
"logging" :
{
"level" : "debug",
"console" : "true",
"file" : { "enable" : "false", "path" : "/tmp/vsomeip.log" },
"dlt" : "false"
},
"applications" :
[
{
"name" : "World",
"id" : "0x1212"
}
],
"services" :
[
{
"service" : "0x1234",
"instance" : "0x5678",
"unreliable" : "30509"
}
],
"routing" : "World",
"service-discovery" :
{
"enable" : "true",
"multicast" : "224.224.224.245",
"port" : "30490",
"protocol" : "udp",
"initial_delay_min" : "10",
"initial_delay_max" : "100",
"repetitions_base_delay" : "200",
"repetitions_max" : "3",
"ttl" : "3",
"cyclic_offer_delay" : "2000",
"request_response_delay" : "1500"
}
}
I used shell script to do this.
#!/bin/bash
route add -host 224.224.224.245 dev <interface>
export VSOMEIP_CONFIGURATION=<config_file>
export VSOMEIP_APPLICATION_NAME=<application_name>
./<executable>
It did for me anyways! Hope this helps! :)
To clarify Rob Crowley's answer, I got it working using the two unique .json configuration files included in the "vsomeip in 10 minutes" tutorial. I used the "World" configuration on the host offering the service and the "Hello" configuration file on the host running the client. The only thing I need to modify in these files was the "unicast" address. I changed that to match the IP address of the respective hosts.
I also modified the script to use "sudo" before the "route add -host" command, as I found it wouldn't actually add the route without it.
I called make in the "vsomeip/build/examples/" folder to build the examples. The I pointed to on the script for the service service was "notify-sample" executable (vsomeip/build/examples/). The I pointed to on the script for the service service was "subscribe-sample" executable (vsomeip/build/examples/).
This combination worked for me after connecting my two hosts via ethernet and ensuring their IP addresses matched those in the "unicast" field of their respective configuration files.
I have a script that hits a simple API on all my servers every hour to ensure they are functioning properly. My newest server isn't using my normal stack, so I suspect I've configured it improperly. It is currently returning occasional 404 errors to the logging script.
Server Config
Ubuntu, Nginx, PostgreSQL, Supervisor;
Running a Docker container with Django/Wagtail and Gunicorn.
Looks fine when I visit in webbrowser, but my script logged four 404s in the last 12 hours.
My supervisor log shows the 404s but doesn't provide any additional useful information:
[2018-07-16 20:22:35 +0000] [9] [INFO] Booting worker with pid: 9
[2018-07-16 20:22:35 +0000] [10] [INFO] Booting worker with pid: 10
[2018-07-16 20:22:35 +0000] [11] [INFO] Booting worker with pid: 11
Not Found: /_server_health/
Not Found: /_server_health/
Not Found: /_server_health/
There is no relevant information captured in the Nginx log.
Can anyone recommend any steps I can take to gather further information? Or does this fit the pattern of any known problematic server configs?
Edit: It looks like Wagtail is sometimes causing the 404: "Raised by: wagtail.core.views.serve"
Maybe a problem in my urls.py? Should this be configured differently for Wagtail?
url(r'^_server_health$', status_api),
I'm learning to deploy my Flask app onto an Ubuntu AWS EC2 instance and am following the Digital Ocean tutorial. I'm and am encountering one final issue: I'm got my Gunicorn booted up and working using this command: gunicorn --workers 3 --bind unix:project.sock -m 007 wsgi:app to create 3 worker threads and a socket called project.sock.
[2018-02-23 17:14:49 +0000] [INFO] Booting worker with pid: X
[2018-02-23 17:14:49 +0000] [INFO] Booting worker with pid: X
[2018-02-23 17:14:49 +0000] [INFO] Booting worker with pid: X
Connection initialized.
Connection initialized.
Connection initialized.
But I'm encountering errors when attempting to have Nginx connect to my project.sock from Gunicorn- a 502 Bad Gateway error.
Here's my /etc/nginx/sites-available/project configurations:
server {
listen 80;
server_name MY_SERVER_DNS;
location / {
include proxy_params;
proxy_pass http://unix:/home/ubuntu/flaskapp_dev/my_project/project.sock;
}
}
A check of the Nginx error logs shows that it's getting a Permission denied error attempting to connect to my project.sock:
2018/02/23 17:26:46 [crit] 10822#10822: *4 connect() to unix:/home/ubuntu/myproject/myproject/myproject.sock failed
(13: Permission denied) while connecting to upstream,
client: CLIENT_IP, server: MY_SERVER_DNS,
request: "GET / HTTP/1.1",
upstream: "http://unix:/home/ubuntu/myproject/myproject/project.sock:/", host: "MY_SERVER_DNS"
I know there's been plenty of SO posts on this question, but I'm noticing that most of them revolve around uwsgi, which I'm not using here. I suspect that it's obviously a permission issue, so I tried chmod 711 /home/ubuntu/myproject/project and restarting nginx, but that results in the same 502 Bad Gateway error.
The closest SO post to my issue appears to be this one, but it has no answers or comments.
This is just a permissions issue. Nginx that's running under one user cannot get access to unix socket that's owned by another user. I recommend to run nginx server and gunicorn under the same user so unix socket created by gunicron will be accessed by nginx without any problems. chmod 777 is a temporal solution that can show that there is only permission issue if after executing this command the described problem has gone, but it's better to initially run nginx and gunicorn under the same user. Also it's better to specify full path to unix socket to avoid "no such file or directory" possible issue: gunicorn --workers 3 --bind <full_path_to_unix_socket_to_be_created>
I hit one strange issue in akka.remoting: when I run directly "java ..... com.Main", remoting was not started at remote machine, so remote actor system is not listening at configured port. But if I run in "sbt run", it does open the port and listen at it. What could be issue?
Here is console.log:
[dong#ftlxsvr02 pipelinemanager]$ sbt run
[info] Loading project definition from /mnt/fvg02vol8/PipelineManager/test/pipelinemanager/project
[info] Set current project to pipelinemanager (in build file:/mnt/fvg02vol8/PipelineManager/test/pipelinemanager/)
Multiple main classes detected, select one to run:
[1] com.pipelinemanager.Main
[2] com.pipelinemanager.RemoteActorSystem
Enter number: 2
[info] Running com.pipelinemanager.RemoteActorSystem
[DEBUG] [07/22/2016 09:27:39.502] [run-main-0] [EventStream(akka://RemoteSystem)] logger log1-Logging$DefaultLogger started
[DEBUG] [07/22/2016 09:27:39.504] [run-main-0] [EventStream(akka://RemoteSystem)] Default Loggers started
[INFO] [07/22/2016 09:27:39.615] [run-main-0] [akka.remote.Remoting] Starting remoting
[INFO] [07/22/2016 09:27:39.868] [run-main-0] [akka.remote.Remoting] Remoting started; listening on addresses :[akka.tcp://RemoteSystem#ftlxsvr02:9500]
[INFO] [07/22/2016 09:27:39.870] [run-main-0] [akka.remote.Remoting] Remoting now listens on addresses: [akka.tcp://RemoteSystem#ftlxsvr02:9500]
[INFO] [07/22/2016 09:27:39.887] [run-main-0] [akka.actor.ActorSystemImpl(RemoteSystem)] ## Remote Pipeline Manager App Started ##
Remote Pipeline Manager App Started....
But when run in JAVA, it does not work:
[dong#ftlxsvr02 pipelinemanager]$ java -classpath ./bin/pipelinemanager-0.0.6.jar com.pipelinemanager.RemoteActorSystem
Remote Pipeline Manager App Started....
[INFO] [07/22/2016 09:31:39.494] [main] [akka.actor.ActorSystemImpl(RemoteSystem)] ## Remote Pipeline Manager App Started ##
See the difference is following:
[DEBUG] [07/22/2016 09:27:39.502] [run-main-0] [EventStream(akka://RemoteSystem)] logger log1-Logging$DefaultLogger started
[DEBUG] [07/22/2016 09:27:39.504] [run-main-0] [EventStream(akka://RemoteSystem)] Default Loggers started
[INFO] [07/22/2016 09:27:39.615] [run-main-0] [akka.remote.Remoting] Starting remoting
[INFO] [07/22/2016 09:27:39.868] [run-main-0] [akka.remote.Remoting] Remoting started; listening on addresses :[akka.tcp://RemoteSystem#ftlxsvr02:9500]
[INFO] [07/22/2016 09:27:39.870] [run-main-0] [akka.remote.Remoting] Remoting now listens on addresses: [akka.tcp://RemoteSystem#ftlxsvr02:9500]
Any idea? SBT run behavior is what I need
The code to start actor system at remote machine:
...
`
object RemoteActorSystem{
def main(args: Array[String]) {
val fileName = "remotesystem.conf"
val configFile = getClass.getClassLoader.getResource(fileName).getFile
val config = ConfigFactory.parseFile(new File(configFile))
val remoteConfig = new RemotingConfig(fileName)
val system = ActorSystem(remoteConfig.systemName, config)
val defaultActor = system.actorOf(Props[RemoteActorSystem],
remoteConfig.className)
system.log.info("## Remote Pipeline Manager App Started ##")
}
}`