Failing to catch Errno::ECONNRESET in Ruby code - ruby

In my Rails 3.1 project, deployed to Heroku, I have a rake task that generates a few hundred thousand small PNGs based on records in the database and uploads the results to S3 using fog, one file at a time. (Before I was using heroku, the task saved the files locally and everything worked fine.) When I run the task using heroku run:detached, it runs for a while, and uploads a bunch of files, but eventually fails with Connection reset by peer (Errno::ECONNRESET). What's weird about this is that I've modified the script to catch and retry that exception like so:
file_exists = false
retry_count = 10
begin
file_exists = directory.files.head(filekey)
rescue Errno::ECONNRESET => e
if retry_count > 0 then
logger.warning("Connection reset: #{e.inspect}")
retry_count -= 1
sleep(1)
retry
else
raise
end
end
According to the stack trace, file_exists = directory.files.head(filekey) is the line of my code that leads to the exception, so I feel like I'm missing something about Ruby exception handling. I'd love to know what I'm doing wrong, since I'm not 100% sure if this is a problem with my begin/rescue block, the way fog handles network errors, or what.
Here's the complete stack trace:
Nov 07 12:08:01 ... app/run.1: Connection reset by peer (Errno::ECONNRESET)
Nov 07 12:08:01 ... app/run.1: /app/vendor/ruby-1.8.7/lib/ruby/1.8/openssl/buffering.rb:36:in `sysread'
Nov 07 12:08:01 ... app/run.1: /app/vendor/ruby-1.8.7/lib/ruby/1.8/openssl/buffering.rb:36:in `fill_rbuff'
Nov 07 12:08:01 ... app/run.1: /app/vendor/ruby-1.8.7/lib/ruby/1.8/openssl/buffering.rb:68:in `read'
Nov 07 12:08:01 ... app/run.1: /app/vendor/bundle/ruby/1.8/gems/excon-0.16.7/lib/excon/socket.rb:121:in `read'
Nov 07 12:08:01 ... app/run.1: /app/vendor/ruby-1.8.7/lib/ruby/1.8/timeout.rb:67:in `timeout'
Nov 07 12:08:01 ... app/run.1: /app/vendor/bundle/ruby/1.8/gems/excon-0.16.7/lib/excon/socket.rb:120:in `read'
Nov 07 12:08:01 ... app/run.1: /app/vendor/bundle/ruby/1.8/gems/excon-0.16.7/lib/excon/ssl_socket.rb:79:in `read'
Nov 07 12:08:01 ... app/run.1: /app/vendor/bundle/ruby/1.8/gems/excon-0.16.7/lib/excon/response.rb:21:in `parse'
Nov 07 12:08:01 ... app/run.1: /app/vendor/bundle/ruby/1.8/gems/excon-0.16.7/lib/excon/connection.rb:275:in `request_kernel'
Nov 07 12:08:01 ... app/run.1: /app/vendor/bundle/ruby/1.8/gems/excon-0.16.7/lib/excon/connection.rb:103:in `request'
Nov 07 12:08:01 ... app/run.1: /app/vendor/bundle/ruby/1.8/gems/fog-1.6.0/lib/fog/core/connection.rb:20:in `request'
Nov 07 12:08:01 ... app/run.1: /app/vendor/bundle/ruby/1.8/gems/fog-1.6.0/lib/fog/aws/storage.rb:392:in `request'
Nov 07 12:08:01 ... app/run.1: /app/vendor/bundle/ruby/1.8/gems/fog-1.6.0/lib/fog/aws/requests/storage/head_object.rb:53:in `head_object'
Nov 07 12:08:01 ... app/run.1: /app/vendor/bundle/ruby/1.8/gems/fog-1.6.0/lib/fog/aws/models/storage/files.rb:98:in `head'
Nov 07 12:08:01 ... app/run.1: /app/lib/tasks/assets.rake:45
Nov 07 12:08:01 ... app/run.1: /app/lib/tasks/assets.rake:37:in `each'
Nov 07 12:08:01 ... app/run.1: /app/lib/tasks/assets.rake:37
Nov 07 12:08:01 ... app/run.1: /app/vendor/bundle/ruby/1.8/gems/activerecord-3.1.8/lib/active_record/relation/batches.rb:21:in `find_each'
Nov 07 12:08:01 ... app/run.1: /app/vendor/bundle/ruby/1.8/gems/activerecord-3.1.8/lib/active_record/relation/batches.rb:21:in `each'
Nov 07 12:08:01 ... app/run.1: /app/vendor/bundle/ruby/1.8/gems/activerecord-3.1.8/lib/active_record/relation/batches.rb:21:in `find_each'
Nov 07 12:08:01 ... app/run.1: /app/vendor/bundle/ruby/1.8/gems/activerecord-3.1.8/lib/active_record/relation/batches.rb:69:in `find_in_batches'
Nov 07 12:08:01 ... app/run.1: /app/vendor/bundle/ruby/1.8/gems/activerecord-3.1.8/lib/active_record/relation/batches.rb:20:in `find_each'
Nov 07 12:08:01 ... app/run.1: /app/lib/tasks/assets.rake:35
Nov 07 12:08:01 ... app/run.1: /app/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
Nov 07 12:08:01 ... app/run.1: /app/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `execute'
Nov 07 12:08:01 ... app/run.1: /app/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
Nov 07 12:08:01 ... app/run.1: /app/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
Nov 07 12:08:01 ... app/run.1: /app/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
Nov 07 12:08:01 ... app/run.1: /app/vendor/ruby-1.8.7/lib/ruby/1.8/monitor.rb:242:in `synchronize'
Nov 07 12:08:01 ... app/run.1: /app/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
Nov 07 12:08:01 ... app/run.1: /app/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
Nov 07 12:08:01 ... app/run.1: /app/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
Nov 07 12:08:01 ... app/run.1: /app/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'
Nov 07 12:08:01 ... app/run.1: /app/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
Nov 07 12:08:01 ... app/run.1: /app/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'
Nov 07 12:08:01 ... app/run.1: /app/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
Nov 07 12:08:01 ... app/run.1: /app/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
Nov 07 12:08:01 ... app/run.1: /app/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `run'
Nov 07 12:08:01 ... app/run.1: /app/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
Nov 07 12:08:01 ... app/run.1: /app/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
Nov 07 12:08:01 ... app/run.1: /app/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/bin/rake:33
Nov 07 12:08:01 ... app/run.1: /app/vendor/bundle/ruby/1.8/bin/rake:23:in `load'
Nov 07 12:08:01 ... app/run.1: /app/vendor/bundle/ruby/1.8/bin/rake:23
Nov 07 12:08:01 ... app/run.1: Tasks: TOP => ...:make_outlines
Nov 07 12:08:02 ... heroku/run.1: Process exited with status 1
Nov 07 12:08:02 ... heroku/run.1: State changed from up to complete

perhaps try like this:
begin
...
rescue Errno::ECONNRESET => e
...
rescue => e
...
end

Related

How to mix the useful auto generated ticks() whilst also specifying the lowest granulatrity you want the tick interval to go down to

I'm creating a time series graph using D3 and I want the x-axis ticks to go down no lower than 2 hours without creating too many ticks.
Take this example which builds my point:
var x = d3.scaleTime().domain([new Date(2020, 4, 8).setHours(8), new Date(2020, 4, 9)])
.range([0, 960]).ticks()
The ticks() automatically calculates the ticks as no count or time interval argument is given, with this result:
console.log(x) output:
0: Fri May 08 2020 08:00:00
1: Fri May 08 2020 09:00:00
2: Fri May 08 2020 10:00:00
3: Fri May 08 2020 11:00:00
4: Fri May 08 2020 12:00:00
5: Fri May 08 2020 13:00:00
6: Fri May 08 2020 14:00:00
7: Fri May 08 2020 15:00:00
8: Fri May 08 2020 16:00:00
9: Fri May 08 2020 17:00:00
10: Fri May 08 2020 18:00:00
11: Fri May 08 2020 19:00:00
12: Fri May 08 2020 20:00:00
13: Fri May 08 2020 21:00:00
14: Fri May 08 2020 22:00:00
15: Fri May 08 2020 23:00:00
16: Sat May 09 2020 00:00:00
The granularity of the time is too low here (1 hour). I know I can fix this by changing my code to:
var x = d3.scaleTime().domain([new Date(2020, 4, 8).setHours(8), new Date(2020, 4, 9)])
.range([0, 960]).ticks(d3.timeHour.every(2))
Which outputs:
0: Fri May 08 2020 08:00:00
1: Fri May 08 2020 10:00:00
2: Fri May 08 2020 12:00:00
3: Fri May 08 2020 14:00:00
4: Fri May 08 2020 16:00:00
5: Fri May 08 2020 18:00:00
6: Fri May 08 2020 20:00:00
7: Fri May 08 2020 22:00:00
8: Sat May 09 2020 00:00:00
Perfect. However the problem is if I always pass d3.timeHour.every(2) into the ticks function it gives me way too many ticks for every scenario. For example if the domain is two dates which are say 5 days apart, I will get 100 ticks, whereas if I just did ticks() for that example I would get a sensible amount of ticks.
Is there a way to tell d3 to use the auto generated ticks() for every case but at the same time don't go down to a lower time interval than 2 hours?

How should I load resources from src/main/resources in Kotlin?

I'm working on a Spring Boot application written in Kotlin (using Maven), and everything works fine but after generating the jar of my application, it throws an Exception because it can't find the folder src/main/resources:
Caused by: java.io.FileNotFoundException: src\main\resources\data\circuits-arrets.json
I read that could be because I use File class, and it doesn't work properly after generating the jar. Here's how I read my file:
var line: String?
val bufferedReader = BufferedReader(FileReader(File(csvLocation)))
do {
line = bufferedReader.readLine()
if (line != null) {
//Do something with 'line'
}
} while (line != null)
I found some solutions using InputStream instead of File in the BufferedReader.
My question is: Does it really change something for the jar? If yes, how should I do then?
Thank you in advance.
EDIT:
Here's the output of the command jar tvf my-jar.jar :
0 Fri Feb 15 10:34:14 CET 2019 META-INF/
552 Fri Feb 15 10:34:14 CET 2019 META-INF/MANIFEST.MF
0 Fri Feb 15 10:34:14 CET 2019 org/
0 Fri Feb 15 10:34:14 CET 2019 org/springframework/
0 Fri Feb 15 10:34:14 CET 2019 org/springframework/boot/
0 Fri Feb 15 10:34:14 CET 2019 org/springframework/boot/loader/
0 Fri Feb 15 10:34:14 CET 2019 org/springframework/boot/loader/data/
2688 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/data/RandomAccessDataFile$DataInputStream.class
0 Fri Feb 15 10:34:14 CET 2019 org/springframework/boot/loader/jar/
9736 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/JarURLConnection.class
1374 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/JarFile$JarFileType.class
14915 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/JarFile.class
3414 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/JarEntry.class
345 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/FileHeader.class
3172 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/StringSequence.class
4976 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/AsciiBytes.class
1593 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/JarFileEntries$1.class
1997 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/JarFileEntries$EntryIterator.class
10728 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/JarFileEntries.class
540 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/CentralDirectoryVisitor.class
299 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/JarEntryFilter.class
5267 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/CentralDirectoryFileHeader.class
3116 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/CentralDirectoryEndRecord.class
4624 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/CentralDirectoryParser.class
1693 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/ZipInflaterInputStream.class
11509 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/Handler.class
0 Fri Feb 15 10:34:14 CET 2019 org/springframework/boot/loader/archive/
302 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/archive/Archive$Entry.class
437 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/archive/Archive$EntryFilter.class
945 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/archive/Archive.class
1487 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/archive/ExplodedArchive$FileEntryIterator$EntryComparator.class
3837 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/archive/ExplodedArchive$FileEntryIterator.class
5243 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/archive/ExplodedArchive.class
1484 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/PropertiesLauncher$ArchiveEntryFilter.class
19737 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/PropertiesLauncher.class
282 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/data/RandomAccessDataFile$1.class
2062 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/JarFile$1.class
1233 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/JarFile$2.class
3263 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/data/RandomAccessDataFile$FileAccess.class
4015 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/data/RandomAccessDataFile.class
1102 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/archive/ExplodedArchive$FileEntry.class
1081 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/archive/JarFileArchive$JarFileEntry.class
7336 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/archive/JarFileArchive.class
1502 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/MainMethodRunner.class
3608 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/ExecutableArchiveLauncher.class
0 Fri Feb 15 10:34:14 CET 2019 org/springframework/boot/loader/util/
5203 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/util/SystemPropertyUtils.class
485 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/data/RandomAccessData.class
273 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/archive/ExplodedArchive$1.class
1779 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/archive/JarFileArchive$EntryIterator.class
1953 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/PropertiesLauncher$PrefixMatchingArchiveFilter.class
266 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/PropertiesLauncher$1.class
4684 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/Launcher.class
1721 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/WarLauncher.class
1585 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/JarLauncher.class
1527 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/LaunchedURLClassLoader$UseFastConnectionExceptionsEnumeration.class
5687 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/LaunchedURLClassLoader.class
616 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/Bytes.class
702 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/JarURLConnection$1.class
4306 Wed May 09 13:32:20 CEST 2018 org/springframework/boot/loader/jar/JarURLConnection$JarEntryName.class
0 Fri Feb 15 10:34:14 CET 2019 BOOT-INF/
0 Fri Feb 15 10:34:14 CET 2019 BOOT-INF/classes/
0 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/constants/
0 Fri Feb 15 10:33:50 CET 2019 BOOT-INF/classes/data/
0 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/
0 Fri Feb 15 10:34:10 CET 2019 BOOT-INF/classes/fr/asi/
0 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/controllers/
0 Fri Feb 15 10:34:10 CET 2019 BOOT-INF/classes/fr/asi/entities/
0 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/entities/jsonEntities/
0 Fri Feb 15 10:34:10 CET 2019 BOOT-INF/classes/fr/asi/entities/mainEntities/
0 Fri Feb 15 10:34:10 CET 2019 BOOT-INF/classes/fr/asi/entities/viewModels/
0 Fri Feb 15 10:34:10 CET 2019 BOOT-INF/classes/fr/asi/repositories/
0 Fri Feb 15 10:34:10 CET 2019 BOOT-INF/classes/fr/asi/security/
0 Fri Feb 15 10:34:10 CET 2019 BOOT-INF/classes/fr/asi/services/
0 Fri Feb 15 10:34:10 CET 2019 BOOT-INF/classes/fr/asi/utils/
0 Fri Feb 15 10:34:12 CET 2019 META-INF/maven/
0 Fri Feb 15 10:34:12 CET 2019 META-INF/maven/com.auth0.samples/
0 Fri Feb 15 10:34:12 CET 2019 META-INF/maven/com.auth0.samples/kotlin-spring-boot/
584 Fri Feb 15 10:33:50 CET 2019 BOOT-INF/classes/application.properties
87499 Fri Feb 15 10:33:50 CET 2019 BOOT-INF/classes/data/circuits-arrets.json
261015 Fri Feb 15 10:33:50 CET 2019 BOOT-INF/classes/data/tan-arrets.csv
1029 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/Configuration.class
3471 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/controllers/ApplicationUserController.class
6013 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/controllers/BaseController.class
1701 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/controllers/BikeStationController.class
1692 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/controllers/BusStationController.class
612 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/controllers/FavoriteController$WhenMappings.class
5385 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/controllers/FavoriteController.class
1778 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/controllers/LineController.class
7389 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/controllers/StationController.class
1868 Fri Feb 15 10:34:06 CET 2019 BOOT-INF/classes/fr/asi/entities/jsonEntities/Arret.class
1079 Fri Feb 15 10:34:06 CET 2019 BOOT-INF/classes/fr/asi/entities/jsonEntities/BusLineLibelle.class
3252 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/entities/mainEntities/ApplicationUser.class
2977 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/entities/mainEntities/BikeStation.class
2140 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/entities/mainEntities/Favorite.class
2981 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/entities/mainEntities/Station.class
1195 Fri Feb 15 10:34:06 CET 2019 BOOT-INF/classes/fr/asi/entities/viewModels/BaseVM.class
3691 Fri Feb 15 10:34:06 CET 2019 BOOT-INF/classes/fr/asi/entities/viewModels/StationVM.class
1663 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/KotlinSpringBootApplicationKt.class
812 Fri Feb 15 10:34:06 CET 2019 BOOT-INF/classes/fr/asi/repositories/BaseRepository.class
702 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/repositories/BusStationRepository.class
672 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/repositories/LineRepository.class
5530 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/security/JWTAuthenticationFilter.class
2578 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/security/UserDetailsServiceImpl.class
4617 Fri Feb 15 10:34:06 CET 2019 BOOT-INF/classes/fr/asi/services/BaseService.class
1186 Fri Feb 15 10:34:06 CET 2019 BOOT-INF/classes/fr/asi/services/LineService.class
5525 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/StartingDataInjector.class
7943 Fri Feb 15 10:34:06 CET 2019 BOOT-INF/classes/fr/asi/utils/ParsersKt.class
121 Fri Feb 15 10:34:08 CET 2019 META-INF/kotlin-spring-boot.kotlin_module
7216 Fri Feb 15 10:31:38 CET 2019 META-INF/maven/com.auth0.samples/kotlin-spring-boot/pom.xml
1693 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/constants/ConstantsKt.class
1805 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/entities/mainEntities/AccessCondition.class
1065 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/entities/mainEntities/BaseEntity.class
3506 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/entities/mainEntities/BusStation.class
1434 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/entities/mainEntities/FavoriteType.class
2945 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/entities/mainEntities/Line.class
2056 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/entities/mainEntities/StationType.class
2081 Fri Feb 15 10:34:06 CET 2019 BOOT-INF/classes/fr/asi/entities/viewModels/LineVM.class
613 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/KotlinSpringBootApplication.class
1101 Fri Feb 15 10:34:06 CET 2019 BOOT-INF/classes/fr/asi/repositories/ApplicationUserRepository.class
707 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/repositories/BikeStationRepository.class
692 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/repositories/FavoriteRepository.class
687 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/repositories/StationRepository.class
4738 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/security/JWTAuthorizationFilter.class
6776 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/security/WebSecurity.class
1235 Fri Feb 15 10:34:06 CET 2019 BOOT-INF/classes/fr/asi/services/BikeStationService.class
1228 Fri Feb 15 10:34:06 CET 2019 BOOT-INF/classes/fr/asi/services/BusStationService.class
1207 Fri Feb 15 10:34:06 CET 2019 BOOT-INF/classes/fr/asi/services/StationService.class
2405 Fri Feb 15 10:34:06 CET 2019 BOOT-INF/classes/fr/asi/utils/FindersKt.class
5205 Fri Feb 15 10:34:08 CET 2019 BOOT-INF/classes/fr/asi/VMUtils.class
114 Fri Feb 15 10:34:12 CET 2019 META-INF/maven/com.auth0.samples/kotlin-spring-boot/pom.properties
29487 Fri Feb 15 10:33:50 CET 2019 BOOT-INF/classes/data/stations-velos-libre-service-nantes-metropole.csv
0 Fri Feb 15 10:34:14 CET 2019 BOOT-INF/lib/
628 Wed May 09 13:41:28 CEST 2018 BOOT-INF/lib/spring-boot-starter-data-jpa-2.0.2.RELEASE.jar
593 Wed May 09 13:30:56 CEST 2018 BOOT-INF/lib/spring-boot-starter-2.0.2.RELEASE.jar
927496 Wed May 09 13:19:02 CEST 2018 BOOT-INF/lib/spring-boot-2.0.2.RELEASE.jar
1161361 Wed May 09 13:25:34 CEST 2018 BOOT-INF/lib/spring-boot-autoconfigure-2.0.2.RELEASE.jar
613 Wed May 09 13:30:56 CEST 2018 BOOT-INF/lib/spring-boot-starter-logging-2.0.2.RELEASE.jar
290339 Fri Mar 31 21:27:54 CEST 2017 BOOT-INF/lib/logback-classic-1.2.3.jar
471901 Fri Mar 31 21:27:16 CEST 2017 BOOT-INF/lib/logback-core-1.2.3.jar
17519 Sun Nov 19 01:08:44 CET 2017 BOOT-INF/lib/log4j-to-slf4j-2.10.0.jar
255485 Sun Nov 19 00:48:58 CET 2017 BOOT-INF/lib/log4j-api-2.10.0.jar
4596 Thu Mar 16 17:37:48 CET 2017 BOOT-INF/lib/jul-to-slf4j-1.7.25.jar
26586 Wed Feb 21 15:54:16 CET 2018 BOOT-INF/lib/javax.annotation-api-1.3.2.jar
297518 Sat Oct 14 11:44:44 CEST 2017 BOOT-INF/lib/snakeyaml-1.19.jar
600 Wed May 09 13:41:20 CEST 2018 BOOT-INF/lib/spring-boot-starter-aop-2.0.2.RELEASE.jar
1930381 Wed Nov 15 11:26:54 CET 2017 BOOT-INF/lib/aspectjweaver-1.8.13.jar
598 Wed May 09 13:41:22 CEST 2018 BOOT-INF/lib/spring-boot-starter-jdbc-2.0.2.RELEASE.jar
143471 Thu Apr 05 17:30:38 CEST 2018 BOOT-INF/lib/HikariCP-2.7.9.jar
401279 Tue May 08 08:06:44 CEST 2018 BOOT-INF/lib/spring-jdbc-5.0.6.RELEASE.jar
6739203 Thu Apr 26 11:06:04 CEST 2018 BOOT-INF/lib/hibernate-core-5.2.17.Final.jar
66469 Wed Feb 14 13:23:28 CET 2018 BOOT-INF/lib/jboss-logging-3.3.2.Final.jar
113371 Fri Jul 26 12:01:34 CEST 2013 BOOT-INF/lib/hibernate-jpa-2.1-api-1.0.0.Final.jar
739582 Tue Oct 10 18:04:58 CEST 2017 BOOT-INF/lib/javassist-3.22.0-GA.jar
445288 Wed Sep 06 11:15:06 CEST 2006 BOOT-INF/lib/antlr-2.7.7.jar
186741 Tue Aug 02 13:41:56 CEST 2016 BOOT-INF/lib/jandex-2.0.3.Final.jar
65100 Sat Sep 09 14:47:28 CEST 2017 BOOT-INF/lib/classmate-1.3.4.jar
313898 Mon May 16 14:19:12 CEST 2005 BOOT-INF/lib/dom4j-1.6.1.jar
75288 Tue Nov 24 15:03:08 CET 2015 BOOT-INF/lib/hibernate-commons-annotations-5.0.1.Final.jar
30724 Mon May 13 15:11:34 CEST 2013 BOOT-INF/lib/javax.transaction-api-1.2.jar
335660 Tue May 08 14:29:02 CEST 2018 BOOT-INF/lib/spring-data-jpa-2.0.7.RELEASE.jar
1076871 Tue May 08 14:23:50 CEST 2018 BOOT-INF/lib/spring-data-commons-2.0.7.RELEASE.jar
191789 Tue May 08 08:07:28 CEST 2018 BOOT-INF/lib/spring-orm-5.0.6.RELEASE.jar
255201 Tue May 08 08:06:38 CEST 2018 BOOT-INF/lib/spring-tx-5.0.6.RELEASE.jar
41203 Thu Mar 16 17:36:32 CET 2017 BOOT-INF/lib/slf4j-api-1.7.25.jar
46745 Tue May 08 08:08:48 CEST 2018 BOOT-INF/lib/spring-aspects-5.0.6.RELEASE.jar
588 Wed May 09 13:41:32 CEST 2018 BOOT-INF/lib/spring-boot-starter-web-2.0.2.RELEASE.jar
645 Wed May 09 13:41:30 CEST 2018 BOOT-INF/lib/spring-boot-starter-json-2.0.2.RELEASE.jar
33392 Mon Mar 26 15:55:48 CEST 2018 BOOT-INF/lib/jackson-datatype-jdk8-2.9.5.jar
99630 Mon Mar 26 15:56:26 CEST 2018 BOOT-INF/lib/jackson-datatype-jsr310-2.9.5.jar
8646 Mon Mar 26 15:54:04 CEST 2018 BOOT-INF/lib/jackson-module-parameter-names-2.9.5.jar
591 Wed May 09 13:41:32 CEST 2018 BOOT-INF/lib/spring-boot-starter-tomcat-2.0.2.RELEASE.jar
3115994 Fri Apr 27 21:24:52 CEST 2018 BOOT-INF/lib/tomcat-embed-core-8.5.31.jar
240244 Fri Apr 27 21:24:54 CEST 2018 BOOT-INF/lib/tomcat-embed-el-8.5.31.jar
256776 Fri Apr 27 21:24:54 CEST 2018 BOOT-INF/lib/tomcat-embed-websocket-8.5.31.jar
1130724 Tue Mar 27 09:03:18 CEST 2018 BOOT-INF/lib/hibernate-validator-6.0.9.Final.jar
93107 Tue Dec 19 16:23:28 CET 2017 BOOT-INF/lib/validation-api-2.0.1.Final.jar
1254097 Tue May 08 08:07:04 CEST 2018 BOOT-INF/lib/spring-web-5.0.6.RELEASE.jar
789889 Tue May 08 08:07:52 CEST 2018 BOOT-INF/lib/spring-webmvc-5.0.6.RELEASE.jar
604 Wed May 09 13:41:42 CEST 2018 BOOT-INF/lib/spring-boot-starter-security-2.0.2.RELEASE.jar
366299 Tue May 08 08:06:20 CEST 2018 BOOT-INF/lib/spring-aop-5.0.6.RELEASE.jar
691611 Tue May 08 15:25:12 CEST 2018 BOOT-INF/lib/spring-security-config-5.0.5.RELEASE.jar
494788 Tue May 08 15:24:48 CEST 2018 BOOT-INF/lib/spring-security-web-5.0.5.RELEASE.jar
72603 Thu Jan 10 22:41:24 CET 2019 BOOT-INF/lib/spring-security-crypto-5.1.3.RELEASE.jar
433210 Thu Jan 10 22:41:26 CET 2019 BOOT-INF/lib/spring-security-core-5.1.3.RELEASE.jar
660573 Tue May 08 08:06:02 CEST 2018 BOOT-INF/lib/spring-beans-5.0.6.RELEASE.jar
1090735 Tue May 08 08:06:32 CEST 2018 BOOT-INF/lib/spring-context-5.0.6.RELEASE.jar
1226584 Tue May 08 08:05:54 CEST 2018 BOOT-INF/lib/spring-core-5.0.6.RELEASE.jar
21704 Tue May 08 08:05:42 CEST 2018 BOOT-INF/lib/spring-jcl-5.0.6.RELEASE.jar
279878 Tue May 08 08:06:20 CEST 2018 BOOT-INF/lib/spring-expression-5.0.6.RELEASE.jar
13769 Tue Nov 13 13:35:54 CET 2018 BOOT-INF/lib/kotlin-stdlib-jdk8-1.3.10.jar
1181292 Tue Nov 13 13:25:52 CET 2018 BOOT-INF/lib/kotlin-stdlib-1.3.10.jar
151024 Tue Nov 13 13:24:28 CET 2018 BOOT-INF/lib/kotlin-stdlib-common-1.3.10.jar
17536 Tue Dec 17 16:10:34 CET 2013 BOOT-INF/lib/annotations-13.0.jar
3137 Tue Nov 13 13:35:52 CET 2018 BOOT-INF/lib/kotlin-stdlib-jdk7-1.3.10.jar
2645740 Tue Nov 13 13:33:06 CET 2018 BOOT-INF/lib/kotlin-reflect-1.3.10.jar
501860 Wed Aug 15 21:36:52 CEST 2018 BOOT-INF/lib/commons-lang3-3.8.jar
127509 Fri Aug 04 15:17:50 CEST 2017 BOOT-INF/lib/javax.ws.rs-api-2.1.jar
164361 Sun Dec 23 12:30:54 CET 2018 BOOT-INF/lib/klaxon-5.0.1.jar
50732 Thu Jan 03 15:45:18 CET 2019 BOOT-INF/lib/java-jwt-3.5.0.jar
1342410 Mon Mar 26 15:13:56 CEST 2018 BOOT-INF/lib/jackson-databind-2.9.5.jar
66519 Sat Jul 29 20:53:26 CEST 2017 BOOT-INF/lib/jackson-annotations-2.9.0.jar
321590 Mon Mar 26 08:04:00 CEST 2018 BOOT-INF/lib/jackson-core-2.9.5.jar
335042 Tue Oct 17 08:53:20 CEST 2017 BOOT-INF/lib/commons-codec-1.11.jar
1007502 Tue Aug 07 08:59:10 CEST 2018 BOOT-INF/lib/mysql-connector-java-5.1.47.jar
I finally solved the problem. I don't if know using the BufferedReader is still the best practice, but I decided to keep it in my code as everything was done with it already. So I dropped the use of File class, and I used the following to get a resource from src/main/resources:
var line: String?
val bufferedReader = BufferedReader(InputStreamReader(Thread.currentThread().contextClassLoader.getResourceAsStream(csvLocation)))
do {
line = bufferedReader.readLine()
if (line != null) {
//Do something with 'line'
}
} while (line != null)
csvLocation value is "data/myFile.csv". This file is located in src/main/resources/data
Finally this solution works in my IDE and in the generated jar. Problem solved.
The production app will not run in your IDE, right? So that is of lesser importance than finding where the file exists on the classpath.
Essentially, there is no src/main/resources dir in the jar file - that directory is just a Maven convention for holding resources in a project. If you crack the jar and find the files in question, you'll understand better where Maven puts those files at package time and how to access them. Also note, a Maven-aware IDE will put files in src/main/resources on the app classpath, so the app will likely run in the IDE as well once the correct solution is identified.
To access the application.properties file in the example, use getResource or getResourceAsStream as suggested, with path /BOOT-INF/classes/application.properties. Note the first slash.

Heroku - Ruby error loop

I have not made any changes to ruby files, just a few layout changes and am seeing the following errors in Papertrail on my server. I did some digging by can't seem to find an answer.
Also the same code base is running in a QA system with no errors. Both servers are on the same build, Cedar-14, with the only difference being that the Prod server has a worker Dyno and QA does not.
Feb 01 11:24:46 skincaremarketplace app/worker.1: Don't know how to build
task 'jobs:work'
Feb 01 11:24:46 skincaremarketplace app/worker.1: /app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:74:in `load'
Feb 01 11:24:46 skincaremarketplace app/worker.1: /app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:74:in `kernel_load'
Feb 01 11:24:46 skincaremarketplace app/worker.1: /app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:27:in `run'
Feb 01 11:24:46 skincaremarketplace app/worker.1: /app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/cli.rb:360:in `exec'
Feb 01 11:24:46 skincaremarketplace app/worker.1: /app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
Feb 01 11:24:46 skincaremarketplace app/worker.1: /app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
Feb 01 11:24:46 skincaremarketplace app/worker.1: /app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor.rb:369:in `dispatch'
Feb 01 11:24:46 skincaremarketplace app/worker.1: /app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/cli.rb:20:in `dispatch'
Feb 01 11:24:46 skincaremarketplace app/worker.1: /app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/base.rb:444:in `start'
Feb 01 11:24:46 skincaremarketplace app/worker.1: /app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/cli.rb:10:in `start'
Feb 01 11:24:46 skincaremarketplace app/worker.1: /app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/exe/bundle:30:in `block in <top (required)>'
Feb 01 11:24:46 skincaremarketplace app/worker.1: /app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
Feb 01 11:24:46 skincaremarketplace app/worker.1: /app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/exe/bundle:22:in `<top (required)>'
Feb 01 11:24:46 skincaremarketplace app/worker.1: /app/bin/bundle:3:in `load'
Feb 01 11:24:46 skincaremarketplace app/worker.1: /app/bin/bundle:3:in `<main>'
Feb 01 11:24:46 skincaremarketplace app/worker.1: (See full trace by running task with --trace)
Feb 01 11:24:46 skincaremarketplace heroku/worker.1: Process exited with status 1
Feb 01 11:40:45 skincaremarketplace heroku/worker.1: State changed from crashed to starting
Feb 01 11:40:52 skincaremarketplace heroku/worker.1: Starting process with command `bundle exec rake jobs:work`
Feb 01 11:40:52 skincaremarketplace heroku/worker.1: State changed from starting to up
Feb 01 11:41:02 skincaremarketplace heroku/worker.1: Process exited with status 1
Feb 01 11:41:02 skincaremarketplace heroku/worker.1: State changed from up to crashed
Feb 01 11:41:02 skincaremarketplace app/worker.1: rake aborted!
Your prod server worker dyno tries to run bundle exec rake jobs:work (check your Procfile). Looks like you don't have that task. It normally should be in lib/tasks/jobs.rake.
If you scale up your QA workers they'll be failing too.
After reviewing the configuration on Heroku, All of our other applications that follow the same pattern, do not use jobs:work, or have a jobs.rake file. The worker was turned on in error. The investigation did shed some light, so thank you Stan.

Saving multiple objects in rails activerecord

I have a recurring job with Rails + Heroku scheduler.rake.
The problem is that it won't save them successfully when it has too many entries.
How can I change this code to make all save completed without error?
This method doesn't need to complete quickly since it will work in the fixed time in the morning, so I am ok to save it one by one with some delay.
(I am using Heroku web and worker each 1x, 25$/month)
Thanks!
*Edited with error logs 2017/02/08
class RecurringEntryJob < ActiveJob::Base
queue_as :default
def perform(*args)
# Get active recurring entries
recurring_entries = Recurring.where(deleted: false)
Rails.logger.info "Recurring_Entry_Called"
for recurring_entry in recurring_entries
Rails.logger.info "“Recurring_Entry Processing for - #{recurring_entry[:id]}"
# Get the current time with saved timezone
timezone = recurring_entry["timezone"]
current_time = Time.now.in_time_zone(timezone)
setDate = recurring_entry["date"]
# Check if daily is set
if setDate == 0 ||
# Checkc if weekday matches
setDate == current_time.wday + 1 ||
# Check if monthly date or end of month match
setDate == current_time.day + 7 || current_time.tomorrow.day == 1 && setDate == 36
Rails.logger.info "Recurring_Entry Day of the week check passed for - #{recurring_entry[:id]}"
# Save an entry at AM4:00
if current_time.hour == 4
Rails.logger.info "Recurring_Entry All cheks passed for - #{recurring_entry[:id]} - creating entry"
# Create entry
entry = Entry.new
entry.user = User.find(recurring_entry["user_id"])
entry.reason = Reason.find_by!(uuid: recurring_entry["reason_uuid"])
entry.account = Account.find_by!(uuid: recurring_entry["account_uuid"])
entry.uuid = SecureRandom.uuid
entry.memo = recurring_entry["memo"]
entry.date = current_time
entry.price = recurring_entry["price"]
entry.is_expense = recurring_entry["is_expense"]
entry.updated_mobile = current_time
entry.reason_uuid = recurring_entry["reason_uuid"]
entry.account_uuid = recurring_entry["account_uuid"]
entry.project_uuid = recurring_entry["project_uuid"]
entry.save!
end
end
end
end
end
Error logs
Feb 08 04:10:51 taxnote heroku/scheduler.5289: Starting process with command `bundle exec rake recurring_entry`
Feb 08 04:10:51 taxnote heroku/scheduler.5289: State changed from starting to up
Feb 08 04:10:57 taxnote app/scheduler.5289: [ActiveJob] [RecurringEntryJob] [88810de1-fffb-4e16-b8f8-17712bc5b084] Performing RecurringEntryJob from Inline(default)
Feb 08 04:10:57 taxnote app/scheduler.5289: [ActiveJob] [RecurringEntryJob] [88810de1-fffb-4e16-b8f8-17712bc5b084] Recurring_Entry_Called
Feb 08 04:10:57 taxnote app/scheduler.5289: [ActiveJob] [RecurringEntryJob] [88810de1-fffb-4e16-b8f8-17712bc5b084] “Recurring_Entry Processing for - 102
Feb 08 04:10:57 taxnote app/scheduler.5289: [ActiveJob] [RecurringEntryJob] [88810de1-fffb-4e16-b8f8-17712bc5b084] “Recurring_Entry Processing for - 88
Feb 08 04:10:57 taxnote app/scheduler.5289: [ActiveJob] [RecurringEntryJob] [88810de1-fffb-4e16-b8f8-17712bc5b084] “Recurring_Entry Processing for - 89
Feb 08 04:10:57 taxnote app/scheduler.5289: [ActiveJob] [RecurringEntryJob] [88810de1-fffb-4e16-b8f8-17712bc5b084] “Recurring_Entry Processing for - 92
Feb 08 04:10:57 taxnote app/scheduler.5289: [ActiveJob] [RecurringEntryJob] [88810de1-fffb-4e16-b8f8-17712bc5b084] “Recurring_Entry Processing for - 93
Feb 08 04:10:57 taxnote app/scheduler.5289: [ActiveJob] [RecurringEntryJob] [88810de1-fffb-4e16-b8f8-17712bc5b084] “Recurring_Entry Processing for - 94
Feb 08 04:10:57 taxnote app/scheduler.5289: [ActiveJob] [RecurringEntryJob] [88810de1-fffb-4e16-b8f8-17712bc5b084] “Recurring_Entry Processing for - 95
Feb 08 04:10:57 taxnote app/scheduler.5289: [ActiveJob] [RecurringEntryJob] [88810de1-fffb-4e16-b8f8-17712bc5b084] “Recurring_Entry Processing for - 96
Feb 08 04:10:57 taxnote app/scheduler.5289: [ActiveJob] [RecurringEntryJob] [88810de1-fffb-4e16-b8f8-17712bc5b084] “Recurring_Entry Processing for - 98
Feb 08 04:10:57 taxnote app/scheduler.5289: [ActiveJob] [RecurringEntryJob] [88810de1-fffb-4e16-b8f8-17712bc5b084] “Recurring_Entry Processing for - 97
Feb 08 04:10:57 taxnote app/scheduler.5289: [ActiveJob] [RecurringEntryJob] [88810de1-fffb-4e16-b8f8-17712bc5b084] “Recurring_Entry Processing for - 99
Feb 08 04:10:57 taxnote app/scheduler.5289: [ActiveJob] [RecurringEntryJob] [88810de1-fffb-4e16-b8f8-17712bc5b084] “Recurring_Entry Processing for - 103
Feb 08 04:10:57 taxnote app/scheduler.5289: [ActiveJob] [RecurringEntryJob] [88810de1-fffb-4e16-b8f8-17712bc5b084] “Recurring_Entry Processing for - 104
Feb 08 04:10:57 taxnote app/scheduler.5289: [ActiveJob] [RecurringEntryJob] [88810de1-fffb-4e16-b8f8-17712bc5b084] “Recurring_Entry Processing for - 105
Feb 08 04:10:57 taxnote app/scheduler.5289: [ActiveJob] [RecurringEntryJob] [88810de1-fffb-4e16-b8f8-17712bc5b084] “Recurring_Entry Processing for - 106
Feb 08 04:10:57 taxnote app/scheduler.5289: [ActiveJob] [RecurringEntryJob] [88810de1-fffb-4e16-b8f8-17712bc5b084] Recurring_Entry Day of the week check passed for - 106
Feb 08 04:10:57 taxnote app/scheduler.5289: [ActiveJob] [RecurringEntryJob] [88810de1-fffb-4e16-b8f8-17712bc5b084] Recurring_Entry All cheks passed for - 106 - creating entry
Feb 08 04:10:57 taxnote app/scheduler.5289: [ActiveJob] [RecurringEntryJob] [88810de1-fffb-4e16-b8f8-17712bc5b084] “Recurring_Entry Processing for - 107
Feb 08 04:10:57 taxnote app/scheduler.5289: [ActiveJob] [RecurringEntryJob] [88810de1-fffb-4e16-b8f8-17712bc5b084] “Recurring_Entry Processing for - 108
Feb 08 04:10:57 taxnote app/scheduler.5289: [ActiveJob] [RecurringEntryJob] [88810de1-fffb-4e16-b8f8-17712bc5b084] “Recurring_Entry Processing for - 109
Feb 08 04:10:57 taxnote app/scheduler.5289: [ActiveJob] [RecurringEntryJob] [88810de1-fffb-4e16-b8f8-17712bc5b084] “Recurring_Entry Processing for - 110
Feb 08 04:10:57 taxnote app/scheduler.5289: [ActiveJob] [RecurringEntryJob] [88810de1-fffb-4e16-b8f8-17712bc5b084] “Recurring_Entry Processing for - 111
Feb 08 04:10:57 taxnote app/scheduler.5289: [ActiveJob] [RecurringEntryJob] [88810de1-fffb-4e16-b8f8-17712bc5b084] “Recurring_Entry Processing for - 112
Feb 08 04:10:57 taxnote app/scheduler.5289: [ActiveJob] [RecurringEntryJob] [88810de1-fffb-4e16-b8f8-17712bc5b084] “Recurring_Entry Processing for - 113
Feb 08 04:10:57 taxnote app/scheduler.5289: [ActiveJob] [RecurringEntryJob] [88810de1-fffb-4e16-b8f8-17712bc5b084] “Recurring_Entry Processing for - 115
Feb 08 04:10:57 taxnote app/scheduler.5289: [ActiveJob] [RecurringEntryJob] [88810de1-fffb-4e16-b8f8-17712bc5b084] “Recurring_Entry Processing for - 114
Feb 08 04:10:57 taxnote app/scheduler.5289: [ActiveJob] [RecurringEntryJob] [88810de1-fffb-4e16-b8f8-17712bc5b084] “Recurring_Entry Processing for - 87
Feb 08 04:10:57 taxnote app/scheduler.5289: [ActiveJob] [RecurringEntryJob] [88810de1-fffb-4e16-b8f8-17712bc5b084] “Recurring_Entry Processing for - 138
Feb 08 04:10:57 taxnote app/scheduler.5289: [ActiveJob] [RecurringEntryJob] [88810de1-fffb-4e16-b8f8-17712bc5b084] “Recurring_Entry Processing for - 117
Feb 08 04:10:57 taxnote app/scheduler.5289: [ActiveJob] [RecurringEntryJob] [88810de1-fffb-4e16-b8f8-17712bc5b084] “Recurring_Entry Processing for - 118
Feb 08 04:10:57 taxnote app/scheduler.5289: [ActiveJob] [RecurringEntryJob] [88810de1-fffb-4e16-b8f8-17712bc5b084] Recurring_Entry Day of the week check passed for - 118
Feb 08 04:10:57 taxnote app/scheduler.5289: [ActiveJob] [RecurringEntryJob] [88810de1-fffb-4e16-b8f8-17712bc5b084] Recurring_Entry All cheks passed for - 118 - creating entry
Feb 08 04:10:58 taxnote app/scheduler.5289: [ActiveJob] [RecurringEntryJob] [88810de1-fffb-4e16-b8f8-17712bc5b084] Performed RecurringEntryJob from Inline(default) in 260.25ms
Feb 08 04:10:58 taxnote app/scheduler.5289: rake aborted!
Feb 08 04:10:58 taxnote app/scheduler.5289: ActiveRecord::RecordNotFound: Couldn't find Account
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.6/lib/active_record/core.rb:196:in `find_by!'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/app/jobs/recurring_entry_job.rb:42:in `block in perform'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.6/lib/active_record/relation/delegation.rb:46:in `each'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.6/lib/active_record/relation/delegation.rb:46:in `each'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/app/jobs/recurring_entry_job.rb:11:in `perform'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activejob-4.2.6/lib/active_job/execution.rb:32:in `block in perform_now'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:117:in `call'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:555:in `block (2 levels) in compile'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:505:in `call'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:498:in `block (2 levels) in around'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:343:in `block (2 levels) in simple'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/i18n-0.7.0/lib/i18n.rb:257:in `with_locale'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activejob-4.2.6/lib/active_job/translation.rb:7:in `block (2 levels) in <module:Translation>'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:441:in `instance_exec'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:441:in `block in make_lambda'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:342:in `block in simple'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:497:in `block in around'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:505:in `call'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:498:in `block (2 levels) in around'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:343:in `block (2 levels) in simple'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activejob-4.2.6/lib/active_job/logging.rb:23:in `block (4 levels) in <module:Logging>'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/notifications.rb:164:in `block in instrument'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/notifications.rb:164:in `instrument'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activejob-4.2.6/lib/active_job/logging.rb:22:in `block (3 levels) in <module:Logging>'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activejob-4.2.6/lib/active_job/logging.rb:43:in `block in tag_logger'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/tagged_logging.rb:68:in `block in tagged'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/tagged_logging.rb:26:in `tagged'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/tagged_logging.rb:68:in `tagged'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activejob-4.2.6/lib/active_job/logging.rb:43:in `tag_logger'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activejob-4.2.6/lib/active_job/logging.rb:19:in `block (2 levels) in <module:Logging>'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:441:in `instance_exec'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:441:in `block in make_lambda'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:342:in `block in simple'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:497:in `block in around'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:505:in `call'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:92:in `__run_callbacks__'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:778:in `_run_perform_callbacks'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:81:in `run_callbacks'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activejob-4.2.6/lib/active_job/execution.rb:31:in `perform_now'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activejob-4.2.6/lib/active_job/execution.rb:21:in `execute'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activejob-4.2.6/lib/active_job/queue_adapters/inline_adapter.rb:14:in `enqueue'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activejob-4.2.6/lib/active_job/enqueuing.rb:71:in `block in enqueue'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:117:in `call'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:555:in `block (2 levels) in compile'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:505:in `call'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:498:in `block (2 levels) in around'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:343:in `block (2 levels) in simple'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activejob-4.2.6/lib/active_job/logging.rb:14:in `block (3 levels) in <module:Logging>'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activejob-4.2.6/lib/active_job/logging.rb:43:in `block in tag_logger'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/tagged_logging.rb:68:in `block in tagged'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/tagged_logging.rb:26:in `tagged'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/tagged_logging.rb:68:in `tagged'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activejob-4.2.6/lib/active_job/logging.rb:43:in `tag_logger'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activejob-4.2.6/lib/active_job/logging.rb:13:in `block (2 levels) in <module:Logging>'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:441:in `instance_exec'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:441:in `block in make_lambda'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:342:in `block in simple'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:497:in `block in around'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:505:in `call'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:92:in `__run_callbacks__'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:778:in `_run_enqueue_callbacks'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:81:in `run_callbacks'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activejob-4.2.6/lib/active_job/enqueuing.rb:67:in `enqueue'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/activejob-4.2.6/lib/active_job/enqueuing.rb:17:in `perform_later'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/lib/tasks/scheduler.rake:4:in `block in <top (required)>'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/bugsnag-4.0.2/lib/bugsnag/rake.rb:12:in `execute_with_bugsnag'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/rake-11.2.2/exe/rake:27:in `<top (required)>'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/bundler-1.13.7/lib/bundler/cli/exec.rb:74:in `load'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/bundler-1.13.7/lib/bundler/cli/exec.rb:74:in `kernel_load'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/bundler-1.13.7/lib/bundler/cli/exec.rb:27:in `run'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/bundler-1.13.7/lib/bundler/cli.rb:332:in `exec'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/bundler-1.13.7/lib/bundler/cli.rb:20:in `dispatch'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/bundler-1.13.7/lib/bundler/cli.rb:11:in `start'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/bundler-1.13.7/exe/bundle:34:in `block in <top (required)>'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/bundler-1.13.7/lib/bundler/friendly_errors.rb:100:in `with_friendly_errors'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/vendor/bundle/ruby/2.3.0/gems/bundler-1.13.7/exe/bundle:26:in `<top (required)>'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/bin/bundle:3:in `load'
Feb 08 04:10:58 taxnote app/scheduler.5289: /app/bin/bundle:3:in `<main>'
Feb 08 04:10:58 taxnote app/scheduler.5289: Tasks: TOP => recurring_entry
Feb 08 04:10:58 taxnote app/scheduler.5289: (See full trace by running task with --trace)
Feb 08 04:10:58 taxnote heroku/scheduler.5289: State changed from up to complete
Feb 08 04:10:58 taxnote heroku/scheduler.5289: Process exited with status 1
What is the exact error you're seeing?
Without seeing the error you're getting, Rails is probably trying to instantiate all of the matching instances of Recurring, and this is taking more memory than you have available. An easy way to attempt to solve this problem is to use find_each rather than instantiating the full result set. This will load the matching records in batches (with a default of 1000 records, but you can configure this to suit.
Recurring.where(deleted: false).find_each do |recurring|
# work on recurring
end
As the error that is happening is when an Account record is not found, you could add some error handling as follows to allow for that.
Recurring.where(deleted: false).find_each do |recurring|
# work on recurring
rescue ActiveRecord::RecordNotFound => e
Rails.logger.error("Account not found: #{recurring.account_uuid}")
next
end
I could fix this issue by checking the error logs, it was because when account part was not founded it stopped the loop.
class RecurringEntryJob < ActiveJob::Base
queue_as :default
def perform(*args)
# Get active recurring entries
recurring_entries = Recurring.where(deleted: false)
Rails.logger.info "Recurring_Entry_Called"
for recurring_entry in recurring_entries
# Rails.logger.info "“Recurring_Entry Processing for - #{recurring_entry[:id]}"
# Get the current time with saved timezone
timezone = recurring_entry["timezone"]
current_time = Time.now.in_time_zone(timezone)
setDate = recurring_entry["date"]
# Check if daily is set
if setDate == 0 ||
# Checkc if weekday matches
setDate == current_time.wday + 1 ||
# Check if monthly date or end of month match
setDate == current_time.day + 7 || current_time.tomorrow.day == 1 && setDate == 36
# Rails.logger.info "Recurring_Entry date check passed for - #{recurring_entry[:id]}"
# Save an entry at AM4:00
if current_time.hour == 4
Rails.logger.info "Recurring_Entry time check passed for - #{recurring_entry[:id]} - creating entry"
# Create entry
entry = Entry.new
entry.user = User.find(recurring_entry["user_id"])
if entry.user.blank?
Rails.logger.info "User Blank for - #{recurring_entry[:id]}"
next
end
entry.reason = Reason.find_by(uuid: recurring_entry["reason_uuid"])
if entry.reason.blank?
Rails.logger.info "Reason Blank for - #{recurring_entry[:id]}"
next
end
entry.account = Account.find_by(uuid: recurring_entry["account_uuid"])
if entry.account.blank?
Rails.logger.info "Account Blank for - #{recurring_entry[:id]}"
next
end
entry.uuid = SecureRandom.uuid
entry.memo = recurring_entry["memo"]
entry.date = current_time
entry.price = recurring_entry["price"]
entry.is_expense = recurring_entry["is_expense"]
entry.updated_mobile = current_time
entry.reason_uuid = recurring_entry["reason_uuid"]
entry.account_uuid = recurring_entry["account_uuid"]
entry.project_uuid = recurring_entry["project_uuid"]
entry.save!
Rails.logger.info "Recurring_Entry Completed for - #{recurring_entry[:id]}"
end
end
end
end
end

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