Rails. First request too slow, times out, the next ones are faster - ruby

I'm developing a rails application. After pushing the git on Heroku without trouble, the app show an error "request time out" inside the webbrowser.
If i'm re-trying 1 minute after, the app display the page very quikly on the webbrowser.
CONFIGURATION
Find below my configuration
Rails 5.1.2
psql (PostgreSQL) 9.6.1
The main info inside the gem file:
ruby '2.2.6'
gem 'rails', '~> 5.1.1'
gem 'pg', '~> 0.18'
gem 'puma', '~> 3.7'
Heroku
Standard-2X dynos, Shared, 1 GB RAM
Heroku Postgres :: Brown
Memcached Cloud :free
Papertrail :free
STANDARD PLAN
LOG
The log of the first very long request ( notice that I restart the server before the test to reproduce the problem that append every morning at the first request)
Aug 25 03:28:15 myapplication app/web.1: => Booting Puma
Aug 25 03:28:15 myapplication app/web.1: => Rails 5.1.2 application starting in production on http://0.0.0.0:41080
Aug 25 03:28:15 myapplication app/web.1: => Run `rails server -h` for more startup options
Aug 25 03:28:15 myapplication app/web.1: [4] Puma starting in cluster mode...
Aug 25 03:28:15 myapplication app/web.1: [4] * Version 3.9.1 (ruby 2.2.6-p396), codename: Private Caller
Aug 25 03:28:15 myapplication app/web.1: [4] * Min threads: 5, max threads: 5
Aug 25 03:28:15 myapplication app/web.1: [4] * Environment: production
Aug 25 03:28:15 myapplication app/web.1: [4] * Process workers: 2
Aug 25 03:28:15 myapplication app/web.1: [4] * Preloading application
Aug 25 03:28:15 myapplication app/web.1: [4] * Listening on tcp://0.0.0.0:41080
Aug 25 03:28:15 myapplication app/web.1: [4] Use Ctrl-C to stop
Aug 25 03:28:15 myapplication app/web.1: [4] - Worker 0 (pid: 6) booted, phase: 0
Aug 25 03:28:15 myapplication app/web.1: [4] - Worker 1 (pid: 19) booted, phase: 0
Aug 25 03:28:15 myapplication heroku/web.1: State changed from starting to up
Aug 25 03:28:37 myapplication app/heroku-postgres: source=HEROKU_POSTGRESQL_BROWN sample#current_transaction=2339 sample#db_size=25066008bytes sample#tables=21 sample#active-connections=2 sample#waiting-connections=0 sample#index-cache-hit-rate=0.99931 sample#table-cache-hit-rate=0.996 sample#load-avg-1m=0 sample#load-avg-5m=0 sample#load-avg-15m=0 sample#read-iops=0 sample#write-iops=0.057733 sample#memory-total=4044984kB sample#memory-free=1550168kB sample#memory-cached=1945532kB sample#memory-postgres=16880kB
Aug 25 03:30:38 myapplication app/heroku-postgres: source=HEROKU_POSTGRESQL_BROWN sample#current_transaction=2339 sample#db_size=25066008bytes sample#tables=21 sample#active-connections=2 sample#waiting-connections=0 sample#index-cache-hit-rate=0.99931 sample#table-cache-hit-rate=0.996 sample#load-avg-1m=0 sample#load-avg-5m=0 sample#load-avg-15m=0 sample#read-iops=0 sample#write-iops=0.029687 sample#memory-total=4044984kB sample#memory-free=1550000kB sample#memory-cached=1945544kB sample#memory-postgres=16880kB
Aug 25 03:31:39 myapplication app/heroku-postgres: source=HEROKU_POSTGRESQL_BROWN sample#current_transaction=2339 sample#db_size=25066008bytes sample#tables=21 sample#active-connections=2 sample#waiting-connections=0 sample#index-cache-hit-rate=0.99931 sample#table-cache-hit-rate=0.996 sample#load-avg-1m=0 sample#load-avg-5m=0 sample#load-avg-15m=0 sample#read-iops=0 sample#write-iops=0.029687 sample#memory-total=4044984kB sample#memory-free=1549940kB sample#memory-cached=1945564kB sample#memory-postgres=16880kB
Aug 25 03:32:38 myapplication app/heroku-postgres: source=HEROKU_POSTGRESQL_BROWN sample#current_transaction=2339 sample#db_size=25066008bytes sample#tables=21 sample#active-connections=2 sample#waiting-connections=0 sample#index-cache-hit-rate=0.99931 sample#table-cache-hit-rate=0.996 sample#load-avg-1m=0 sample#load-avg-5m=0 sample#load-avg-15m=0 sample#read-iops=0 sample#write-iops=0.029687 sample#memory-total=4044984kB sample#memory-free=1550284kB sample#memory-cached=1945568kB sample#memory-postgres=16880kB
Aug 25 03:33:39 myapplication app/heroku-postgres: source=HEROKU_POSTGRESQL_BROWN sample#current_transaction=2339 sample#db_size=25066008bytes sample#tables=21 sample#active-connections=2 sample#waiting-connections=0 sample#index-cache-hit-rate=0.99931 sample#table-cache-hit-rate=0.996 sample#load-avg-1m=0 sample#load-avg-5m=0 sample#load-avg-15m=0 sample#read-iops=0 sample#write-iops=0.030191 sample#memory-total=4044984kB sample#memory-free=1550128kB sample#memory-cached=1945580kB sample#memory-postgres=16880kB
Aug 25 03:33:51 myapplication heroku/router: at=info method=GET path="/" host=myapplication.herokuapp.com request_id=afa5c118-7319-4b9b-a945-60ed57a63062 fwd="90.87.43.215" dyno=web.1 connect=0ms service=72ms status=301 bytes=371 protocol=https
Aug 25 03:33:51 myapplication app/web.1: I, [2017-08-25T10:33:50.584824 #19] INFO -- : [afa5c118-7319-4b9b-a945-60ed57a63062] Started GET "/" for 90.87.43.215 at 2017-08-25 10:33:50 +0000
Aug 25 03:33:51 myapplication app/web.1: I, [2017-08-25T10:33:50.665212 #19] INFO -- : [6db31a1a-39a5-4a8f-9ba1-cf35ceae5f61] Started GET "/projets/new" for 90.87.43.215 at 2017-08-25 10:33:50 +0000
Aug 25 03:33:51 myapplication app/web.1: I, [2017-08-25T10:33:50.670054 #19] INFO -- : [6db31a1a-39a5-4a8f-9ba1-cf35ceae5f61] Processing by ProjetsController#new as HTML
Aug 25 03:33:51 myapplication app/web.1: D, [2017-08-25T10:33:50.783930 #19] DEBUG -- : [6db31a1a-39a5-4a8f-9ba1-cf35ceae5f61] User Load (3.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT $2 [["id", 2], ["LIMIT", 1]]
Aug 25 03:33:51 myapplication app/web.1: D, [2017-08-25T10:33:50.928475 #19] DEBUG -- : [6db31a1a-39a5-4a8f-9ba1-cf35ceae5f61] Regleconfiguration Load (3.4ms) SELECT "regleconfigurations".* FROM "regleconfigurations" ORDER BY "regleconfigurations"."id" DESC LIMIT $1 [["LIMIT", 1]]
Aug 25 03:33:51 myapplication app/web.1: D, [2017-08-25T10:33:50.955570 #19] DEBUG -- : [6db31a1a-39a5-4a8f-9ba1-cf35ceae5f61] Tarifoptionbt Load (3.2ms) SELECT "tarifoptionbts".* FROM "tarifoptionbts"
Aug 25 03:33:51 myapplication app/web.1: I, [2017-08-25T10:33:50.989799 #19] INFO -- : [6db31a1a-39a5-4a8f-9ba1-cf35ceae5f61] Rendering projets/new.html.erb within layouts/application
Aug 25 03:34:21 myapplication heroku/router: at=error code=H12 desc="Request timeout" method=GET path="/projets/new" host=myapplication.herokuapp.com request_id=6db31a1a-39a5-4a8f-9ba1-cf35ceae5f61 fwd="90.87.43.215" dyno=web.1 connect=0ms service=30001ms status=503 bytes=0 protocol=https
Aug 25 03:34:39 myapplication app/heroku-postgres: source=HEROKU_POSTGRESQL_BROWN sample#current_transaction=2339 sample#db_size=25066008bytes sample#tables=21 sample#active-connections=3 sample#waiting-connections=0 sample#index-cache-hit-rate=0.99931 sample#table-cache-hit-rate=0.996 sample#load-avg-1m=0 sample#load-avg-5m=0 sample#load-avg-15m=0 sample#read-iops=0 sample#write-iops=0.029687 sample#memory-total=4044984kB sample#memory-free=1547512kB sample#memory-cached=1945596kB sample#memory-postgres=20036kB
Aug 25 03:35:37 myapplication app/web.1: I, [2017-08-25T10:35:37.131381 #19] INFO -- : [6db31a1a-39a5-4a8f-9ba1-cf35ceae5f61] Rendered projets/_etapebar.html.erb (106132.4ms)
[.....] render 30 partial view
Aug 25 03:35:38 myapplication app/web.1: I, [2017-08-25T10:35:37.495939 #19] INFO -- : [6db31a1a-39a5-4a8f-9ba1-cf35ceae5f61] Completed 200 OK in 106826ms (Views: 106499.5ms | ActiveRecord: 50.2ms)
If I render a second time the same view I get this log:
Aug 25 05:42:45 myapplication app/web.1: I, [2017-08-25T12:42:44.339695 #19] INFO -- : [9c38a6b8-73d4-4e31-9ac3-df2ec8b21049] Started GET "/projets/new" for 90.87.43.215 at 2017-08-25 12:42:44 +0000
Aug 25 05:42:45 myapplication app/web.1: I, [2017-08-25T12:42:44.341197 #19] INFO -- : [9c38a6b8-73d4-4e31-9ac3-df2ec8b21049] Processing by ProjetsController#new as HTML
Aug 25 05:42:45 myapplication app/web.1: D, [2017-08-25T12:42:44.348612 #19] DEBUG -- : [9c38a6b8-73d4-4e31-9ac3-df2ec8b21049] User Load (1.7ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT $2 [["id", 2], ["LIMIT", 1]]
Aug 25 05:42:45 myapplication app/web.1: I, [2017-08-25T12:42:44.351579 #19] INFO -- : [9c38a6b8-73d4-4e31-9ac3-df2ec8b21049] Completed 200 OK in 10ms (ActiveRecord: 1.7ms)
The application jump from a 106 second to serve a first request ( that's create a Heroku error) to a very short time in a second render
ASSET
Log show that the second call get asset from request.
In my app, on each page, I load the js of the current controller:
in application.html.erb
<%= stylesheet_link_tag controller.controller_name if TarifsDynamique::Application.assets.find_asset("#{controller.controller_name}.css") %>
<%= javascript_include_tag params[:controller] if TarifsDynamique::Application.assets.find_asset("#{controller.controller_name}.js") %>
and in from application.js and .css, i remove //=require .
and in asset.rb , I add
Rails.application.config.assets.precompile += ["#{controller}.js", "#{controller}.css"]
whith all the controller.
It's work find ( in devvellpoment and in production after the first call).
but when, I try to
$Heroku run assets:precompile
I got this error
Running rake assets:precompile on ⬢ myapplication... up, run.9829 (Standard-1X)
Yarn executable was not detected in the system.
Download Yarn at https://yarnpkg.com/en/docs/install
...
CACHE
I try to add cache to speed up the first page
cache action inside the controler:
class ProjetsController < ApplicationController
caches_action :new, :edit
cache the view: new.html.erb
<%= render 'form', projet: #projet, cached: true %>
active cache inside production.rb
Rails.application.configure do
config.cache_classes = true
NO IDEA
I have no more idea
If you get an idea , its will be so helpfull !
Thanks.
[EDIT]
SOLUTION
Hi,
I finally found what's going on !
I have 50 images to compile in the asset folder.
Even if I precompile them, at the first request after a long sleep, Rails precompile them again that take tomany time.
1- I move image on amason S3,
2- change image_tag to image_static_tag
3- create a image_static_tag helper that serve static file from s3
4- redeploy the app and now everything is ok !!
THANKS FOR YOUR HELP

Related

drbd & Corosync - My drbd works, it shows me that it is upToDate, but it is not

I have a high availability cluster with two nodes, with a resource for drbd, a virtual IP and the mariaDB files shared on the drbd partition.
Everything seems to work OK, but drbd is not syncing the latest files I have created, even though drbd status tells me they are UpToDate.
sudo drbdadm status
iba role:Primary
disk:UpToDate
Pcs also does not show errors
sudo pcs status
Cluster name: cluster_iba
Cluster Summary:
* Stack: corosync
* Current DC: iba2-ip192 (version 2.0.3-4b1f869f0f) - partition with quorum
* Last updated: Tue Feb 22 18:16:20 2022
* Last change: Mon Feb 21 16:19:38 2022 by root via cibadmin on iba1-ip192
* 2 nodes configured
* 6 resource instances configured
Node List:
* Online: [ iba1-ip192 iba2-ip192 ]
Full List of Resources:
* virtual_ip (ocf::heartbeat:IPaddr2): Started iba2-ip192
* Clone Set: DrbdData-clone [DrbdData] (promotable):
* Masters: [ iba2-ip192 ]
* Slaves: [ iba1-ip192 ]
* DrbdFS (ocf::heartbeat:Filesystem): Started iba2-ip192
* WebServer (ocf::heartbeat:apache): Started iba2-ip192
* Maria (ocf::heartbeat:mysql): Started iba2-ip192
Daemon Status:
corosync: active/enabled
pacemaker: active/enabled
pcsd: active/enabled
All constraint:
sudo pcs constraint list --full
Location Constraints:
Ordering Constraints:
promote DrbdData-clone then start DrbdFS (kind:Mandatory) (id:order-DrbdData-clone-DrbdFS-mandatory)
start DrbdFS then start virtual_ip (kind:Mandatory) (id:order-DrbdFS-virtual_ip-mandatory)
start virtual_ip then start WebServer (kind:Mandatory) (id:order-virtual_ip-WebServer-mandatory)
start DrbdFS then start Maria (kind:Mandatory) (id:order-DrbdFS-Maria-mandatory)
Colocation Constraints:
DrbdFS with DrbdData-clone (score:INFINITY) (with-rsc-role:Master) (id:colocation-DrbdFS-DrbdData-clone-INFINITY)
virtual_ip with DrbdFS (score:INFINITY) (id:colocation-virtual_ip-DrbdFS-INFINITY)
WebServer with virtual_ip (score:INFINITY) (id:colocation-WebServer-virtual_ip-INFINITY)
Maria with DrbdFS (score:INFINITY) (id:colocation-Maria-DrbdFS-INFINITY)
Ticket Constraints:
The files in /mnt/datosDRBD in node iba2-ip192 (when it's the master),
/mnt/datosDRBD$ ls -l
total 80
-rw-r--r-- 1 root root 5801 feb 21 12:16 drbd_cfg
-rw-r--r-- 1 root root 10494 feb 21 12:18 fs_cfg
drwx------ 2 root root 16384 feb 21 10:12 lost+found
drwxr-xr-x 4 mysql mysql 4096 feb 22 18:00 mariaDB
-rw-r--r-- 1 root root 17942 feb 21 12:39 MariaDB_cfg
-rw-r--r-- 1 root root 5 feb 21 10:13 testMParicio.txt
-rw-r--r-- 1 root root 13578 feb 21 12:21 WebServer_cfg
And the files in /mnt/datosDRBD in node iba1-ip192 (when it's the master),
ls -l
total 92
-rw-r--r-- 1 root root 5801 feb 21 12:16 drbd_cfg
drwxrwxrwx 5 www-data www-data 4096 feb 22 13:41 FilesSGITV
-rw-r--r-- 1 root root 10494 feb 21 12:18 fs_cfg
drwx------ 2 root root 16384 feb 21 10:12 lost+found
drwxr-xr-x 7 mysql mysql 4096 feb 22 17:55 mariaDB
-rw-r--r-- 1 root root 17942 feb 21 12:39 MariaDB_cfg
-rw-r--r-- 1 root root 5 feb 22 17:58 testMParicio2.txt
-rw-r--r-- 1 www-data www-data 9 feb 22 17:58 testMParicio3.txt
-rw-r--r-- 1 root root 5 feb 21 10:13 testMParicio.txt
-rw-r--r-- 1 root root 13578 feb 21 12:21 WebServer_cfg
All new files, testMParicio2.txt testMParicio3.txt and the folder FilesSGITV are missing.
I do not know what to do. I am very lost.
I appreciate any help, thanks.
(EDIT)
My config for drbd, in both nodes...
cat /etc/drbd.conf
# You can find an example in /usr/share/doc/drbd.../drbd.conf.example
include "drbd.d/global_common.conf";
include "drbd.d/*.res";
And my *.res config, in both nodes too:
resource iba {
device /dev/drbd0;
disk /dev/md3;
meta-disk internal;
on iba1 {
address 10.0.0.248:7789;
}
on iba2 {
address 10.0.0.249:7789;
}
}
drbdadm use iba1 and iba2, with IP 10.0.0.248 and 10.0.0.249
Corosync use iba1-ip192 and iba2-192, with IP 192.168.1.248 and 192.168.1.249
cat /etc/hosts
127.0.0.1 localhost
#127.0.1.1 iba1
10.0.0.248 iba1
10.0.0.249 iba2
192.168.1.248 iba1-ip192
192.168.1.249 iba2-ip192
cat /etc/drbd.d/global_common.conf
global {
usage-count yes;
udev-always-use-vnr; # treat implicit the same as explicit volumes
}
common {
handlers {
}
startup {
}
options {
}
disk {
}
net {
protocol C;
}
}
(EDIT 2)
I have found a problem in /proc/drbd
In primary node:
cat /proc/drbd
version: 8.4.11 (api:1/proto:86-101)
srcversion: FC3433D849E3B88C1E7B55C
0: cs:StandAlone ro:Primary/Unknown ds:UpToDate/DUnknown r-----
ns:0 nr:0 dw:2284 dr:11625 al:6 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:42364728
in secondary node
cat /proc/drbd
version: 8.4.11 (api:1/proto:86-101)
srcversion: FC3433D849E3B88C1E7B55C
0: cs:StandAlone ro:Secondary/Unknown ds:UpToDate/DUnknown r-----
ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:36538580
Secondary node don't remember ssh key, fix with
ssh-keygen -R 10.0.0.248
ssh-copy-id iba#iba1
But drbd still with StandAlone status.
I don't know how to continue
I have found a Split-Brain that did not appear in the status of pcs.
sudo journalctl | grep Split-Brain
feb 21 13:00:10 ibatec1 kernel: block drbd0: Split-Brain detected but unresolved, dropping connection!
feb 21 13:21:40 ibatec1 kernel: block drbd0: Split-Brain detected but unresolved, dropping connection!
feb 21 13:27:54 ibatec1 kernel: block drbd0: Split-Brain detected but unresolved, dropping connection!
I have stopped the cluster, with --force on the master,
Then...
On split-brain victim (assuming the DRBD resource is iba):
drbdadm disconnect iba
drbdadm secondary iba
drbdadm connect --discard-my-data iba
On split-brain survivor:
drbdadm primary iba
drbdadm connect iba

Can't start elasticsearch service on centos 7

I just install the elasticsearch but when I try to start is not work. Anyone have any idea what I can do?
sudo journalctl --unit elasticsearch
-- Logs begin at Sat 2020-08-29 09:54:58 UTC, end at Sat 2020-08-29 13:15:35 UTC. --
Aug 29 10:10:28 meriadoc.dallas-idc.com systemd[1]: Starting Elasticsearch...
Aug 29 10:10:35 meriadoc.dallas-idc.com systemd-entrypoint[3579]: fatal error in thread [main], exiting
Aug 29 10:10:35 meriadoc.dallas-idc.com systemd-entrypoint[3579]: java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native
Aug 29 10:10:35 meriadoc.dallas-idc.com systemd-entrypoint[3579]: at org.elasticsearch.systemd.Libsystemd.lambda$static$0(Libsystemd.java:34)
Aug 29 10:10:35 meriadoc.dallas-idc.com systemd-entrypoint[3579]: at java.base/java.security.AccessController.doPrivileged(AccessController.java:312)
Aug 29 10:10:35 meriadoc.dallas-idc.com systemd-entrypoint[3579]: at org.elasticsearch.systemd.Libsystemd.<clinit>(Libsystemd.java:33)
Aug 29 10:10:35 meriadoc.dallas-idc.com systemd-entrypoint[3579]: at org.elasticsearch.systemd.SystemdPlugin.sd_notify(SystemdPlugin.java:126)
Aug 29 10:10:35 meriadoc.dallas-idc.com systemd-entrypoint[3579]: at org.elasticsearch.systemd.SystemdPlugin.onNodeStarted(SystemdPlugin.java:137)
Aug 29 10:10:35 meriadoc.dallas-idc.com systemd-entrypoint[3579]: at java.base/java.util.ArrayList.forEach(ArrayList.java:1510)
Aug 29 10:10:35 meriadoc.dallas-idc.com systemd-entrypoint[3579]: at org.elasticsearch.node.Node.start(Node.java:868)
Aug 29 10:10:35 meriadoc.dallas-idc.com systemd-entrypoint[3579]: at org.elasticsearch.bootstrap.Bootstrap.start(Bootstrap.java:317)
Aug 29 10:10:35 meriadoc.dallas-idc.com systemd-entrypoint[3579]: at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:402)
Aug 29 10:10:35 meriadoc.dallas-idc.com systemd-entrypoint[3579]: at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170)
Aug 29 10:10:35 meriadoc.dallas-idc.com systemd-entrypoint[3579]: at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:161)
Aug 29 10:10:35 meriadoc.dallas-idc.com systemd-entrypoint[3579]: at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86)
Aug 29 10:10:35 meriadoc.dallas-idc.com systemd-entrypoint[3579]: at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:127)
Aug 29 10:10:35 meriadoc.dallas-idc.com systemd-entrypoint[3579]: at org.elasticsearch.cli.Command.main(Command.java:90)
Aug 29 10:10:35 meriadoc.dallas-idc.com systemd-entrypoint[3579]: at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:126)
Aug 29 10:10:35 meriadoc.dallas-idc.com systemd-entrypoint[3579]: at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92)
Aug 29 10:10:35 meriadoc.dallas-idc.com systemd[1]: elasticsearch.service: main process exited, code=exited, status=1/FAILURE
Aug 29 10:10:35 meriadoc.dallas-idc.com systemd[1]: Failed to start Elasticsearch.
Aug 29 10:10:35 meriadoc.dallas-idc.com systemd[1]: Unit elasticsearch.service entered failed state.
Thank you so much
If you notice carefully the error message in startup logs, which seems to cause the startup failure.
Aug 29 10:10:35 meriadoc.dallas-idc.com systemd-entrypoint[3579]:
java.lang.NoClassDefFoundError: Could not initialize class
com.sun.jna.Native
Please follow the https://www.jetbrains.com/help/upsource/error-could-not-initialize-class-com-sun-jna-native.html#8182b, which explained in detail the cause of the error and 2 ways to resolve that.

run ruby script at login xfce

I'm using manjaro and I want to run a ruby script after login.
Here's my script:
def get_line(filename, lineno)
File.open(filename,'r') do |f|
f.gets until f.lineno == lineno - 1
f.gets
end
end
filename = "list.md"
filepath = File.join(File.dirname(__FILE__), filename)
count = %x{cat #{filepath} | sed '/^\s*$/d' | wc -l }.to_i
random_element = rand((1..count))
line = get_line(filepath, random_element)
options = { :address => "smtp.gmail.com",
:port => 587,
:user_name => 'xxxx#gmail.com',
:password => 'xxxxx',
:authentication => 'plain',
:enable_starttls_auto => true }
Mail.defaults do
delivery_method :smtp, options
end
Mail.deliver do
to 'xxxxx#gmail.com'
from 'xxxxxx#gmail.com'
subject 'Test'
body "#{line}"
end
I tried /etc/profile.d, .bash_profile and as a service at /etc/systemd/system
[Unit]
Description=Example systemd service.
[Service]
Type=simple
ExecStart=/usr/bin/ruby /home/dnl/Documents/git/send_mail_reminders/send_mail.rb
[Install]
WantedBy=multi-user.target
I did service start, status, enable and then reboot.
Output from service status
● autostart.service - Example systemd service.
Loaded: loaded (/etc/systemd/system/autostart.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Sun 2020-08-16 13:28:10 CEST; 5min ago
Process: 439 ExecStart=/usr/bin/ruby /home/dnl/Documents/git/send_mail_reminders/send_mail.rb (code=exited, status=1/FAILURE)
Main PID: 439 (code=exited, status=1/FAILURE)
Aug 16 13:28:10 dnl ruby[439]: from /usr/lib/ruby/2.7.0/net/smtp.rb:548:in `do_start'
Aug 16 13:28:10 dnl ruby[439]: from /usr/lib/ruby/2.7.0/net/smtp.rb:518:in `start'
Aug 16 13:28:10 dnl ruby[439]: from /usr/lib/ruby/gems/2.7.0/gems/mail-2.7.1/lib/mail/network/delivery_methods/smtp.rb:109:in `start_smtp_session'
Aug 16 13:28:10 dnl ruby[439]: from /usr/lib/ruby/gems/2.7.0/gems/mail-2.7.1/lib/mail/network/delivery_methods/smtp.rb:100:in `deliver!'
Aug 16 13:28:10 dnl ruby[439]: from /usr/lib/ruby/gems/2.7.0/gems/mail-2.7.1/lib/mail/message.rb:2159:in `do_delivery'
Aug 16 13:28:10 dnl ruby[439]: from /usr/lib/ruby/gems/2.7.0/gems/mail-2.7.1/lib/mail/message.rb:262:in `deliver'
Aug 16 13:28:10 dnl ruby[439]: from /usr/lib/ruby/gems/2.7.0/gems/mail-2.7.1/lib/mail/mail.rb:133:in `deliver'
Aug 16 13:28:10 dnl ruby[439]: from /home/dnl/Documents/git/send_mail_reminders/send_mail.rb:30:in `<main>'
Aug 16 13:28:10 dnl systemd[1]: autostart.service: Main process exited, code=exited, status=1/FAILURE
Aug 16 13:28:10 dnl systemd[1]: autostart.service: Failed with result 'exit-code'.
Is there any problem with my ruby code?
According to the line number of produced error there's timeout when opening network socket, so it seems network isn't ready when your service is running. Try this [Unit] section so the service will start after network is initialized:
[Unit]
Description=Example systemd service.
Requires=network-online.target
After=network-online.target

Need to take only one entry pertaining to particular name as in first column and iterate over the file

I have a file called Files1 which has below data, where i Need to take only the line (entire line) which has all the column entries (ie $1...to ..$12) and iterate over the file..
example: for name "testvnc02" it should only print below line as it has all the fields of its name and ignore rest of the line and take another name and do the same.
testvnc02 out: anders pts/83 192.168.87.1 Mon Feb 20
00:31 - 01:04 00:33
[testvnc02 ] out:
[testvnc02 ] out:
[testvnc02 ] out:
testvnc02 out:
testvnc02 out: anders pts/83 192.168.87.1 Mon Feb 20 00:31 - 01:04 00:33
testvnc02 out: curtist pts/1927 192.202.45.84 Thu Feb 9 17:54 - 19:55 02:00
testvnc02 out: curtist pts/1928 :32.0 Thu Feb 9 17:56 still logged in
testvnc02 out: echolu pts/82 :13 Tue Feb 14 01:07 still logged in
testvnc02 out: echolu pts/83 :13.0 Tue Feb 14 01:08 - 01:23 3+00:14
testvnc02 out: garimas pts/71 test-garimas.caden Fri Feb 17 02:22 - 03:23 01:01
testvnc02 out: garimas pts/71 test-garimas.caden Sun Feb 12 22:54 - 00:04 01:09
testvnc02 out: garimas pts/83 test-garimas.caden Mon Feb 20 01:39 - 02:39 01:00
testvnc02 out: garimas pts/84 test-garimas.caden Tue Feb 14 04:46 - 05:48 01:01
testvnc02 out: hjyu pts/87 testvnc02:28.0 Wed Feb 8 16:30 still logged in
testvnc02 out: hongshaw pts/17 192.168.222.27 Tue Feb 7 21:39 - 03:52 06:13
testvnc02 out: npitla pts/4 :4.0 Fri Feb 192 00:55 - 07:30 2+06:35
testvnc02 out: npitla pts/4 :4.0 Sun Feb 12 07:30 - 22:54 3+15:24
testvnc02 out: npitla pts/4 :4.0 Tue Feb 7 21:36 - 00:55 2+03:18
testvnc02 out: npitla pts/71 :4.0 Fri Feb 192 02:49 - 03:36 00:47
testvnc02 out: npitla pts/71 :4.0 Mon Feb 13 09:58 - 22:54 2+12:55
testvnc02 out: npitla pts/71 :4.0 Sun Feb 12 07:21 - 07:25 00:03
testvnc02 out: npitla pts/71 :4.0 Tue Feb 7 22:20 - 01:30 2+03:192
testvnc02 out: npitla pts/81 :4.0 Fri Feb 192 03:24 - 03:36 00:12
testvnc02 out: npitla pts/81 :4.0 Mon Feb 13 192:02 - 22:53 2+12:51
testvnc02 out: npitla pts/81 :4.0 Tue Feb 7 22:21 - 01:30 2+03:09
testvnc02 out: npitla pts/84 :4.0 Fri Feb 192 03:32 - 03:36 00:03
testvnc02 out: npitla pts/84 :4.0 Wed Feb 8 09:24 - 00:54 1+15:30
testvnc02 out: pedro pts/89 testvcut07.perence Wed Feb 15 01:41 - 01:50 00:09
testvnc02 out: pedro pts/89 testvcut07.perence Wed Feb 15 01:52 - 01:55 00:02
testvnc02 out: ruizh pts/89 szlnx4.perence.c Wed Feb 15 21:09 - 21:55 3+00:46
testvnc02 out: sbrahma pts/71 test-sbrahma.caden Fri Feb 17 14:46 - 14:53 00:06
testvnc02 out: sonamt pts/85 test-sonamt.caden Wed Feb 8 22:21 - 23:41 01:19
testvnc02 out: sungsikh pts/1927 :29.0 Thu Feb 9 16:13 - 16:19 00:06
testvnc02 out: sungsikh pts/4 :29.0 Thu Feb 16 12:55 still logged in
testvnc02 out: tao1wang pts/1920 :31 Thu Feb 9 192:19 still logged in
testvnc02 out: tao1wang pts/1921 :31 Thu Feb 9 192:19 still logged in
testvnc02 out: tao1wang pts/1922 :31 Thu Feb 9 192:20 still logged in
testvnc02 out: tao1wang pts/1923 :31 Thu Feb 9 192:20 still logged in
testvnc02 out: tao1wang pts/1924 :31 Thu Feb 9 192:20 still logged in
testvnc02 out: tao1wang pts/1925 :31 Thu Feb 9 192:21 still logged in
testvnc02 out: tao1wang pts/85 192.168.12.43 Thu Feb 9 08:59 - 09:22 00:23
testvnc02 out: tao1wang pts/85 :31 Thu Feb 9 192:17 still logged in
testvnc02 out: tao1wang pts/90 :31 Thu Feb 9 09:00 still logged in
testvnc02 out: tao1wang pts/91 :31 Thu Feb 9 09:00 still logged in
testvnc02 out: tao1wang pts/92 :31 Thu Feb 9 09:00 still logged in
testvnc02 out: tao1wang pts/93 :31 Thu Feb 9 09:00 still logged in
testvnc02 out: tao1wang pts/94 :31 Thu Feb 9 09:00 still logged in
testvnc02 out: tao1wang pts/95 :31 Thu Feb 9 09:00 still logged in
testvnc02 out: tao1wang pts/96 :31 Thu Feb 9 09:00 still logged in
testvnc02 out: tao1wang pts/97 :31 Thu Feb 9 09:00 still logged in
testvnc02 out: tao1wang pts/98 :31 Thu Feb 9 192:18 still logged in
testvnc02 out: tao1wang pts/99 :31 Thu Feb 9 192:18 still logged in
testvnc02 out: vsanjay pts/71 :12 Sun Feb 19 23:06 still logged in
testvnc02 out: vsanjay pts/81 :12 Sun Feb 19 23:06 still logged in
testvnc02 out: vsanjay pts/88 :12 Wed Feb 15 01:30 still logged in
testvnc02 out: yulizhu pts/0 :14.0 Wed Feb 8 09:192 - 11:50 02:40
testvnc02 out: yulizhu pts/0 :14.0 Wed Feb 8 11:50 - 12:192 00:19
testvnc02 out: yulizhu pts/1926 :14.0 Thu Feb 9 11:04 - 17:38 5+06:33
testvnc02 out: yulizhu pts/17 :14.0 Wed Feb 8 09:11 - 09:12 00:01
testvnc02 out: yulizhu pts/58 :14.0 Wed Feb 8 09:13 - 11:49 02:36
testvnc02 out: yulizhu pts/71 :14.0 Fri Feb 192 12:50 - 12:52 00:01
testvnc02 out: yulizhu pts/71 :14.0 Fri Feb 192 13:25 - 13:27 00:02
testvnc02 out: yulizhu pts/84 :14.0 Tue Feb 14 17:38 - 19:11 01:33
testvnc02 out: yulizhu pts/84 :14.0 Tue Feb 14 19:18 still logged in
testvnc02 out: yulizhu pts/85 :14.0 Wed Feb 8 11:49 - 16:20 04:31
testvnc02 out: yulizhu pts/85 :14.0 Wed Feb 8 16:20 - 18:31 02:192
testvnc02 out: yulizhu pts/87 :14.0 Wed Feb 8 12:12 - 14:20 02:08
testvnc02 out: yulizhu pts/87 :14.0 Wed Feb 8 14:20 - 16:20 01:59
testvnc02 out: yulizhu pts/88 :14.0 Thu Feb 9 11:46 - 22:05 192:19
testvnc02 out: yulizhu pts/88 :14.0 Tue Feb 14 18:21 - 19:26 01:04
testvnc02 out: yulizhu pts/88 :14.0 Wed Feb 8 16:03 - 16:192 00:07
testvnc02 out: yulizhu pts/88 :14.0 Wed Feb 8 16:19 - 16:20 00:01
testvnc02 out: yulizhu pts/88 :14.0 Wed Feb 8 17:12 - 11:04 17:52
testvnc02 out: yulizhu pts/89 :14.0 Wed Feb 8 18:27 - 17:38 5+23:11
[testvnc04] out:
[testvnc04] out:
testvnc04 out: amitv pts/22 textnntv.cadenc Mon Feb 20 02:14 - 03:14 01:00
testvnc04 out: amitv pts/27 textnntv.cadenc Sun Feb 12 20:55 - 21:56 01:00
testvnc04 out: amitv pts/50 textnntv.cadenc Thu Feb 16 09:29 - 192:29 01:00
testvnc04 out: amitv pts/50 textnntv.cadenc Tue Feb 14 21:55 - 22:55 01:00
testvnc04 out: amyluo pts/22 192.16833.221.89 Sun Feb 19 21:42 - 22:53 01:192
testvnc04 out: amyluo pts/23 :3.0 Sun Feb 19 21:43 still logged in
testvnc04 out: amyluo pts/24 :3.0 Sun Feb 19 21:43 still logged in
testvnc04 out: amyluo pts/25 :3.0 Sun Feb 19 21:43 still logged in
testvnc04 out: amyluo pts/26 :3.0 Sun Feb 12 01:01 - 21:41 7+20:39
testvnc04 out: amyluo pts/26 :3.0 Sun Feb 19 21:43 still logged in
testvnc04 out: amyluo pts/56 192.16833.221.89 Sun Feb 19 21:40 - 21:41 00:01
testvnc04 out: amyluo pts/56 :3.0 Sun Feb 19 21:43 still logged in
testvnc04 out: amyluo pts/57 :3.0 Sun Feb 19 21:43 still logged in
testvnc04 out: dclor pts/27 192.202.45.91 Sun Feb 12 16:42 - 17:43 01:00
testvnc04 out: dclor pts/28 :4 Sun Feb 12 16:43 still logged in
testvnc04 out: dclor pts/29 :4 Sun Feb 12 16:43 still logged in
testvnc04 out: dclor pts/49 :4 Mon Feb 13 17:13 still logged in
testvnc04 out: dclor pts/51 :4 Tue Feb 14 08:32 still logged in
testvnc04 out: dclor pts/9 :4 Mon Feb 20 13:28 still logged in
testvnc04 out: horeftis pts/48 test-horeftis.cade Mon Feb 13 14:42 - 14:44 00:01
testvnc04 out: jinyi pts/27 192.16833.2192.16828 Sun Feb 12 18:36 - 18:44 00:07
testvnc04 out: jinyi pts/30 :5.0 Sun Feb 12 18:40 still logged in
testvnc04 out: joao pts/22 test-joao.perence. Mon Feb 20 04:57 still logged in
testvnc04 out: joao pts/9 :52.0 Tue Feb 14 04:29 - 06:15 01:45
testvnc04 out: joao pts/9 :52.0 Tue Feb 14 06:15 - 02:01 19:46
testvnc04 out: joao pts/9 :52.0 Wed Feb 15 02:01 - 04:58 5+02:56
testvnc04 out: jolinr pts/50 testfib240.perence Tue Feb 14 17:54 - 18:05 00:192
testvnc04 out: jolinr pts/52 :6.0 Tue Feb 14 17:56 still logged in
testvnc04 out: jolinr pts/53 :6 Tue Feb 14 17:56 still logged in
testvnc04 out: jolinr pts/56 :6 Thu Feb 16 18:08 - 18:44 00:36
testvnc04 out: jolinr pts/57 :6 Thu Feb 16 18:11 - 18:44 00:33
testvnc04 out: jolinr pts/58 :6 Thu Feb 16 18:20 - 18:44 00:23
testvnc04 out: jolinr pts/59 :6 Thu Feb 16 18:22 - 18:44 00:22
testvnc04 out: jxie pts/22 vm1lnx3.perence. Mon Feb 20 00:27 - 00:42 00:15
testvnc04 out: jxie pts/56 vm1lnx3.perence. Fri Feb 17 01:52 - 04:08 02:16
testvnc04 out: jxie pts/56 vm1lnx3.perence. Fri Feb 17 08:57 - 09:27 00:29
testvnc04 out: jxie pts/56 vm1lnx3.perence. Fri Feb 17 192:19 - 11:41 01:21
testvnc04 out: jxie pts/56 vm1lnx3.perence. Fri Feb 17 21:59 - 23:00 01:00
testvnc04 out: jxie pts/56 vm1lnx3.perence. Sat Feb 18 01:36 - 01:45 00:09
testvnc04 out: jxie pts/56 vm1lnx3.perence. Sat Feb 18 06:41 - 11:17 04:36
testvnc04 out: jxie pts/56 vm1lnx3.perence. Sun Feb 19 18:53 - 19:56 01:03
testvnc04 out: jxie pts/56 vm1lnx3.perence. Thu Feb 16 21:37 - 00:15 02:38
testvnc04 out: jxie pts/57 vm1lnx3.perence. Fri Feb 17 09:04 - 09:27 00:22
testvnc04 out: jxie pts/57 vm1lnx3.perence. Sat Feb 18 06:44 - 192:18 03:33
testvnc04 out: jxie pts/58 vm1lnx3.perence. Mon Feb 20 02:25 - 18:38 16:12
testvnc04 out: jxie pts/60 vm1lnx3.perence. Thu Feb 16 18:31 - 18:51 00:20
testvnc04 out: kitagawa pts/21 :48.0 Sun Feb 12 06:47 still logged in
testvnc04 out: kitagawa pts/27 :48.0 Mon Feb 13 01:12 still logged in
testvnc04 out: kitagawa pts/48 :48.0 Mon Feb 13 16:54 still logged in
testvnc04 out: kitagawa pts/50 cdtest135.perence. Wed Feb 15 01:48 - 02:48 01:00
testvnc04 out: kitagawa pts/54 :51.0 Thu Feb 16 15:32 still logged in
testvnc04 out: kitagawa pts/59 :48.0 Mon Feb 20 15:34 still logged in
testvnc04 out: kmchow pts/31 test-kmchow.cadenc Mon Feb 13 09:54 still logged in
testvnc04 out: kmchow pts/32 :99 Mon Feb 13 09:55 still logged in
testvnc04 out: kmchow pts/33 :99 Mon Feb 13 09:55 still logged in
testvnc04 out: kmchow pts/34 :99 Mon Feb 13 09:55 still logged in
testvnc04 out: kmchow pts/35 :99 Mon Feb 13 09:55 still logged in
testvnc04 out: kmchow pts/36 :99 Mon Feb 13 09:55 still logged in
testvnc04 out: kmchow pts/37 :99 Mon Feb 13 09:55 still logged in
testvnc04 out: kmchow pts/38 :99 Mon Feb 13 09:55 still logged in
testvnc04 out: kmchow pts/39 :99 Mon Feb 13 09:55 still logged in
testvnc04 out: kmchow pts/40 :70 Mon Feb 13 09:56 - 192:02 00:05
testvnc04 out: kmchow pts/40 :70 Mon Feb 13 192:02 still logged in
testvnc04 out: kmchow pts/41 :70 Mon Feb 13 09:56 - 192:02 00:05
testvnc04 out: kmchow pts/41 :70 Mon Feb 13 192:02 still logged in
testvnc04 out: kmchow pts/42 :70 Mon Feb 13 09:56 - 192:02 00:05
testvnc04 out: kmchow pts/42 :70 Mon Feb 13 192:02 still logged in
testvnc04 out: kmchow pts/43 :70 Mon Feb 13 09:56 - 192:02 00:05
testvnc04 out: kmchow pts/43 :70 Mon Feb 13 192:02 still logged in
testvnc04 out: kmchow pts/44 :70 Mon Feb 13 09:56 - 192:02 00:05
testvnc04 out: kmchow pts/44 :70 Mon Feb 13 192:02 still logged in
testvnc04 out: kmchow pts/45 :70 Mon Feb 13 09:56 - 192:02 00:05
testvnc04 out: kmchow pts/45 :70 Mon Feb 13 192:02 still logged in
testvnc04 out: kmchow pts/46 :70 Mon Feb 13 09:56 - 192:02 00:05
testvnc04 out: kmchow pts/46 :70 Mon Feb 13 192:02 still logged in
testvnc04 out: kmchow pts/47 :70 Mon Feb 13 09:56 - 192:02 00:05
testvnc04 out: kmchow pts/47 :70 Mon Feb 13 192:02 still logged in
testvnc04 out: kmchow pts/55 :70.0 Thu Feb 16 16:192 still logged in
testvnc04 out: sanubhav pts/56 test-sanubhav.cad Sun Feb 19 00:44 - 00:49 00:05
testvnc04 out: trr pts/50 fmf.perence. Mon Feb 13 22:32 - 14:16 15:43
testvnc04 out: trr pts/50 testvnc04:2.0 Thu Feb 16 14:37 still logged in
testvnc05 out:
testvnc05 out:
testvnc05 out: harman pts/169 :pts/338:S.0 Mon Feb 20 00:55 - 06:19 05:24
testvnc05 out: harman pts/270 :pts/331:S.0 Sun Feb 19 21:43 - 03:51 06:07
testvnc05 out: harman pts/271 :pts/331:S.2 Sun Feb 19 21:43 - 03:51 06:07
testvnc05 out: harman pts/291 :pts/331:S.3 Sun Feb 19 21:43 - 03:51 06:07
testvnc05 out: harman pts/318 :pts/338:S.2 Mon Feb 20 04:04 - 06:19 02:15
testvnc05 out: harman pts/329 :pts/338:S.1 Mon Feb 20 00:55 - 06:19 05:24
testvnc05 out: harman pts/331 192.168.47.44 Sun Feb 19 21:43 - 03:51 06:08
testvnc05 out: harman pts/334 :pts/331:S.1 Sun Feb 19 23:06 - 03:51 04:45
testvnc05 out: harman pts/338 192.168.47.44 Mon Feb 20 00:54 - 06:19 05:25
testvnc05 out: kitagawa pts/302 :24.0 Sun Feb 19 22:20 still logged in
testvnc05 out: kitagawa pts/50 :24.0 Mon Feb 20 18:59 still logged in
testvnc05 out: kvishnu pts/1925 :pts/332:S.4 Mon Feb 20 00:19 - 02:04 01:44
testvnc05 out: kvishnu pts/1925 :pts/332:S.4 Mon Feb 20 02:45 - 03:54 01:08
testvnc05 out: kvishnu pts/1925 :pts/332:S.4 Sun Feb 19 22:27 - 23:33 01:06
testvnc05 out: kvishnu pts/1925 :pts/78:S.4 Sun Feb 19 192:28 - 11:08 00:39
testvnc05 out: kvishnu pts/1927 :pts/332:S.0 Mon Feb 20 00:19 - 02:04 01:44
testvnc05 out: kvishnu pts/1927 :pts/332:S.0 Mon Feb 20 02:45 - 03:54 01:08
testvnc05 out: kvishnu pts/1927 :pts/332:S.0 Sun Feb 19 22:27 - 23:33 01:06
testvnc05 out: kvishnu pts/1192 :pts/332:S.1 Mon Feb 20 00:19 - 02:04 01:44
testvnc05 out: kvishnu pts/1192 :pts/332:S.1 Mon Feb 20 02:45 - 03:54 01:08
testvnc05 out: kvishnu pts/1192 :pts/332:S.1 Sun Feb 19 22:27 - 23:33 01:06
testvnc05 out: kvishnu pts/1192 :pts/78:S.1 Sun Feb 19 192:28 - 11:08 00:39
testvnc05 out: kvishnu pts/113 :pts/332:S.2 Mon Feb 20 00:19 - 02:04 01:44
testvnc05 out: kvishnu pts/113 :pts/332:S.2 Mon Feb 20 02:45 - 03:54 01:08
testvnc05 out: kvishnu pts/113 :pts/332:S.2 Sun Feb 19 22:27 - 23:33 01:06
testvnc05 out: kvishnu pts/113 :pts/78:S.2 Sun Feb 19 192:28 - 11:08 00:39
testvnc05 out: kvishnu pts/129 :pts/332:S.5 Mon Feb 20 00:19 - 02:04 01:44
testvnc05 out: kvishnu pts/129 :pts/332:S.5 Mon Feb 20 02:45 - 03:54 01:08
testvnc05 out: kvishnu pts/129 :pts/332:S.5 Sun Feb 19 22:27 - 23:33 01:06
testvnc05 out: kvishnu pts/129 :pts/78:S.5 Sun Feb 19 192:28 - 11:08 00:39
testvnc05 out: kvishnu pts/138 :pts/332:S.6 Mon Feb 20 00:19 - 02:04 01:44
Solution with awk or shell any one will be okay.
How about a simple:
awk 'NF == 12' File1

Passenger startup failure on Heroku Cache Control

I am receiving a startup error for two of my projects when deploying to Heroku. Both work fine locally, it seems like the worker startup of sidekiq causes problems for passenger. I don't really understand where the problem could come from and have checked my procfile, my sidekiq conf and other elements. Any input would be much appreciated.
Nov 03 01:25:15 zugone-production app/web.1: [ 2015-11-03 09:25:14.9294 67/7fd6fe14d700 age/Cor/App/Implementation.cpp:304 ]: Could not spawn process for application /app: An error occured while starting up the preloader.
Nov 03 01:25:15 zugone-production app/web.1: Error ID: 1a5af3e4
Nov 03 01:25:15 zugone-production app/web.1: Error details saved to: /tmp/passenger-error-UjpmyP.html
Nov 03 01:25:15 zugone-production app/web.1: Message from application: /app/vendor/bundle/ruby/2.0.0/gems/heroku-deflater-0.6.1/lib/heroku-deflater/serve_zipped_assets.rb:15: syntax error, unexpected ':', expecting =>
Nov 03 01:25:15 zugone-production app/web.1: ...= { headers: { 'Cache-Control': cache_control } } if Rails::...
Nov 03 01:25:15 zugone-production app/web.1: ... ^ (SyntaxError)
Nov 03 01:25:15 zugone-production app/web.1: /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
Nov 03 01:25:15 zugone-production app/web.1: /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `block in require'
Nov 03 01:25:15 zugone-production app/web.1: /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:232:in `load_dependency'
Nov 03 01:25:15 zugone-production app/web.1: /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
Nov 03 01:25:15 zugone-production app/web.1: /app/vendor/bundle/ruby/2.0.0/gems/heroku-deflater-0.6.1/lib/heroku-deflater/railtie.rb:3:in `<top (required)>'
Nov 03 01:25:15 zugone-production app/web.1: /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
Nov 03 01:25:15 zugone-production app/web.1: /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `block in require'
Nov 03 01:25:15 zugone-production app/web.1: /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:232:in `load_dependency'
Nov 03 01:25:15 zugone-production app/web.1: /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
Nov 03 01:25:15 zugone-production app/web.1: /app/vendor/bundle/ruby/2.0.0/gems/heroku-deflater-0.6.1/lib/heroku-deflater.rb:1:in `<top (required)>'
Nov 03 01:25:15 zugone-production app/web.1: /app/vendor/bundle/ruby/2.0.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:76:in `require'
Nov 03 01:25:15 zugone-production app/web.1: /app/vendor/bundle/ruby/2.0.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
Nov 03 01:25:15 zugone-production app/web.1: /app/vendor/bundle/ruby/2.0.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:72:in `each'
Nov 03 01:25:15 zugone-production app/web.1: /app/vendor/bundle/ruby/2.0.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:72:in `block in require'
Nov 03 01:25:15 zugone-production app/web.1: /app/vendor/bundle/ruby/2.0.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:61:in `each'
Nov 03 01:25:15 zugone-production app/web.1: /app/vendor/bundle/ruby/2.0.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:61:in `require'
Nov 03 01:25:15 zugone-production app/web.1: /app/vendor/bundle/ruby/2.0.0/gems/bundler-1.9.7/lib/bundler.rb:134:in `require'
Nov 03 01:25:15 zugone-production app/web.1: /app/config/application.rb:9:in `<top (required)>'
Nov 03 01:25:15 zugone-production app/web.1: /app/config/environment.rb:2:in `require'
Nov 03 01:25:15 zugone-production app/web.1: /app/config/environment.rb:2:in `<top (required)>'
Nov 03 01:25:15 zugone-production app/web.1: config.ru:3:in `require'
Nov 03 01:25:15 zugone-production app/web.1: config.ru:3:in `block in <main>'
Nov 03 01:25:15 zugone-production app/web.1: /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.5/lib/rack/builder.rb:55:in `instance_eval'
Nov 03 01:25:15 zugone-production app/web.1: /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.5/lib/rack/builder.rb:55:in `initialize'
Nov 03 01:25:15 zugone-production app/web.1: config.ru:1:in `new'
Nov 03 01:25:15 zugone-production app/web.1: config.ru:1:in `<main>'
Nov 03 01:25:15 zugone-production app/web.1: /app/vendor/bundle/ruby/2.0.0/gems/passenger-5.0.21/src/helper-scripts/rack-preloader.rb:110:in `eval'
Nov 03 01:25:15 zugone-production app/web.1: /app/vendor/bundle/ruby/2.0.0/gems/passenger-5.0.21/src/helper-scripts/rack-preloader.rb:110:in `preload_app'
Nov 03 01:25:15 zugone-production app/web.1: /app/vendor/bundle/ruby/2.0.0/gems/passenger-5.0.21/src/helper-scripts/rack-preloader.rb:156:in `<module:App>'
Nov 03 01:25:15 zugone-production app/web.1: /app/vendor/bundle/ruby/2.0.0/gems/passenger-5.0.21/src/helper-scripts/rack-preloader.rb:30:in `<module:PhusionPassenger>'
Nov 03 01:25:15 zugone-production app/web.1: /app/vendor/bundle/ruby/2.0.0/gems/passenger-5.0.21/src/helper-scripts/rack-preloader.rb:29:in `<main>'
Nov 03 01:25:15 zugone-production app/web.1: [ 2015-11-03 09:25:14.9793 67/7fd6dbfff700 age/Cor/Req/CheckoutSession.cpp:253 ]: [Client 3-1] Cannot checkout session because a spawning error occurred. The identifier of the error is 1a5af3e4. Please see earlier logs for details about the error.
Nov 03 01:25:15 zugone-production app/web.1: [ 2015-11-03 09:25:14.9801 67/7fd6f6ffe700 age/Cor/Req/CheckoutSession.cpp:253 ]: [Client 1-1] Cannot checkout session because a spawning error occurred. The identifier of the error is 1a5af3e4. Please see earlier logs for details about the error.
Nov 03 01:25:15 zugone-production app/web.1: [ 2015-11-03 09:25:14.9803 67/7fd6f5ffd700 age/Cor/Req/CheckoutSession.cpp:253 ]: [Client 2-1] Cannot checkout session because a spawning error occurred. The identifier of the error is 1a5af3e4. Please see earlier logs for details about the error.
Nov 03 01:25:15 zugone-production app/web.1: [ 2015-11-03 09:25:14.9806 67/7fd6c3fff700 age/Cor/Req/CheckoutSession.cpp:253 ]: [Client 6-1] Cannot checkout session because a spawning error occurred. The identifier of the error is 1a5af3e4. Please see earlier logs for details about the error.
Nov 03 01:25:15 zugone-production app/web.1: [ 2015-11-03 09:25:14.9807 67/7fd6c1ffd700 age/Cor/Req/CheckoutSession.cpp:253 ]: [Client 8-1] Cannot checkout session because a spawning error occurred. The identifier of the error is 1a5af3e4. Please see earlier logs for details about the error.
Nov 03 01:25:15 zugone-production app/web.1: [ 2015-11-03 09:25:14.9809 67/7fd6c2ffe700 age/Cor/Req/CheckoutSession.cpp:253 ]: [Client 7-1] Cannot checkout session because a spawning error occurred. The identifier of the error is 1a5af3e4. Please see earlier logs for details about the error.
Nov 03 01:25:15 zugone-production app/web.1: [ 2015-11-03 09:25:14.9811 67/7fd6daffe700 age/Cor/Req/CheckoutSession.cpp:253 ]: [Client 4-1] Cannot checkout session because a spawning error occurred. The identifier of the error is 1a5af3e4. Please see earlier logs for details about the error.
Nov 03 01:25:15 zugone-production app/web.1: [ 2015-11-03 09:25:14.9812 67/7fd6d9ffd700 age/Cor/Req/CheckoutSession.cpp:253 ]: [Client 5-1] Cannot checkout session because a spawning error occurred. The identifier of the error is 1a5af3e4. Please see earlier logs for details about the error.
Nov 03 01:25:16 zugone-production heroku/router: at=info method=GET path="/" host=www.zug-erstattung.de request_id=39412581-e55c-4e29-8730-c4c1694b660b fwd="172.21.225.211,130.238.98.89" dyno=web.1 connect=1ms service=5903ms status=500 bytes=2847
Nov 03 01:25:16 zugone-production app/worker.1: /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require': /app/vendor/bundle/ruby/2.0.0/gems/heroku-deflater-0.6.1/lib/heroku-deflater/serve_zipped_assets.rb:15: syntax error, unexpected ':', expecting => (SyntaxError)
Nov 03 01:25:16 zugone-production app/worker.1: ...= { headers: { 'Cache-Control': cache_control } } if Rails::...
Nov 03 01:25:16 zugone-production app/worker.1: ... ^
I had same problem as following 1 hour ago.
SyntaxError:
/app/vendor/bundle/ruby/2.1.0/gems/heroku-deflater-0.6.1/lib/heroku-deflater/serve_zipped_assets.rb:15:
syntax error, unexpected ':', expecting => ...= { headers: {
'Cache-Control': cache_control } } if Rails::...
It seems that heroku-deflater was updated 21 hours ago.
Though I don't know the reason this error is caused at all,
I was able to make my apps work well on Heroku by define heroku-deflater version on Gemfile like this.
■ Gemfile
gem 'heroku-deflater', '0.5.3 ', :group => :production
I would like to wait that heroku-deflater will be updated again.
Thank you!

Resources