How to write fluent bit input logs to localhost syslog server - docker

I'm working on collecting logs from docker containerized application. I'm able to bring the logs to stdout output plugin but when I am trying syslog output plugin then it is not writing on syslog server.
Below is the configuration file.
[SERVICE]
Parsers_File /etc/td-agent-bit/parsers.conf
[INPUT]
Name forward
[Output]
name syslog
match *
host 127.0.0.1
port 514
mode udp
syslog_format rfc5424
syslog_hostname_key hostname
syslog_appname_key appname
syslog_procid_key procid
syslog_message_key log
The logging property for container application is set to
logging:
driver: fluentd
options:
fluentd-address: localhost:24224
tag: logs
After running the fluent bit /opt/td-agent-bit/bin/td-agent-bit -c fluent.conf
[2021/09/20 08:47:16] [ warn] [engine] failed to flush chunk '8481-1632152835.361162854.flb', retry in 7 seconds: task_id=0, input=forward.0 > output=syslog.0 (out_id=0)
[2021/09/20 08:47:23] [ warn] [engine] chunk '8481-1632152835.361162854.flb' cannot be retried: task_id=0, input=forward.0 > output=syslog.0
[2021/09/20 08:47:26] [ warn] [engine] failed to flush chunk '8481-1632152845.361118393.flb', retry in 6 seconds: task_id=0, input=forward.0 > output=syslog.0 (out_id=0)
[2021/09/20 08:47:32] [ warn] [engine] chunk '8481-1632152845.361118393.flb' cannot be retried: task_id=0, input=forward.0 > output=syslog.0
[2021/09/20 08:47:36] [ warn] [engine] failed to flush chunk '8481-1632152855.361556013.flb', retry in 8 seconds: task_id=0, input=forward.0 > output=syslog.0 (out_id=0)
Can anyone tell what is going wrong here?
Even for simple cpu input plugin syslog does not work. like
/opt/td-agent-bit/bin/td-agent-bit -i cpu -o syslog
output
[2021/09/20 08:53:43] [ info] [cmetrics] version=0.2.1
[2021/09/20 08:53:43] [ info] [output:syslog:syslog.0] setup done for 127.0.0.1:514
[2021/09/20 08:53:43] [ info] [sp] stream processor started
[2021/09/20 08:53:48] [ warn] [engine] failed to flush chunk '8765-1632153224.515974981.flb', retry in 10 seconds: task_id=0, input=cpu.0 > output=syslog.0 (out_id=0)
[2021/09/20 08:53:53] [ warn] [engine] failed to flush chunk '8765-1632153228.516869744.flb', retry in 6 seconds: task_id=1, input=cpu.0 > output=syslog.0 (out_id=0)
[2021/09/20 08:53:58] [ warn] [engine] chunk '8765-1632153224.515974981.flb' cannot be retried: task_id=0, input=cpu.0 > output=syslog.0

i faced similar issue, happening because fluentbit pod itself is 127.0.0.1. i created another rsyslog pod and used its IP to get logs from fluentbit.
https://artifacthub.io/packages/helm/rsyslog/rsyslog

Related

Problems with OpenWRT LTE driver adaptation

everyone.
I tried to adapt the SLM730 LTE module to openwrt.
I use the latest v21.02.3 version
I added usb-modeswitch, kmod-mii, kmod-usb-net, kmod-usb-wdm, kmod-usb-net-qmi-wwan, uqmi, kmod-usb-serial-option, kmod-usb-serial, kmod-usb-serial-wwan, luci, luci-proto-qmi and modified the following files:
net/usb/qmi_wwan.c
usb/serial/option.c
usb/serial/usb_wwan.c
But it has been unable to dial successfully, only TX has data sent, RX is always 0.
The device should be successfully recognized.
root#OpenWrt:~# lsusb -t
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ohci-platform/1p, 12M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M
|__ Port 1: Dev 2, If 0, Class=, Driver=hub/4p, 480M
|__ Port 2: Dev 3, If 0, Class=, Driver=option, 480M
|__ Port 2: Dev 3, If 1, Class=, Driver=option, 480M
|__ Port 2: Dev 3, If 2, Class=, Driver=option, 480M
|__ Port 2: Dev 3, If 3, Class=, Driver=option, 480M
|__ Port 2: Dev 3, If 4, Class=, Driver=, 480M
|__ Port 2: Dev 3, If 5, Class=, Driver=qmi_wwan, 480M
Here is the output of dmesg:
root#OpenWrt:~# dmesg
[ 0.000000] Linux version 5.4.188 (xu#xu-virtual-machine) (gcc version 8.4.0 (OpenWrt GCC 8.4.0 r16554-1d4dea6d4f)) #0 Sat Apr 16 12:59:34 2022
[ 0.000000] Board has DDR2
[ 0.000000] Analog PMU set to hw control
[ 0.000000] Digital PMU set to hw control
[ 0.000000] SoC Type: MediaTek MT7620A ver:2 eco:6
[ 0.000000] printk: bootconsole [early0] enabled
[ 0.000000] CPU0 revision is: 00019650 (MIPS 24KEc)
[ 0.000000] MIPS: machine is Asus RT-AC51U
[ 0.000000] Initrd not found or empty - disabling initrd
[ 0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[ 0.000000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[ 0.000000] Zone ranges:
[ 0.000000] Normal [mem 0x0000000000000000-0x0000000007ffffff]
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000000000000-0x0000000007ffffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff]
[ 0.000000] On node 0 totalpages: 32768
[ 0.000000] Normal zone: 288 pages used for memmap
[ 0.000000] Normal zone: 0 pages reserved
[ 0.000000] Normal zone: 32768 pages, LIFO batch:7
[ 0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[ 0.000000] pcpu-alloc: [0] 0
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 32480
[ 0.000000] Kernel command line: console=ttyS0,57600 rootfstype=squashfs,jffs2
[ 0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[ 0.000000] Writing ErrCtl register=00035bf1
[ 0.000000] Readback ErrCtl register=00035bf1
[ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[ 0.000000] Memory: 122288K/131072K available (4745K kernel code, 206K rwdata, 1048K rodata, 1224K init, 205K bss, 8784K reserved, 0K cma-reserved)
[ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] NR_IRQS: 256
[ 0.000000] random: get_random_bytes called from start_kernel+0x358/0x54c with crng_init=0
[ 0.000000] CPU Clock: 580MHz
[ 0.000000] clocksource: systick: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 583261500 ns
[ 0.000000] systick: enable autosleep mode
[ 0.000000] systick: running - mult: 214748, shift: 32
[ 0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6590553264 ns
[ 0.000010] sched_clock: 32 bits at 290MHz, resolution 3ns, wraps every 7405115902ns
[ 0.007611] Calibrating delay loop... 385.02 BogoMIPS (lpj=770048)
[ 0.045493] pid_max: default: 32768 minimum: 301
[ 0.050185] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.057240] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.071776] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[ 0.081258] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[ 0.087942] pinctrl core: initialized pinctrl subsystem
[ 0.093612] NET: Registered protocol family 16
[ 0.474655] mt7620-pci 10140000.pcie: PCIE0 no card, disable it(RST&CLK)
[ 0.481162] mt7620-pci: probe of 10140000.pcie failed with error -1
[ 0.510746] rt2880_gpio 10000600.gpio: registering 24 gpios
[ 0.516229] rt2880_gpio 10000600.gpio: registering 24 irq handlers
[ 0.522244] GPIO line 10 (enable-leds) hogged as output/low
[ 0.527990] rt2880_gpio 10000688.gpio: registering 1 gpios
[ 0.533337] rt2880_gpio 10000688.gpio: registering 1 irq handlers
[ 0.544501] clocksource: Switched to clocksource systick
[ 0.551104] NET: Registered protocol family 2
[ 0.555548] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
[ 0.563304] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[ 0.571455] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.578865] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.585705] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.592020] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[ 0.598370] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[ 0.605409] NET: Registered protocol family 1
[ 0.609655] PCI: CLS 0 bytes, default 32
[ 0.616407] rt-timer 10000100.timer: maximum frequency is 1220Hz
[ 0.624774] workingset: timestamp_bits=14 max_order=15 bucket_order=1
[ 0.639628] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.645300] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[ 0.673582] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[ 0.681013] printk: console [ttyS0] disabled
[ 0.685220] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20, base_baud = 2500000) is a Palmchip BK-3103
[ 0.694838] printk: console [ttyS0] enabled
[ 0.711374] printk: bootconsole [early0] disabled
[ 0.736465] spi spi0.0: force spi mode3
[ 0.755771] spi-nor spi0.0: w25q128 (16384 Kbytes)
[ 0.765400] 4 fixed-partitions partitions found on MTD device spi0.0
[ 0.778065] Creating 4 MTD partitions on "spi0.0":
[ 0.787625] 0x000000000000-0x000000030000 : "u-boot"
[ 0.798620] 0x000000030000-0x000000040000 : "u-boot-env"
[ 0.810317] 0x000000040000-0x000000050000 : "factory"
[ 0.821535] 0x000000050000-0x000001000000 : "firmware"
[ 0.836226] 2 uimage-fw partitions found on MTD device firmware
[ 0.848103] Creating 2 MTD partitions on "firmware":
[ 0.858012] 0x000000000000-0x0000001e828c : "kernel"
[ 0.869101] 0x0000001e828c-0x000000fb0000 : "rootfs"
[ 0.880012] mtd: device 5 (rootfs) set to be root filesystem
[ 0.893263] 1 squashfs-split partitions found on MTD device rootfs
[ 0.905655] 0x00000056d000-0x000000fb0000 : "rootfs_data"
[ 0.928631] gsw: setting port4 to ephy mode
[ 0.937039] mtk_soc_eth 10100000.ethernet eth0 (uninitialized): port 3 link up (100Mbps/Full duplex)
[ 0.955759] mtk_soc_eth 10100000.ethernet: loaded mt7620 driver
[ 0.968361] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
[ 0.985429] rt2880_wdt 10000120.watchdog: Initialized
[ 0.997153] NET: Registered protocol family 10
[ 1.010488] Segment Routing with IPv6
[ 1.018010] NET: Registered protocol family 17
[ 1.026942] 8021q: 802.1Q VLAN Support v1.8
[ 1.044632] VFS: Mounted root (squashfs filesystem) readonly on device 31:5.
[ 1.065693] Freeing unused kernel memory: 1224K
[ 1.074737] This architecture does not have kernel memory protection.
[ 1.087570] Run /sbin/init as init process
[ 1.376461] random: fast init done
[ 1.986622] init: Console is alive
[ 1.993833] init: - watchdog -
[ 3.420622] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[ 3.635304] usbcore: registered new interface driver usbfs
[ 3.646413] usbcore: registered new interface driver hub
[ 3.657139] usbcore: registered new device driver usb
[ 3.674675] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 3.689736] ehci-fsl: Freescale EHCI Host controller driver
[ 3.702634] ehci-platform: EHCI generic platform driver
[ 3.723451] phy phy-usbphy.0: remote usb device wakeup disabled
[ 3.735261] phy phy-usbphy.0: UTMI 16bit 30MHz
[ 3.744124] ehci-platform 101c0000.ehci: EHCI Host Controller
[ 3.755613] ehci-platform 101c0000.ehci: new USB bus registered, assigned bus number 1
[ 3.771544] ehci-platform 101c0000.ehci: irq 26, io mem 0x101c0000
[ 3.788422] ehci-platform 101c0000.ehci: USB 2.0 started, EHCI 1.00
[ 3.801994] hub 1-0:1.0: USB hub found
[ 3.809990] hub 1-0:1.0: 1 port detected
[ 3.823568] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 3.837841] ohci-platform: OHCI generic platform driver
[ 3.848666] ohci-platform 101c1000.ohci: Generic Platform OHCI controller
[ 3.862262] ohci-platform 101c1000.ohci: new USB bus registered, assigned bus number 2
[ 3.878194] ohci-platform 101c1000.ohci: irq 26, io mem 0x101c1000
[ 3.915374] hub 2-0:1.0: USB hub found
[ 3.923373] hub 2-0:1.0: 1 port detected
[ 3.936495] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[ 3.955358] init: - preinit -
[ 4.080508] usb 1-1: new high-speed USB device number 2 using ehci-platform
[ 4.668805] hub 1-1:1.0: USB hub found
[ 4.768271] hub 1-1:1.0: 4 ports detected
[ 4.848520] random: procd: uninitialized urandom read (4 bytes read)
[ 5.231629] usb 1-1.2: new high-speed USB device number 3 using ehci-platform
[ 5.251938] random: jshn: uninitialized urandom read (4 bytes read)
[ 5.431566] random: jshn: uninitialized urandom read (4 bytes read)
[ 5.916295] urandom_read: 4 callbacks suppressed
[ 5.916304] random: jshn: uninitialized urandom read (4 bytes read)
[ 6.396876] 8021q: adding VLAN 0 to HW filter on device eth0
[ 8.040037] mount_root: jffs2 not ready yet, using temporary tmpfs overlay
[ 8.058390] urandom-seed: Seed file not found (/etc/urandom.seed)
[ 8.181039] procd: - early -
[ 8.187091] procd: - watchdog -
[ 8.847980] random: jshn: uninitialized urandom read (4 bytes read)
[ 8.948155] procd: - watchdog -
[ 8.955179] procd: - ubus -
[ 9.185351] random: ubusd: uninitialized urandom read (4 bytes read)
[ 9.221234] procd: - init -
[ 11.701987] kmodloader: loading kernel modules from /etc/modules.d/*
[ 11.988760] usbcore: registered new interface driver cdc_wdm
[ 12.017931] Loading modules backported from Linux version v5.10.110-0-g3238bffaf992
[ 12.033279] Backport generated by backports.git v5.10.110-1-0-g1fbde860
[ 12.113347] usbcore: registered new interface driver usbserial_generic
[ 12.126509] usbserial: USB Serial support registered for generic
[ 12.193556] xt_time: kernel timezone is -0000
[ 12.239731] urngd: jent-rng init failed, err: 2
[ 12.401783] PPP generic driver version 2.4.2
[ 12.413893] NET: Registered protocol family 24
[ 12.426633] qmi_wwan 1-1.2:1.5: work on RawIP mode
[ 12.437478] qmi_wwan 1-1.2:1.5: cdc-wdm0: USB WDM device
[ 12.449206] qmi_wwan 1-1.2:1.5 wwan0: register 'qmi_wwan' at usb-101c0000.ehci-1.2, WWAN/QMI device, 7a:a8:ae:e9:6e:86
[ 12.470905] usbcore: registered new interface driver qmi_wwan
[ 12.627036] usbcore: registered new interface driver option
[ 12.638338] usbserial: USB Serial support registered for GSM modem (1-port)
[ 12.652833] option 1-1.2:1.0: GSM modem (1-port) converter detected
[ 12.665686] usb 1-1.2: GSM modem (1-port) converter now attached to ttyUSB0
[ 12.679853] option 1-1.2:1.1: GSM modem (1-port) converter detected
[ 12.692748] usb 1-1.2: GSM modem (1-port) converter now attached to ttyUSB1
[ 12.706902] option 1-1.2:1.2: GSM modem (1-port) converter detected
[ 12.719824] usb 1-1.2: GSM modem (1-port) converter now attached to ttyUSB2
[ 12.733958] option 1-1.2:1.3: GSM modem (1-port) converter detected
[ 12.746833] usb 1-1.2: GSM modem (1-port) converter now attached to ttyUSB3
[ 12.943757] rt2800_wmac 10180000.wmac: loaded eeprom from mtd device "factory"
[ 12.958194] ieee80211 phy0: rt2x00_set_rt: Info - RT chipset 6352, rev 0500 detected
[ 12.973669] ieee80211 phy0: rt2x00_set_rf: Info - RF chipset 7620 detected
[ 12.987503] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[ 13.031948] kmodloader: done loading kernel modules from /etc/modules.d/*
[ 24.722303] crng init done
[ 46.735943] jffs2_scan_eraseblock(): End of filesystem marker found at 0x0
[ 46.779026] jffs2_build_filesystem(): unlocking the mtd device...
[ 46.779981] done.
[ 46.796204] jffs2_build_filesystem(): erasing all blocks after the end marker...
[ 48.934666] 8021q: adding VLAN 0 to HW filter on device eth0
[ 49.060777] br-lan: port 1(eth0.1) entered blocking state
[ 49.071639] br-lan: port 1(eth0.1) entered disabled state
[ 49.082849] device eth0.1 entered promiscuous mode
[ 49.092455] device eth0 entered promiscuous mode
[ 49.237050] br-lan: port 1(eth0.1) entered blocking state
[ 49.247889] br-lan: port 1(eth0.1) entered forwarding state
[ 49.938878] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[ 293.242138] done.
[ 293.246035] jffs2: notice: (2443) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
[ 293.495834] overlayfs: upper fs does not support tmpfile.
Attach a screenshot of the network interface
The modified driver code is attached, please refer to
drivers.zip
After two weeks of research, I really have no clue. Please forgive my English writing.
Please give me some pointers. Thank you!

Passenger on Apache fails at Initialize Language Runtime

I am deploying a Ruby on Rails 5.2 app on Ubuntu 16.04 running Apache2 and Passenger 6.0.1 with rvm 1.29.7 in single user mode. I can't seem to get the app to start up with the following failures in the subprocess "Initialize Language Runtime". I've exhausted my search on anyone having a similar problem, so I'm thinking there is something unique to my installation. I'm providing as many details as I think are relevant below, but let me know if you need additional information to help me solve this one:
Here is /var/log/apache2/error.log after I attempt to restart apache:
[Thu Jan 31 03:55:14.310845 2019] [mpm_prefork:notice] [pid 12051] AH00173: SIGHUP received. Attempting to restart
[ N 2019-01-31 03:55:14.3335 14690/T9 age/Cor/CoreMain.cpp:671 ]: Signal received. Gracefully shutting down... (send signal 2 more time(s) to force shutdown)
[ N 2019-01-31 03:55:14.3337 14690/T1 age/Cor/CoreMain.cpp:1245 ]: Received command to shutdown gracefully. Waiting until all clients have disconnected...
[ N 2019-01-31 03:55:14.3338 14690/Tb Ser/Server.h:902 ]: [ApiServer] Freed 0 spare client objects
[ N 2019-01-31 03:55:14.3338 14690/Tb Ser/Server.h:558 ]: [ApiServer] Shutdown finished
[ N 2019-01-31 03:55:14.3339 14690/T9 Ser/Server.h:902 ]: [ServerThr.1] Freed 0 spare client objects
[ N 2019-01-31 03:55:14.3339 14690/T9 Ser/Server.h:558 ]: [ServerThr.1] Shutdown finished
[ N 2019-01-31 03:55:14.3618 19760/T1 age/Wat/WatchdogMain.cpp:1366 ]: Starting Passenger watchdog...
[ N 2019-01-31 03:55:14.3875 19763/T1 age/Cor/CoreMain.cpp:1339 ]: Starting Passenger core...
[ N 2019-01-31 03:55:14.3878 19763/T1 age/Cor/CoreMain.cpp:256 ]: Passenger core running in multi-application mode.
[ N 2019-01-31 03:55:14.3949 19763/T1 age/Cor/CoreMain.cpp:1014 ]: Passenger core online, PID 19763
[Thu Jan 31 03:55:14.415668 2019] [mpm_prefork:notice] [pid 12051] AH00163: Apache/2.4.18 (Ubuntu) Phusion_Passenger/6.0.1 OpenSSL/1.0.2g configured -- resuming normal operations
[Thu Jan 31 03:55:14.415804 2019] [core:notice] [pid 12051] AH00094: Command line: '/usr/sbin/apache2'
[ N 2019-01-31 03:55:14.8130 14690/T1 age/Cor/CoreMain.cpp:1324 ]: Passenger core shutdown finished
[ N 2019-01-31 03:55:16.8669 19763/Tb age/Cor/SecurityUpdateChecker.h:519 ]: Security update check: no update found (next check in 24 hours)
Here is my environment:
ubuntu#ip-172-31-13-212:~$ env
XDG_SESSION_ID=20
rvm_bin_path=/home/ubuntu/.rvm/bin
TERM=xterm-256color
SHELL=/bin/bash
SSH_CLIENT=173.52.197.236 49586 22
SSH_TTY=/dev/pts/2
rvm_stored_umask=0002
USER=ubuntu
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
rvm_path=/home/ubuntu/.rvm
rvm_prefix=/home/ubuntu
MAIL=/var/mail/ubuntu
PATH=/home/ubuntu/bin:/home/ubuntu/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/ubuntu/.rvm/bin:/home/ubuntu/.rvm/bin
rvm_loaded_flag=1
PWD=/home/ubuntu
LANG=en_US.UTF-8
rvm_version=1.29.7-next (master)
SHLVL=1
HOME=/home/ubuntu
LOGNAME=ubuntu
XDG_DATA_DIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop
SSH_CONNECTION=173.52.197.236 49586 172.31.13.212 22
LESSOPEN=| /usr/bin/lesspipe %s
XDG_RUNTIME_DIR=/run/user/1000
LESSCLOSE=/usr/bin/lesspipe %s %s
rvm_user_install_flag=1
_=/usr/bin/env
I found the answer to this issue thanks to the folks supporting the Passenger opensource project. It turns out that in my virtual host file for Apache, the path I provided for PassengerRuby was pointing to a nonexistent ruby. You can read about it here: https://github.com/phusion/passenger/issues/2179

My ROR+Nginx+Passenger+AWS is sending 502 bad gateway

I am developing android service with ROR+Nginx+passenger and Amazon Web service.
The server goes well, but yesterday the server suddenly got downed.
I've tried to solve the problem, but I couldn't.
Here's my problem.
First, the EC2 instance's log/production.log doesn't write any log.
I can get 502 bad gateway error message in my android app log.
Second, all requests including http, https are responded by 502 badgateway.
Third, my AWS load balancer is logging 50X error.
I guess this problem is about ELB, but I don't know how to solve.
I have ssl certificate, and I have only one EC2 instance.
Any help will be appreciated.
Edited
2017-02-22 00:22:30.9139 25313/7f222067b700 age/Cor/Con/CheckoutSession.cpp:269 ]: [Client 1-356202] Returning HTTP 503 due to: Request queue full (configured max. size: 100)
[ 2017-02-22 00:24:00.3704 25313/7f221ee09700 age/Cor/App/Implementation.cpp:304 ]: Could not spawn process for application /home/ec2-user/popcake: An error occurred while starting up the preloader: it did not write a startup response in time.
Error ID: 10045ede
Error details saved to: /tmp/passenger-error-JS1Bnt.html
Message from application: An error occurred while starting up the
preloader: it did not write a startup response in time. Please read this article for more information about this problem.<br>
<h2>Raw process output:</h2>
(empty)
[ 2017-02-22 00:24:00.4527 25313/7f222067b700 age/Cor/Con/CheckoutSession.cpp:285 ]: [Client 1-353433] Cannot checkout session because a spawning error occurred. The identifier of the error is 10045ede. Please see earlier logs for details about the error.
[ 2017-02-22 00:30:29.0872 25313/7f222067b700 age/Cor/CoreMain.cpp:532 ]: Signal received. Gracefully shutting down... (send signal 2 more time(s) to force shutdown)
[ 2017-02-22 00:30:29.1173 25313/7f2227bfc840 age/Cor/CoreMain.cpp:901 ]: Received command to shutdown gracefully. Waiting until all clients have disconnected...
[ 2017-02-22 00:30:29.1174 25313/7f221fe7a700 Ser/Server.h:817 ]: [ApiServer] Freed 0 spare client objects
[ 2017-02-22 00:30:29.1174 25313/7f221fe7a700 Ser/Server.h:464 ]: [ApiServer] Shutdown finished
[ 2017-02-22 00:30:29.2400 25318/7f77237e2700 age/Ust/UstRouterMain.cpp:422 ]: Signal received. Gracefully shutting down... (send signal 2 more time(s) to force shutdown)
[ 2017-02-22 00:30:29.2741 25318/7f772a775840 age/Ust/UstRouterMain.cpp:492 ]: Received command to shutdown gracefully. Waiting until all clients have disconnected...
[ 2017-02-22 00:30:29.3043 25318/7f77237e2700 Ser/Server.h:464 ]: [UstRouter] Shutdown finished
[ 2017-02-22 00:30:29.3042 25318/7f7722fe1700 Ser/Server.h:817 ]: [UstRouterApiServer] Freed 0 spare client objects
[ 2017-02-22 00:30:29.3048 25318/7f7722fe1700 Ser/Server.h:464 ]: [UstRouterApiServer] Shutdown finished
[ 2017-02-22 00:30:29.3720 25318/7f772a775840 age/Ust/UstRouterMain.cpp:523 ]: Passenger UstRouter shutdown finished
[ 2017-02-22 00:30:29.4023 25313/7f222067b700 age/Cor/CoreMain.cpp:532 ]: Signal received. Gracefully shutting down... (send signal 1 more time(s) to force shutdown)
If you see the log that you have added it says "Request queue full", basically you have some api's which are long running, because of which 50x is being thrown after the queue was full.
Restarting nginx might fix the issue for now but you need to look at the response times of your apis and see which are slow performing and fix them otherwise it will be a recurring issue and you will have to restart nginx everyday.

RabbitMQ Generic server rabbit_disk_monitor terminating / eheap_alloc: Cannot allocate 229520 bytes of memory (of type "old_heap")

RabbitMQ crashed.
RabbitMQ was working correctly for many days(10-15 days).
I am not getting why it got crashed.
I am using RabbitMQ 3.4.0 on Erlang 17.0
The erlang has created dump file for the crash. Which shows
eheap_alloc: Cannot allocate 229520 bytes of memory (of type "old_heap").
Also note that the rabbitmq publish-subscribe message load is very low. (max:1-2 messages/second).And RabbitMQ messages are processed as it comes so RabbitMQ is almost empty all the time. The disk space & memory are also sufficient.
More system info:
Limiting to approx 8092 file handles (7280 sockets)
Memory limit set to 6553MB of 16383MB total.
Disk free limit set to 50MB.
The RabbitMQ logs are as below.
=ERROR REPORT==== 18-Jul-2015::04:29:31 ===
** Generic server rabbit_disk_monitor terminating
** Last message in was update
** When Server state == {state,"c:/Users/jasmin.joshi/AppData/Roaming/RabbitMQ/db/rabbit#localhost-mnesia",
50000000,28358258688,100,10000,
#Ref<0.0.106.70488>,false}
** Reason for termination ==
** {eacces,[{erlang,open_port,
[{spawn,"C:\\Windows\\system32\\cmd.exe /c dir /-C /W \"c:/Users/jasmin.joshi/AppData/Roaming/RabbitMQ/db/rabbit#localhost-mnesia\""},
[stream,in,eof,hide]],
[]},
{os,cmd,1,[{file,"os.erl"},{line,204}]},
{rabbit_disk_monitor,get_disk_free,2,[]},
{rabbit_disk_monitor,internal_update,1,[]},
{rabbit_disk_monitor,handle_info,2,[]},
{gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,599}]},
{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]}
=INFO REPORT==== 18-Jul-2015::04:29:31 ===
Disabling disk free space monitoring on unsupported platform:
{{'EXIT',{eacces,[{erlang,open_port,
[{spawn,"C:\\Windows\\system32\\cmd.exe /c dir /-C /W \"c:/Users/jasmin.joshi/AppData/Roaming/RabbitMQ/db/rabbit#localhost-mnesia\""},
[stream,in,eof,hide]],
[]},
{os,cmd,1,[{file,"os.erl"},{line,204}]},
{rabbit_disk_monitor,get_disk_free,2,[]},
{rabbit_disk_monitor,init,1,[]},
{gen_server,init_it,6,[{file,"gen_server.erl"},{line,306}]},
{proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,239}]}]}},
17179336704}
=INFO REPORT==== 18-Jul-2015::04:29:31 ===
Disabling disk free space monitoring on unsupported platform:
{{'EXIT',{eacces,[{erlang,open_port,
[{spawn,"C:\\Windows\\system32\\cmd.exe /c dir /-C /W \"c:/Users/jasmin.joshi/AppData/Roaming/RabbitMQ/db/rabbit#localhost-mnesia\""},
[stream,in,eof,hide]],
[]},
{os,cmd,1,[{file,"os.erl"},{line,204}]},
{rabbit_disk_monitor,get_disk_free,2,[]},
{rabbit_disk_monitor,init,1,[]},
{gen_server,init_it,6,[{file,"gen_server.erl"},{line,306}]},
{proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,239}]}]}},
17179336704}
=CRASH REPORT==== 18-Jul-2015::04:29:31 ===
crasher:
initial call: rabbit_disk_monitor:init/1
pid: <0.167.0>
registered_name: rabbit_disk_monitor
exception exit: {eacces,
[{erlang,open_port,
[{spawn,
"C:\\Windows\\system32\\cmd.exe /c dir /-C /W \"c:/Users/jasmin.joshi/AppData/Roaming/RabbitMQ/db/rabbit#localhost-mnesia\""},
[stream,in,eof,hide]],
[]},
{os,cmd,1,[{file,"os.erl"},{line,204}]},
{rabbit_disk_monitor,get_disk_free,2,[]},
{rabbit_disk_monitor,internal_update,1,[]},
{rabbit_disk_monitor,handle_info,2,[]},
{gen_server,handle_msg,5,
[{file,"gen_server.erl"},{line,599}]},
{proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,239}]}]}
in function gen_server:terminate/6 (gen_server.erl, line 746)
ancestors: [rabbit_disk_monitor_sup,rabbit_sup,<0.140.0>]
messages: []
links: [<0.166.0>]
dictionary: []
trap_exit: false
status: running
heap_size: 4185
stack_size: 27
reductions: 481081978
neighbours:
=SUPERVISOR REPORT==== 18-Jul-2015::04:29:31 ===
Supervisor: {local,rabbit_disk_monitor_sup}
Context: child_terminated
Reason: {eacces,
[{erlang,open_port,
[{spawn,
"C:\\Windows\\system32\\cmd.exe /c dir /-C /W \"c:/Users/jasmin.joshi/AppData/Roaming/RabbitMQ/db/rabbit#localhost-mnesia\""},
[stream,in,eof,hide]],
[]},
{os,cmd,1,[{file,"os.erl"},{line,204}]},
{rabbit_disk_monitor,get_disk_free,2,[]},
{rabbit_disk_monitor,internal_update,1,[]},
{rabbit_disk_monitor,handle_info,2,[]},
{gen_server,handle_msg,5,
[{file,"gen_server.erl"},{line,599}]},
{proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,239}]}]}
Offender: [{pid,<0.167.0>},
{name,rabbit_disk_monitor},
{mfargs,{rabbit_disk_monitor,start_link,[50000000]}},
{restart_type,{transient,1}},
{shutdown,4294967295},
{child_type,worker}]
=CRASH REPORT==== 18-Jul-2015::04:29:31 ===
crasher:
initial call: rabbit_disk_monitor:init/1
pid: <0.24989.51>
registered_name: []
exception exit: unsupported_platform
in function gen_server:init_it/6 (gen_server.erl, line 322)
ancestors: [rabbit_disk_monitor_sup,rabbit_sup,<0.140.0>]
messages: []
links: [<0.166.0>]
dictionary: []
trap_exit: false
status: running
heap_size: 1598
stack_size: 27
reductions: 650
neighbours:
=SUPERVISOR REPORT==== 18-Jul-2015::04:29:31 ===
Supervisor: {local,rabbit_disk_monitor_sup}
Context: start_error
Reason: unsupported_platform
Offender: [{pid,<0.167.0>},
{name,rabbit_disk_monitor},
{mfargs,{rabbit_disk_monitor,start_link,[50000000]}},
{restart_type,{transient,1}},
{shutdown,4294967295},
{child_type,worker}]
=CRASH REPORT==== 18-Jul-2015::04:29:31 ===
crasher:
initial call: rabbit_disk_monitor:init/1
pid: <0.24991.51>
registered_name: []
exception exit: unsupported_platform
in function gen_server:init_it/6 (gen_server.erl, line 322)
ancestors: [rabbit_disk_monitor_sup,rabbit_sup,<0.140.0>]
messages: []
links: [<0.166.0>]
dictionary: []
trap_exit: false
status: running
heap_size: 1598
stack_size: 27
reductions: 650
neighbours:
=SUPERVISOR REPORT==== 18-Jul-2015::04:29:31 ===
Supervisor: {local,rabbit_disk_monitor_sup}
Context: start_error
Reason: unsupported_platform
Offender: [{pid,{restarting,<0.167.0>}},
{name,rabbit_disk_monitor},
{mfargs,{rabbit_disk_monitor,start_link,[50000000]}},
{restart_type,{transient,1}},
{shutdown,4294967295},
{child_type,worker}]
From the error message, rabbitmq can't open more files due to system limits.
You can set max open file numbers to upper value to avoid the problem.
https://serverfault.com/questions/249477/windows-server-2008-r2-max-open-files-limit
There are two unrelated errors here: one is the VM failure to allocate memory. Another is disk space monitor terminating. Disk space monitor is optional and on some less common platforms or with specific security restrictions, it is known to fail. That does not bring the VM down, and certainly has nothing to do with heap allocation failures.
The heap allocation failure typically comes down to two most common cases:
A known bug fixed in Erlang 17.x (don't recall which specific patch release, so use 17.5)
You run 32 bit Erlang/OTP on a 64 bit OS.
Chen Yu's comment about the EACCESS system call error is correct.
I get analog error
systemd unit for activation check: "rabbitmq-server.service"
eheap_alloc: Cannot allocate 306586976 bytes of memory (of type "heap").^M
^M
Crash dump is being written to: erl_crash.dump...done^M
ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 514979
max locked memory (kbytes, -l) 65536
max memory size (kbytes, -m) unlimited
open files (-n) 1048576
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 514979
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
this is crush dump
=erl_crash_dump:0.5
Wed Dec 2 17:16:31 2020
Slogan: eheap_alloc: Cannot allocate 306586976 bytes of memory (of type "heap").
System version: Erlang/OTP 20 [erts-9.2] [source] [64-bit] [smp:32:32] [ds:32:32:10] [async-threads:512] [kernel-poll:true]
Compiled: Mon Feb 5 17:34:00 2018
Taints: crypto,asn1rt_nif,erl_tracer,zlib
Atoms: 34136
Calling Thread: scheduler:0
=scheduler:1
Scheduler Sleep Info Flags: SLEEPING | TSE_SLEEPING | WAITING
Scheduler Sleep Info Aux Work:
Current Port:
Run Queue Max Length: 0
Run Queue High Length: 0
Run Queue Normal Length: 0
Run Queue Low Length: 0
Run Queue Port Length: 0
Run Queue Flags: OUT_OF_WORK | HALFTIME_OUT_OF_WORK
Current Process:
=scheduler:2
Scheduler Sleep Info Flags: SLEEPING | TSE_SLEEPING
Scheduler Sleep Info Aux Work: THR_PRGR_LATER_OP
Current Port:
Run Queue Max Length: 0
Run Queue High Length: 0
Run Queue Normal Length: 0
Run Queue Low Length: 0
Run Queue Port Length: 0
Run Queue Flags: OUT_OF_WORK | HALFTIME_OUT_OF_WORK | NONEMPTY | EXEC
Current Process:
=scheduler:3
Scheduler Sleep Info Flags:
Scheduler Sleep Info Aux Work: DELAYED_AW_WAKEUP | DD | THR_PRGR_LATER_OP
Current Port:
Run Queue Max Length: 0
Run Queue High Length: 0
Run Queue Normal Length: 0
Run Queue Low Length: 0
Run Queue Port Length: 0
Run Queue Flags: OUT_OF_WORK | HALFTIME_OUT_OF_WORK | NONEMPTY | EXEC
Current Process: <0.12306.0>
Current Process State: Running
Current Process Internal State: ACT_PRIO_NORMAL | USR_PRIO_NORMAL | PRQ_PRIO_NORMAL | ACTIVE | RUNNING | TRAP_EXIT | ON_HEAP_MSGQ
Current Process Program counter: 0x00007f2f3ab3a060 (unknown function)
Current Process CP: 0x0000000000000000 (invalid)
Current Process Limited Stack Trace:
0x00007f2b50252d68:SReturn addr 0x32A6EC98 (rabbit_channel:handle_method/3 + 6712)
0x00007f2b50252d78:SReturn addr 0x32A69630 (rabbit_channel:handle_cast/2 + 4160)
0x00007f2b50252df8:SReturn addr 0x51102708 (gen_server2:handle_msg/2 + 1808)
0x00007f2b50252e28:SReturn addr 0x3FD85E70 (proc_lib:init_p_do_apply/3 + 72)
0x00007f2b50252e48:SReturn addr 0x7FFB4948 (<terminate process normally>)
=scheduler:4
Scheduler Sleep Info Flags: SLEEPING | TSE_SLEEPING | WAITING

Solr (Sunspot) runs, but won't start

When I run RAILS_ENV=production rake sunspot:solr:run, Solr starts as expected and the log looks something like this:
0 INFO (main) [ ] o.e.j.u.log Logging initialized #613ms
355 INFO (main) [ ] o.e.j.s.Server jetty-9.2.11.v20150529
380 WARN (main) [ ] o.e.j.s.h.RequestLogHandler !RequestLog
383 INFO (main) [ ] o.e.j.d.p.ScanningAppProvider Deployment monitor [file:/usr/local/rvm/gems/ruby-2.2.1/gems/sunspot_solr- 2.2.3/solr/server/contexts/] at interval 0
1392 INFO (main) [ ] o.e.j.w.StandardDescriptorProcessor NO JSP Support for /solr, did not find org.apache.jasper.servlet.JspServlet
1437 WARN (main) [ ] o.e.j.s.SecurityHandler ServletContext#o.e.j.w.WebAppContext#1f3ff9d4{/solr,file:/usr/local/rvm/gems/ruby-2.2.1/gems/sunspot_solr-2.2.3/solr/server/solr-webapp/webapp/,STARTING}{/usr/local/rvm/gems/ruby-2.2.1/gems/sunspot_solr-2.2.3/solr/server/solr-webapp/webapp} has uncovered http methods for path: /
1456 INFO (main) [ ] o.a.s.s.SolrDispatchFilter SolrDispatchFilter.init(): WebAppClassLoader=879601585#346da7b1
1487 INFO (main) [ ] o.a.s.c.SolrResourceLoader JNDI not configured for solr (NoInitialContextEx)
1488 INFO (main) [ ] o.a.s.c.SolrResourceLoader using system property solr.solr.home: /usr/local/rvm/gems/ruby-2.2.1/gems/sunspot_solr-2.2.3/solr/server/solr
1491 INFO (main) [ ] o.a.s.c.SolrResourceLoader new SolrResourceLoader for directory: '/usr/local/rvm/gems/ruby-2.2.1/gems/sunspot_solr-2.2.3/solr/server/solr/'
1738 INFO (main) [ ] o.a.s.c.SolrXmlConfig Loading container configuration from /usr/local/rvm/gems/ruby-2.2.1/gems/sunspot_solr-2.2.3/solr/server/solr/solr.xml
1848 INFO (main) [ ] o.a.s.c.CoresLocator Config-defined core root directory: /usr/local/rvm/gems/ruby-2.2.1/gems/sunspot_solr-2.2.3/solr/server/solr
1882 INFO (main) [ ] o.a.s.c.CoreContainer New CoreContainer 394200281
1882 INFO (main) [ ] o.a.s.c.CoreContainer Loading cores into CoreContainer [instanceDir=/usr/local/rvm/gems/ruby-2.2.1/gems/sunspot_solr-2.2.3/solr/server/solr/]
1883 INFO (main) [ ] o.a.s.c.CoreContainer loading shared library: /usr/local/rvm/gems/ruby-2.2.1/gems/sunspot_solr-2.2.3/solr/server/solr/lib
1883 WARN (main) [ ] o.a.s.c.SolrResourceLoader Can't find (or read) directory to add to classloader: lib (resolved as: /usr/local/rvm/gems/ruby-2.2.1/gems/sunspot_solr-2.2.3/solr/server/solr/lib).
1905 INFO (main) [ ] o.a.s.h.c.HttpShardHandlerFactory created with socketTimeout : 600000,connTimeout : 60000,maxConnectionsPerHost : 20,maxConnections : 10000,corePoolSize : 0,maximumPoolSize : 2147483647,maxThreadIdleTime : 5,sizeOfQueue : -1,fairnessPolicy : false,useRetries : false,
2333 INFO (main) [ ] o.a.s.u.UpdateShardHandler Creating UpdateShardHandler HTTP client with params: socketTimeout=600000&connTimeout=60000&retry=true
2338 INFO (main) [ ] o.a.s.l.LogWatcher SLF4J impl is org.slf4j.impl.Log4jLoggerFactory
2339 INFO (main) [ ] o.a.s.l.LogWatcher Registering Log Listener [Log4j (org.slf4j.impl.Log4jLoggerFactory)]
2341 INFO (main) [ ] o.a.s.c.CoreContainer Security conf doesn't exist. Skipping setup for authorization module.
2341 INFO (main) [ ] o.a.s.c.CoreContainer No authentication plugin used.
2379 INFO (main) [ ] o.a.s.c.CoresLocator Looking for core definitions underneath /usr/local/rvm/gems/ruby-2.2.1/gems/sunspot_solr-2.2.3/solr/server/solr
2385 INFO (main) [ ] o.a.s.c.CoresLocator Found 0 core definitions
2389 INFO (main) [ ] o.a.s.s.SolrDispatchFilter user.dir=/usr/local/rvm/gems/ruby-2.2.1/gems/sunspot_solr-2.2.3/solr/server
2390 INFO (main) [ ] o.a.s.s.SolrDispatchFilter SolrDispatchFilter.init() done
2435 INFO (main) [ ] o.e.j.s.h.ContextHandler Started o.e.j.w.WebAppContext#1f3ff9d4{/solr,file:/usr/local/rvm/gems/ruby-2.2.1/gems/sunspot_solr-2.2.3/solr/server/solr-webapp/webapp/,AVAILABLE}{/usr/local/rvm/gems/ruby-2.2.1/gems/sunspot_solr-2.2.3/solr/server/solr-webapp/webapp}
2458 INFO (main) [ ] o.e.j.s.ServerConnector Started ServerConnector#649ad901{HTTP/1.1}{0.0.0.0:8080}
2458 INFO (main) [ ] o.e.j.s.Server Started #3074ms
6677 INFO (qtp207710485-20) [ ] o.a.s.s.SolrDispatchFilter [admin] webapp=null path=/admin/cores params={indexInfo=false&_=1453515549920&wt=json} status=0 QTime=58
6796 INFO (qtp207710485-19) [ ] o.a.s.s.SolrDispatchFilter [admin] webapp=null path=/admin/info/system params={_=1453515550069&wt=json} status=0 QTime=23
I can also access localhost:8080/solr.
However, when I run RAILS_ENV=production rake sunspot:solr:start --trace, I get a normal trace:
** Invoke sunspot:solr:start (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute sunspot:solr:start
Removing stale PID file at /home/rails/webapp/solr/pids/production/sunspot-solr-production.pid
Successfully started Solr ...
Yet I can't access localhost:8080 (it gives me an ERR_CONNECTION_REFUSED), and when I try to do anything else involving Solr, I get an Errno::ECONNREFUSED: Connection refused error.
For example, when I run RAILS_ENV=production rake sunspot:solr:reindex after starting Solr, I get:
Errno::ECONNREFUSED: Connection refused - {:data=>"<?xml version=\"1.0\" encoding=\"UTF-8\"?><delete><query>type:Piece</query></delete>", :headers=>{"Content-Type"=>"text/xml"}, :method=>:post, :params=>{:wt=>:ruby}, :query=>"wt=ruby", :path=>"update", :uri=>#<URI::HTTP http://localhost:8080/solr/update?wt=ruby>, :open_timeout=>nil, :read_timeout=>nil, :retry_503=>nil, :retry_after_limit=>nil}
....
Errno::ECONNREFUSED: Connection refused - connect(2) for "localhost" port 8080
My sunspot.yml file looks like this, after this:
production:
solr:
hostname: localhost
port: 8080 #tomcat defaults to port 8080
path: /solr
log_level: WARNING
solr_home: solr
The Solr server was working fine before. The connection errors started when I tried to seed the production db and received an EOFError: end of file reached. I can post the full trace for that error if needed.
Please help!
I had a similar situation happen. Sunspot would say that Solr had started successfully, but it never actually did start. Turns out I was using Java 1.6 and installing JDK 8 fixed it for me.

Resources