coverallsapp / coverage-reporter

Self-contained, universal coverage uploader binary. Under development.
https://coveralls.io
MIT License
44 stars 14 forks source link

Does not work if TZ is not set #3

Closed chaychoong closed 3 years ago

chaychoong commented 3 years ago

How to reproduce

Run the binary in a ubuntu:18.04 docker container

🚀 Posting coverage data to https://coveralls.io/api/v1/jobs
Unhandled exception:  (Time::Location::InvalidTZDataError)
  from /usr/share/crystal/src/time/location/loader.cr:81:5 in 'read_zoneinfo'
  from /usr/share/crystal/src/crystal/system/unix/time.cr:59:9 in 'local'
  from /usr/share/crystal/src/time/location.cr:460:5 in 'new'
  from /usr/share/crystal/src/compress/gzip/reader.cr:57:5 in 'initialize'
  from /usr/share/crystal/src/http/common.cr:54:11 in 'from_io?'
  from /usr/share/crystal/src/http/client.cr:600:5 in 'exec_internal_single'
  from /usr/share/crystal/src/http/client.cr:587:5 in 'exec'
  from /app/lib/crest/src/crest/request.cr:180:23 in 'execute'
  from /app/src/coverage_reporter.cr:27:3 in 'run'
  from /app/src/cli.cr:85:5 in '__crystal_main'
  from /usr/share/crystal/src/crystal/main.cr:110:5 in 'main'
  from src/env/__libc_start_main.c:94:2 in 'libc_start_main_stage2'
Caused by: Error reading file: Is a directory (IO::Error)
  from /usr/share/crystal/src/io/evented.cr:131:7 in 'unbuffered_read'
  from /usr/share/crystal/src/io/buffered.cr:240:5 in 'read'
  from /usr/share/crystal/src/io.cr:521:7 in 'read_fully'
  from /usr/share/crystal/src/io.cr:442:9 in 'read_zoneinfo'
  from /usr/share/crystal/src/crystal/system/unix/time.cr:59:9 in 'local'
  from /usr/share/crystal/src/time/location.cr:460:5 in 'new'
  from /usr/share/crystal/src/compress/gzip/reader.cr:57:5 in 'initialize'
  from /usr/share/crystal/src/http/common.cr:54:11 in 'from_io?'
  from /usr/share/crystal/src/http/client.cr:600:5 in 'exec_internal_single'
  from /usr/share/crystal/src/http/client.cr:587:5 in 'exec'
  from /app/lib/crest/src/crest/request.cr:180:23 in 'execute'
  from /app/src/coverage_reporter.cr:27:3 in 'run'
  from /app/src/cli.cr:85:5 in '__crystal_main'
  from /usr/share/crystal/src/crystal/main.cr:110:5 in 'main'
  from src/env/__libc_start_main.c:94:2 in 'libc_start_main_stage2'

Workaround

export TZ=UTC first

Related issue

https://github.com/crystal-lang/crystal/issues/10651

chaychoong commented 3 years ago

Closing this as this is partially due to my own setup and is an edge case that crystal should be solving