Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while upgrading from v1.10.0 to 1.10.1 #150

Closed
Yoshyn opened this issue Oct 22, 2019 · 6 comments · Fixed by #151
Closed

Error while upgrading from v1.10.0 to 1.10.1 #150

Yoshyn opened this issue Oct 22, 2019 · 6 comments · Fixed by #151

Comments

@Yoshyn
Copy link

Yoshyn commented Oct 22, 2019

Environment :

  • Elixir (elixir -v):
Erlang/OTP 20 [erts-9.3.3.11] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:10] [hipe] [kernel-poll:false]

Elixir 1.8.2 (compiled with Erlang/OTP 20)

Describe the bug

Error while upgrading from v1.10.0 to 1.10.1 with a minimal configuration (just the minimal on the readme) without changing anything except the following :

Changes :

  1. Before update :
  defp deps do
    [{...,
     {:new_relic_agent, "~> 1.10"},
     {:new_relic_phoenix, "~> 0.2"},
   ]
  end
  • Agent version (mix deps | grep new_relic_agent):
* new_relic_agent (Hex package) (mix)
  locked at 1.10.0 (new_relic_agent) 008a074a
  1. After update :
  defp deps do
    [{...,
     {:new_relic_agent, "== 1.10.1"},
     {:new_relic_phoenix, "~> 0.2"},
   ]
  end
  • Agent version (mix deps | grep new_relic_agent):
* new_relic_agent (Hex package) (mix)
  locked at 1.10.1 (new_relic_agent) e200b5d2

Generate the following error :

[error] GenServer NewRelic.Harvest.Collector.Metric.HarvestCycle terminating
** (ArgumentError) argument error
    (stdlib) :ets.lookup(NewRelic.Harvest.Collector.AgentRun, :data_report_period)
    (new_relic_agent) lib/new_relic/harvest/collector/agent_run.ex:108: NewRelic.Harvest.Collector.AgentRun.lookup/1
    (new_relic_agent) lib/new_relic/harvest/collector/harvest_cycle.ex:124: NewRelic.Harvest.Collector.HarvestCycle.trigger_
harvest_cycle/1
    (new_relic_agent) lib/new_relic/harvest/collector/harvest_cycle.ex:63: NewRelic.Harvest.Collector.HarvestCycle.handle_in
fo/2
    (stdlib) gen_server.erl:616: :gen_server.try_dispatch/4
    (stdlib) gen_server.erl:686: :gen_server.handle_msg/6
    (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
Last message: :harvest_cycle
State: %{harvest_cycle_key: :data_report_period, harvester: nil, name: NewRelic.Harvest.Collector.Metric.HarvestCycle, super
visor: NewRelic.Harvest.Collector.Metric.HarvesterSupervisor, timer: nil}
[warn] Logger dropped 180 OTP/SASL messages as it had 555 messages in its inbox, exceeding the amount of :discard_threshold
500 messages. The number of messages was reduced to 375 (75% of the threshold)

Any ideas ?
Can it be related to #138 ?

@Yoshyn
Copy link
Author

Yoshyn commented Oct 22, 2019

As the versions has several commits, I tried to check by commit individually :

{:new_relic_agent, github: "newrelic/elixir_agent", ref: "ref_of_the_commit", override: true},

And the error occur at b742e39

So my it's not related to OTP (#138). I'll check to get a better understanding on what happen.

From the console :

iex(0)>NewRelic.Config.enabled?()
false
iex(1)>payload = NewRelic.Harvest.Collector.Connect.payload()
iex(2)>NewRelic.Harvest.Collector.Protocol.connect(payload)
{:error, :harvest_disabled}

Seem that this error is not handle

@binaryseed
Copy link
Collaborator

Thanks, I'll take a look today

@binaryseed
Copy link
Collaborator

Hi, I was able to reproduce this by running against OTP 20.

It's caused because AgentRun leverages handle_continue which was added to GenServer in OTP 21. In 20 that GenServer can't boot so the ETS table doesn't get created so trying to access it causes a crash...

I'll see what I can do to get the OTP version requirements front and center so this can't happen...

Can you upgrade your OTP version?

@binaryseed
Copy link
Collaborator

This PR will raise a helpful error if the app is started pre OTP 21 #151

@Yoshyn
Copy link
Author

Yoshyn commented Oct 22, 2019

Thank you. I get a better understanding now. I wondering what was the handle_continue.
And the error was not clear. It's clearly better !

Can you upgrade your OTP version?

😱 😢 😨 I'm afraid but this will not be possible in my case.

I'll try to find an alternative solution (maybe fork the gem and reimplement the AgentRun to OTP 20).

@Yoshyn Yoshyn closed this as completed Oct 24, 2019
@binaryseed
Copy link
Collaborator

FYI, the upcoming Elixir 1.10 release will also be OTP 21+ only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants