# Error installing ElasticSearch instance using systemd \`scan' for :absent:Symbol

**URL:** <https://discuss.elastic.co/t/error-installing-elasticsearch-instance-using-systemd-scan-for-symbol/164220>\
**Category:** Elasticsearch\
**Created:** [January 15, 2019, 1:52am UTC](https://discuss.elastic.co/t/error-installing-elasticsearch-instance-using-systemd-scan-for-symbol/164220 "2019-01-15T01:52:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![styriver](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@styriver](https://discuss.elastic.co/u/styriver)\
**Post date:** [January 15, 2019, 1:52am UTC](https://discuss.elastic.co/t/error-installing-elasticsearch-instance-using-systemd-scan-for-symbol/164220/1 "2019-01-15T01:52:05Z")

</div>

Hi this is our initial deployment creating an elastic search instance and installing via Puppet we are seeing this error.

2019-01-1415:26 -06:00 err Could not evaluate: undefined method `scan' for :absent:Symbol  
Source: /Stage[main]/xxxx\_elastic\_stack::Search/Elasticsearch::Instance[es-01]/Elasticsearch::Service[es-01]/Elasticsearch::Service::Systemd[es-01]/Elasticsearch\_service\_file[/lib/systemd/system/elasticsearch-es-01.service]  
File:/etc/puppetlabs/code/environments/sandbox/modules/elasticsearch/manifests/service/systemd.pp  
Line: 163

2019-01-1415:26 -06:00 warning Skipping because of failed dependencies  
Source: /Stage[main]/xxxx\_elastic\_stack::Search/Elasticsearch::Instance[es-01]/Elasticsearch::Service[es-01]/Elasticsearch::Service::Systemd[es-01]/File[/lib/systemd/system/elasticsearch-es-01.service]  
File:/etc/puppetlabs/code/environments/sandbox/modules/elasticsearch/manifests/service/systemd.pp  
Line: 178

Current versions:  
Puppet Forge Elastic Search - Tagged Version 6.3.3  
Puppet Version - 5.3.3  
OS - RedHat 7.6  
Elastic Search RMP Package - 6.5.4  
puppet-elastic-stack.git - 6.2.4  
puppet-datacat.git - tag 0.6.2

Code:

```
class xxxx_elastic_stack::search (
  String $version = '6.5.4',
  String $instance_name = 'es-instance1',
  String $cluster_name = 'elastic-git',
  String $network_host = '127.0.0.1',
  Array[String] $jvm_heap_memory = ['-xms8g','-Xmx8g'],
  Enum['absent', 'present'] $ensure = 'present',
  String $pkg_version = '6.5.4',
  String $local_pkg_loc = "/home/packages/elastic_stack/${pkg_version}",
  String $pkg_prefix = 'elasticsearch',
  String $download_tool_insecure = 'curl --insecure --output',
  Boolean $download_tool_verify_certificates = false,
  ) {
    $rpm_pkg_name = "${pkg_prefix}-${pkg_version}.rpm"

    class { 'elasticsearch':
      ensure => $ensure,
      package_dir => $local_pkg_loc,
      package_name => $rpm_pkg_name,
      package_url => "https://xxxx.xxxxint.net/xxxx/xxxx-repo/elastic-stack/${pkg_version}/${rpm_pkg_name}",
      download_tool_insecure => $download_tool_insecure,
      download_tool_verify_certificates => $download_tool_verify_certificates,
    }-> elasticsearch::instance { $instance_name :
      #ensure => $ensure,
      #jvm_options => $jvm_heap_memory,
      #config => {
        #'cluster.name' => $cluster_name,
        #'network.host' => $network_host,
      }
    }
```

---

<div class="post-metadata">

**Author:** ![styriver](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@styriver](https://discuss.elastic.co/u/styriver)\
**Post date:** [January 15, 2019, 4:25pm UTC](https://discuss.elastic.co/t/error-installing-elasticsearch-instance-using-systemd-scan-for-symbol/164220/2 "2019-01-15T16:25:48Z")

</div>

I found out a bit more information. This appears to be an issue with major and minor versioning. I ran a puppet apply in trace mode and got this stack trace.

```
Could not evaluate: undefined method `scan' for :absent:Symbol /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/package.rb:4:in `versioncmp'
 /opt/puppetlabs/puppet/cache/lib/puppet_x/elastic/es_versioning.rb:46:in `min_version'
 /opt/puppetlabs/puppet/cache/lib/puppet_x/elastic/es_versioning.rb:20:in `opt_flags' 
 /opt/puppetlabs/puppet/cache/lib/puppet/provider/elasticsearch_service_file/ruby.rb:66:in `flush' 
 /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type.rb:1006:in `flush'
```

---

<div class="post-metadata">

**Author:** ![tylerjl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tylerjl/32/44965_2.png) [@tylerjl](https://discuss.elastic.co/u/tylerjl)\
**Post date:** [January 16, 2019, 7:25pm UTC](https://discuss.elastic.co/t/error-installing-elasticsearch-instance-using-systemd-scan-for-symbol/164220/3 "2019-01-16T19:25:06Z")

</div>

@styriver when the catalog ran (and when you actually instantiate your `elastic_stack::search` class, is the Elasticsearch package actually being installed/set to `present`? It looks like the version logic in the code is trying to compare versions with `:absent` at some point.

---

<div class="post-metadata">

**Author:** ![styriver](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@styriver](https://discuss.elastic.co/u/styriver)\
**Post date:** [January 16, 2019, 7:41pm UTC](https://discuss.elastic.co/t/error-installing-elasticsearch-instance-using-systemd-scan-for-symbol/164220/4 "2019-01-16T19:41:37Z")

</div>

Hi

Thank you for the response. I figured it out this morning. When I am building this string I am appending the .rpm  
`$rpm_pkg_name = "${pkg_prefix}-${pkg_version}.rpm"`

This was causing the versions to not be inferred correctly. The code is using regex to get the package versions. Once I removed the .rpm from that string and just addedthe .rpm to the end of the package url it worked.

Thanks for your time on this issue.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 13, 2019, 7:52pm UTC](https://discuss.elastic.co/t/error-installing-elasticsearch-instance-using-systemd-scan-for-symbol/164220/5 "2019-02-13T19:52:17Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
