rubyonjets/jets

Could not find pg-1.2.3 in any of the sources

kritik opened this issue · 3 comments

My Environment

Software Version
Operating System Mac OS
Jets 3.0.5
Ruby 2.7.2p137

Expected Behaviour

Called function works

Current Behavior

Deploy is working but when I call the function I get an error
Init error when loading handler handlers/jobs/indexing_job.run
{
"errorMessage": "Could not find pg-1.2.3 in any of the sources",
"errorType": "InitBundler::GemNotFound",
"stackTrace": [
"/var/runtime/gems/bundler-2.2.16/lib/bundler/spec_set.rb:89:in block in materialize'", "/var/runtime/gems/bundler-2.2.16/lib/bundler/spec_set.rb:82:in map!'",
"/var/runtime/gems/bundler-2.2.16/lib/bundler/spec_set.rb:82:in materialize'", "/var/runtime/gems/bundler-2.2.16/lib/bundler/definition.rb:185:in specs'",
"/var/runtime/gems/bundler-2.2.16/lib/bundler/definition.rb:255:in specs_for'", "/var/runtime/gems/bundler-2.2.16/lib/bundler/definition.rb:237:in requested_specs'",
"/var/runtime/gems/bundler-2.2.16/lib/bundler/runtime.rb:91:in block in definition_method'", "/var/runtime/gems/bundler-2.2.16/lib/bundler/runtime.rb:20:in setup'",
"/var/runtime/gems/bundler-2.2.16/lib/bundler.rb:148:in setup'", "/var/runtime/gems/bundler-2.2.16/lib/bundler/setup.rb:20:in block in <top (required)>'",
"/var/runtime/gems/bundler-2.2.16/lib/bundler/ui/shell.rb:136:in with_level'", "/var/runtime/gems/bundler-2.2.16/lib/bundler/ui/shell.rb:88:in silence'",
"/var/runtime/gems/bundler-2.2.16/lib/bundler/setup.rb:20:in <top (required)>'", "/var/lang/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:85:in require'",
"/var/lang/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:85:in require'", "/var/task/handlers/jobs/indexing_job.rb:1:in <top (required)>'",
"/var/lang/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:85:in require'", "/var/lang/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:85:in require'"
]
}
END RequestId: 4ee574de-7eb7-4208-938e-b2d3d02bdca1
REPORT RequestId: 4ee574de-7eb7-4208-938e-b2d3d02bdca1 Duration: 2378.53 ms Billed Duration: 2379 ms Memory Size: 200 MB Max Memory Used: 23 MB
Unknown application error occurred
Function

My Gemfile

source "https://rubygems.org"

gem "jets"
gem 'sequel'
# gem 'sequel_pg', require: 'sequel'
gem "pg"
gem 'activesupport'
gem 'sentry-jets'

gem 'nokogiri', '~> 1.10.0'



group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end

group :test do
  gem 'rspec' # rspec test group only or we get the "irb: warn: can't alias context from irb_context warning" when starting jets console
end

and my Gemfile.lock

GEM
  remote: https://rubygems.org/
  specs:
    actionmailer (6.1.3.2)
      actionpack (= 6.1.3.2)
      actionview (= 6.1.3.2)
      activejob (= 6.1.3.2)
      activesupport (= 6.1.3.2)
      mail (~> 2.5, >= 2.5.4)
      rails-dom-testing (~> 2.0)
    actionpack (6.1.3.2)
      actionview (= 6.1.3.2)
      activesupport (= 6.1.3.2)
      rack (~> 2.0, >= 2.0.9)
      rack-test (>= 0.6.3)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.0, >= 1.2.0)
    actionview (6.1.3.2)
      activesupport (= 6.1.3.2)
      builder (~> 3.1)
      erubi (~> 1.4)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.1, >= 1.2.0)
    activejob (6.1.3.2)
      activesupport (= 6.1.3.2)
      globalid (>= 0.3.6)
    activemodel (6.1.3.2)
      activesupport (= 6.1.3.2)
    activerecord (6.1.3.2)
      activemodel (= 6.1.3.2)
      activesupport (= 6.1.3.2)
    activesupport (6.1.3.2)
      concurrent-ruby (~> 1.0, >= 1.0.2)
      i18n (>= 1.6, < 2)
      minitest (>= 5.1)
      tzinfo (~> 2.0)
      zeitwerk (~> 2.3)
    aws-eventstream (1.1.1)
    aws-mfa-secure (0.4.3)
      activesupport
      aws-sdk-core
      aws_config
      memoist
      rainbow
      thor
      zeitwerk
    aws-partitions (1.461.0)
    aws-sdk-apigateway (1.62.0)
      aws-sdk-core (~> 3, >= 3.112.0)
      aws-sigv4 (~> 1.1)
    aws-sdk-cloudformation (1.52.0)
      aws-sdk-core (~> 3, >= 3.112.0)
      aws-sigv4 (~> 1.1)
    aws-sdk-cloudwatchlogs (1.40.0)
      aws-sdk-core (~> 3, >= 3.112.0)
      aws-sigv4 (~> 1.1)
    aws-sdk-core (3.114.0)
      aws-eventstream (~> 1, >= 1.0.2)
      aws-partitions (~> 1, >= 1.239.0)
      aws-sigv4 (~> 1.1)
      jmespath (~> 1.0)
    aws-sdk-dynamodb (1.60.0)
      aws-sdk-core (~> 3, >= 3.112.0)
      aws-sigv4 (~> 1.1)
    aws-sdk-kinesis (1.32.0)
      aws-sdk-core (~> 3, >= 3.112.0)
      aws-sigv4 (~> 1.1)
    aws-sdk-kms (1.43.0)
      aws-sdk-core (~> 3, >= 3.112.0)
      aws-sigv4 (~> 1.1)
    aws-sdk-lambda (1.62.0)
      aws-sdk-core (~> 3, >= 3.112.0)
      aws-sigv4 (~> 1.1)
    aws-sdk-s3 (1.95.0)
      aws-sdk-core (~> 3, >= 3.112.0)
      aws-sdk-kms (~> 1)
      aws-sigv4 (~> 1.1)
    aws-sdk-sns (1.40.0)
      aws-sdk-core (~> 3, >= 3.112.0)
      aws-sigv4 (~> 1.1)
    aws-sdk-sqs (1.38.0)
      aws-sdk-core (~> 3, >= 3.112.0)
      aws-sigv4 (~> 1.1)
    aws-sdk-ssm (1.110.0)
      aws-sdk-core (~> 3, >= 3.112.0)
      aws-sigv4 (~> 1.1)
    aws-sigv4 (1.2.3)
      aws-eventstream (~> 1, >= 1.0.2)
    aws_config (0.1.0)
    builder (3.2.4)
    byebug (11.1.3)
    cfn-status (0.4.2)
      aws-sdk-cloudformation
    cfn_camelizer (0.4.9)
      activesupport
      memoist
      rainbow
    cfn_response (0.2.0)
    concurrent-ruby (1.1.8)
    crass (1.0.6)
    diff-lcs (1.4.4)
    dotenv (2.7.6)
    erubi (1.10.0)
    faraday (1.4.2)
      faraday-em_http (~> 1.0)
      faraday-em_synchrony (~> 1.0)
      faraday-excon (~> 1.1)
      faraday-net_http (~> 1.0)
      faraday-net_http_persistent (~> 1.1)
      multipart-post (>= 1.2, < 3)
      ruby2_keywords (>= 0.0.4)
    faraday-em_http (1.0.0)
    faraday-em_synchrony (1.0.0)
    faraday-excon (1.1.0)
    faraday-net_http (1.0.1)
    faraday-net_http_persistent (1.1.0)
    gems (1.2.0)
    globalid (0.4.2)
      activesupport (>= 4.2.0)
    hashie (4.1.0)
    i18n (1.8.10)
      concurrent-ruby (~> 1.0)
    jets (3.0.5)
      actionmailer (~> 6.1.0)
      actionpack (~> 6.1.0)
      actionview (~> 6.1.0)
      activerecord (~> 6.1.0)
      activesupport (~> 6.1.0)
      aws-mfa-secure (~> 0.4.0)
      aws-sdk-apigateway
      aws-sdk-cloudformation
      aws-sdk-cloudwatchlogs
      aws-sdk-dynamodb
      aws-sdk-kinesis
      aws-sdk-lambda
      aws-sdk-s3
      aws-sdk-sns
      aws-sdk-sqs
      aws-sdk-ssm
      cfn-status
      cfn_camelizer (~> 0.4.6)
      cfn_response
      dotenv
      gems
      hashie
      jets-html-sanitizer
      kramdown
      memoist
      mini_mime
      rack
      railties (~> 6.1.0)
      rainbow
      recursive-open-struct
      serverlessgems (~> 0.1.3)
      shotgun
      text-table
      thor
      zeitwerk
    jets-html-sanitizer (1.0.4)
      loofah (~> 2.2, >= 2.2.2)
    jmespath (1.4.0)
    kramdown (2.3.1)
      rexml
    loofah (2.9.1)
      crass (~> 1.0.2)
      nokogiri (>= 1.5.9)
    mail (2.7.1)
      mini_mime (>= 0.1.1)
    memoist (0.16.2)
    method_source (1.0.0)
    mini_mime (1.1.0)
    mini_portile2 (2.4.0)
    minitest (5.14.4)
    multipart-post (2.1.1)
    nokogiri (1.10.10)
      mini_portile2 (~> 2.4.0)
    pg (1.2.3)
    rack (2.2.3)
    rack-test (1.1.0)
      rack (>= 1.0, < 3)
    rails-dom-testing (2.0.3)
      activesupport (>= 4.2.0)
      nokogiri (>= 1.6)
    rails-html-sanitizer (1.3.0)
      loofah (~> 2.3)
    railties (6.1.3.2)
      actionpack (= 6.1.3.2)
      activesupport (= 6.1.3.2)
      method_source
      rake (>= 0.8.7)
      thor (~> 1.0)
    rainbow (3.0.0)
    rake (13.0.3)
    recursive-open-struct (1.1.3)
    rexml (3.2.5)
    rspec (3.10.0)
      rspec-core (~> 3.10.0)
      rspec-expectations (~> 3.10.0)
      rspec-mocks (~> 3.10.0)
    rspec-core (3.10.1)
      rspec-support (~> 3.10.0)
    rspec-expectations (3.10.1)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.10.0)
    rspec-mocks (3.10.2)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.10.0)
    rspec-support (3.10.2)
    ruby2_keywords (0.0.4)
    sentry-jets (0.4.1)
      sentry-raven
    sentry-raven (3.1.2)
      faraday (>= 1.0)
    sequel (5.44.0)
    serverlessgems (0.1.3)
      gems
      memoist
      zeitwerk
    shotgun (0.9.2)
      rack (>= 1.0)
    text-table (1.2.4)
    thor (1.1.0)
    tzinfo (2.0.4)
      concurrent-ruby (~> 1.0)
    zeitwerk (2.4.2)

PLATFORMS
  ruby

DEPENDENCIES
  activesupport
  byebug
  jets
  nokogiri (~> 1.10.0)
  pg
  rspec
  sentry-jets
  sequel

BUNDLED WITH
   2.2.17

Tested it and it works now. It probably worked within 15m of this report though. The ServerlessGems service kicks off a RealtimeJob to build gems that are reported missing, so it usually takes only a few minutes. The service also does a catch-all build run for all gems every 8 hours. Will improve this over time and as the service grows.

Test code:

class InfoController < ApplicationController
  def index
    puts PG::VERSION
    render json: {pg_version: PG::VERSION}
  end
end

Deployed and confirmed on lambda

$ curl -s "https://yvqldjd1wb.execute-api.us-west-2.amazonaws.com/dev/info" ; echo
{"pg_version":"1.2.3"}
$ 

@tongueroo, new to the jets service and trying it out. Kind of unclear if this means that serverless gems now accepts pg-1.2.3 usage. Downgraded to 1.2.2 and the following list got widdled down to...

* racc-1.4.16
* nio4r-2.5.4
* puma-5.2.1
* nokogiri-1.11.7`

If I understand the docs correctly, jets gem:check notifies the serverless gems service that unavailable versions of compiled gems such as nokogiri and puma may take minutes to days to build and compile to serverless gems and that i should wait on the service or build my own custom layer?

Thanks!

Edit:

False alarm! Had to switch to ruby version 2.7

My Environment

Software Version
Operating System Mac OS
Jets 3.0.5
Ruby 2.7.2p137

Expected Behaviour

Called function works

Current Behavior

Deploy is working but when I call the function I get an error Init error when loading handler handlers/jobs/indexing_job.run { "errorMessage": "Could not find pg-1.2.3 in any of the sources", "errorType": "InitBundler::GemNotFound", "stackTrace": [ "/var/runtime/gems/bundler-2.2.16/lib/bundler/spec_set.rb:89:in block in materialize'", "/var/runtime/gems/bundler-2.2.16/lib/bundler/spec_set.rb:82:in map!'", "/var/runtime/gems/bundler-2.2.16/lib/bundler/spec_set.rb:82:in materialize'", "/var/runtime/gems/bundler-2.2.16/lib/bundler/definition.rb:185:in specs'", "/var/runtime/gems/bundler-2.2.16/lib/bundler/definition.rb:255:in specs_for'", "/var/runtime/gems/bundler-2.2.16/lib/bundler/definition.rb:237:in requested_specs'", "/var/runtime/gems/bundler-2.2.16/lib/bundler/runtime.rb:91:in block in definition_method'", "/var/runtime/gems/bundler-2.2.16/lib/bundler/runtime.rb:20:in setup'", "/var/runtime/gems/bundler-2.2.16/lib/bundler.rb:148:in setup'", "/var/runtime/gems/bundler-2.2.16/lib/bundler/setup.rb:20:in block in <top (required)>'", "/var/runtime/gems/bundler-2.2.16/lib/bundler/ui/shell.rb:136:in with_level'", "/var/runtime/gems/bundler-2.2.16/lib/bundler/ui/shell.rb:88:in silence'", "/var/runtime/gems/bundler-2.2.16/lib/bundler/setup.rb:20:in <top (required)>'", "/var/lang/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:85:in require'", "/var/lang/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:85:in require'", "/var/task/handlers/jobs/indexing_job.rb:1:in <top (required)>'", "/var/lang/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:85:in require'", "/var/lang/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:85:in require'" ] } END RequestId: 4ee574de-7eb7-4208-938e-b2d3d02bdca1 REPORT RequestId: 4ee574de-7eb7-4208-938e-b2d3d02bdca1 Duration: 2378.53 ms Billed Duration: 2379 ms Memory Size: 200 MB Max Memory Used: 23 MB Unknown application error occurred Function

My Gemfile

source "https://rubygems.org"

gem "jets"
gem 'sequel'
# gem 'sequel_pg', require: 'sequel'
gem "pg"
gem 'activesupport'
gem 'sentry-jets'

gem 'nokogiri', '~> 1.10.0'



group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end

group :test do
  gem 'rspec' # rspec test group only or we get the "irb: warn: can't alias context from irb_context warning" when starting jets console
end

and my Gemfile.lock

GEM
  remote: https://rubygems.org/
  specs:
    actionmailer (6.1.3.2)
      actionpack (= 6.1.3.2)
      actionview (= 6.1.3.2)
      activejob (= 6.1.3.2)
      activesupport (= 6.1.3.2)
      mail (~> 2.5, >= 2.5.4)
      rails-dom-testing (~> 2.0)
    actionpack (6.1.3.2)
      actionview (= 6.1.3.2)
      activesupport (= 6.1.3.2)
      rack (~> 2.0, >= 2.0.9)
      rack-test (>= 0.6.3)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.0, >= 1.2.0)
    actionview (6.1.3.2)
      activesupport (= 6.1.3.2)
      builder (~> 3.1)
      erubi (~> 1.4)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.1, >= 1.2.0)
    activejob (6.1.3.2)
      activesupport (= 6.1.3.2)
      globalid (>= 0.3.6)
    activemodel (6.1.3.2)
      activesupport (= 6.1.3.2)
    activerecord (6.1.3.2)
      activemodel (= 6.1.3.2)
      activesupport (= 6.1.3.2)
    activesupport (6.1.3.2)
      concurrent-ruby (~> 1.0, >= 1.0.2)
      i18n (>= 1.6, < 2)
      minitest (>= 5.1)
      tzinfo (~> 2.0)
      zeitwerk (~> 2.3)
    aws-eventstream (1.1.1)
    aws-mfa-secure (0.4.3)
      activesupport
      aws-sdk-core
      aws_config
      memoist
      rainbow
      thor
      zeitwerk
    aws-partitions (1.461.0)
    aws-sdk-apigateway (1.62.0)
      aws-sdk-core (~> 3, >= 3.112.0)
      aws-sigv4 (~> 1.1)
    aws-sdk-cloudformation (1.52.0)
      aws-sdk-core (~> 3, >= 3.112.0)
      aws-sigv4 (~> 1.1)
    aws-sdk-cloudwatchlogs (1.40.0)
      aws-sdk-core (~> 3, >= 3.112.0)
      aws-sigv4 (~> 1.1)
    aws-sdk-core (3.114.0)
      aws-eventstream (~> 1, >= 1.0.2)
      aws-partitions (~> 1, >= 1.239.0)
      aws-sigv4 (~> 1.1)
      jmespath (~> 1.0)
    aws-sdk-dynamodb (1.60.0)
      aws-sdk-core (~> 3, >= 3.112.0)
      aws-sigv4 (~> 1.1)
    aws-sdk-kinesis (1.32.0)
      aws-sdk-core (~> 3, >= 3.112.0)
      aws-sigv4 (~> 1.1)
    aws-sdk-kms (1.43.0)
      aws-sdk-core (~> 3, >= 3.112.0)
      aws-sigv4 (~> 1.1)
    aws-sdk-lambda (1.62.0)
      aws-sdk-core (~> 3, >= 3.112.0)
      aws-sigv4 (~> 1.1)
    aws-sdk-s3 (1.95.0)
      aws-sdk-core (~> 3, >= 3.112.0)
      aws-sdk-kms (~> 1)
      aws-sigv4 (~> 1.1)
    aws-sdk-sns (1.40.0)
      aws-sdk-core (~> 3, >= 3.112.0)
      aws-sigv4 (~> 1.1)
    aws-sdk-sqs (1.38.0)
      aws-sdk-core (~> 3, >= 3.112.0)
      aws-sigv4 (~> 1.1)
    aws-sdk-ssm (1.110.0)
      aws-sdk-core (~> 3, >= 3.112.0)
      aws-sigv4 (~> 1.1)
    aws-sigv4 (1.2.3)
      aws-eventstream (~> 1, >= 1.0.2)
    aws_config (0.1.0)
    builder (3.2.4)
    byebug (11.1.3)
    cfn-status (0.4.2)
      aws-sdk-cloudformation
    cfn_camelizer (0.4.9)
      activesupport
      memoist
      rainbow
    cfn_response (0.2.0)
    concurrent-ruby (1.1.8)
    crass (1.0.6)
    diff-lcs (1.4.4)
    dotenv (2.7.6)
    erubi (1.10.0)
    faraday (1.4.2)
      faraday-em_http (~> 1.0)
      faraday-em_synchrony (~> 1.0)
      faraday-excon (~> 1.1)
      faraday-net_http (~> 1.0)
      faraday-net_http_persistent (~> 1.1)
      multipart-post (>= 1.2, < 3)
      ruby2_keywords (>= 0.0.4)
    faraday-em_http (1.0.0)
    faraday-em_synchrony (1.0.0)
    faraday-excon (1.1.0)
    faraday-net_http (1.0.1)
    faraday-net_http_persistent (1.1.0)
    gems (1.2.0)
    globalid (0.4.2)
      activesupport (>= 4.2.0)
    hashie (4.1.0)
    i18n (1.8.10)
      concurrent-ruby (~> 1.0)
    jets (3.0.5)
      actionmailer (~> 6.1.0)
      actionpack (~> 6.1.0)
      actionview (~> 6.1.0)
      activerecord (~> 6.1.0)
      activesupport (~> 6.1.0)
      aws-mfa-secure (~> 0.4.0)
      aws-sdk-apigateway
      aws-sdk-cloudformation
      aws-sdk-cloudwatchlogs
      aws-sdk-dynamodb
      aws-sdk-kinesis
      aws-sdk-lambda
      aws-sdk-s3
      aws-sdk-sns
      aws-sdk-sqs
      aws-sdk-ssm
      cfn-status
      cfn_camelizer (~> 0.4.6)
      cfn_response
      dotenv
      gems
      hashie
      jets-html-sanitizer
      kramdown
      memoist
      mini_mime
      rack
      railties (~> 6.1.0)
      rainbow
      recursive-open-struct
      serverlessgems (~> 0.1.3)
      shotgun
      text-table
      thor
      zeitwerk
    jets-html-sanitizer (1.0.4)
      loofah (~> 2.2, >= 2.2.2)
    jmespath (1.4.0)
    kramdown (2.3.1)
      rexml
    loofah (2.9.1)
      crass (~> 1.0.2)
      nokogiri (>= 1.5.9)
    mail (2.7.1)
      mini_mime (>= 0.1.1)
    memoist (0.16.2)
    method_source (1.0.0)
    mini_mime (1.1.0)
    mini_portile2 (2.4.0)
    minitest (5.14.4)
    multipart-post (2.1.1)
    nokogiri (1.10.10)
      mini_portile2 (~> 2.4.0)
    pg (1.2.3)
    rack (2.2.3)
    rack-test (1.1.0)
      rack (>= 1.0, < 3)
    rails-dom-testing (2.0.3)
      activesupport (>= 4.2.0)
      nokogiri (>= 1.6)
    rails-html-sanitizer (1.3.0)
      loofah (~> 2.3)
    railties (6.1.3.2)
      actionpack (= 6.1.3.2)
      activesupport (= 6.1.3.2)
      method_source
      rake (>= 0.8.7)
      thor (~> 1.0)
    rainbow (3.0.0)
    rake (13.0.3)
    recursive-open-struct (1.1.3)
    rexml (3.2.5)
    rspec (3.10.0)
      rspec-core (~> 3.10.0)
      rspec-expectations (~> 3.10.0)
      rspec-mocks (~> 3.10.0)
    rspec-core (3.10.1)
      rspec-support (~> 3.10.0)
    rspec-expectations (3.10.1)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.10.0)
    rspec-mocks (3.10.2)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.10.0)
    rspec-support (3.10.2)
    ruby2_keywords (0.0.4)
    sentry-jets (0.4.1)
      sentry-raven
    sentry-raven (3.1.2)
      faraday (>= 1.0)
    sequel (5.44.0)
    serverlessgems (0.1.3)
      gems
      memoist
      zeitwerk
    shotgun (0.9.2)
      rack (>= 1.0)
    text-table (1.2.4)
    thor (1.1.0)
    tzinfo (2.0.4)
      concurrent-ruby (~> 1.0)
    zeitwerk (2.4.2)

PLATFORMS
  ruby

DEPENDENCIES
  activesupport
  byebug
  jets
  nokogiri (~> 1.10.0)
  pg
  rspec
  sentry-jets
  sequel

BUNDLED WITH
   2.2.17