{"action":"created","issue":{"url":"https://api.github.com/repos/jordansissel/ruby-filewatch/issues/76","repository_url":"https://api.github.com/repos/jordansissel/ruby-filewatch","labels_url":"https://api.github.com/repos/jordansissel/ruby-filewatch/issues/76/labels{/name}","comments_url":"https://api.github.com/repos/jordansissel/ruby-filewatch/issues/76/comments","events_url":"https://api.github.com/repos/jordansissel/ruby-filewatch/issues/76/events","html_url":"https://github.com/jordansissel/ruby-filewatch/issues/76","id":133821586,"number":76,"title":"Tail.rb self.new_observing initialization issue","user":{"login":"bdanziger","id":1305961,"avatar_url":"https://avatars.githubusercontent.com/u/1305961?v=3","gravatar_id":"","url":"https://api.github.com/users/bdanziger","html_url":"https://github.com/bdanziger","followers_url":"https://api.github.com/users/bdanziger/followers","following_url":"https://api.github.com/users/bdanziger/following{/other_user}","gists_url":"https://api.github.com/users/bdanziger/gists{/gist_id}","starred_url":"https://api.github.com/users/bdanziger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bdanziger/subscriptions","organizations_url":"https://api.github.com/users/bdanziger/orgs","repos_url":"https://api.github.com/users/bdanziger/repos","events_url":"https://api.github.com/users/bdanziger/events{/privacy}","received_events_url":"https://api.github.com/users/bdanziger/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-02-15T21:29:33Z","updated_at":"2016-02-17T04:24:56Z","closed_at":null,"body":"Unless I do not understand what is happening in tail.rb I believe there is a bug when creating a new Tail object when using self.new_observing from file.rb.  For the new.tap code in tail.rb below, it is creating a new Tail object and calls the initialization method that is in this file.  If I understand the code correctly, it will be overriding the instance.target from (YieldingTail)  but regardless, the initialization from the tap.new does not pass in the opts arguments.  So, initialization receives no opts args.  Then,  YieldingTail.new(opts) passes in no opts args.  Then in turn tail_base.rb initialization receives no opts args.  \r\n\r\nYou might ask, why is this an issue if YieldingTail just gets overwritten.  \r\nI set my sincedb_path config for file.rb\r\nIn tail_base.rb, since it receives no opts, it never sees my sincedb_path config value.  I am now forced to set HOME or SINCEDB_DIR environment variables because it is not seeing that I passed in a sincedb_path option in the opts.\r\n**************************\r\nThis is the code that causes this : \r\nwhen using : \r\n   new.tap do | instance |\r\n      instance.target = ObservingTail.new(opts)\r\n   end\r\n***************************\r\n\r\nBelow, I show a simple fix : \r\nnew(opts).tap should be used instead of new.tap\r\n\r\nso, it would be \r\n\r\nnew(opts).tap do | instance |\r\n      instance.target = ObservingTail.new(opts)\r\n   end\r\n\r\nThis code now properly passes in my opts, and I never need to set ENV HOME or SINCEDB_DIR since I am already setting it as a file config parameter.\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/jordansissel/ruby-filewatch/issues/comments/185014527","html_url":"https://github.com/jordansissel/ruby-filewatch/issues/76#issuecomment-185014527","issue_url":"https://api.github.com/repos/jordansissel/ruby-filewatch/issues/76","id":185014527,"user":{"login":"guyboertje","id":84912,"avatar_url":"https://avatars.githubusercontent.com/u/84912?v=3","gravatar_id":"","url":"https://api.github.com/users/guyboertje","html_url":"https://github.com/guyboertje","followers_url":"https://api.github.com/users/guyboertje/followers","following_url":"https://api.github.com/users/guyboertje/following{/other_user}","gists_url":"https://api.github.com/users/guyboertje/gists{/gist_id}","starred_url":"https://api.github.com/users/guyboertje/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guyboertje/subscriptions","organizations_url":"https://api.github.com/users/guyboertje/orgs","repos_url":"https://api.github.com/users/guyboertje/repos","events_url":"https://api.github.com/users/guyboertje/events{/privacy}","received_events_url":"https://api.github.com/users/guyboertje/received_events","type":"User","site_admin":false},"created_at":"2016-02-17T04:24:56Z","updated_at":"2016-02-17T04:24:56Z","body":"@bdanziger - I see now. The problem is when the redundant YieldingTail is created with empty opts. None of the Logstash team have noticed this bug before - we must all have HOME set. As I said before the real problem is creating a YieldingTail object and then immediately throwing it away.\r\n\r\nPlease accept my apologies, I will fix this. In the meantime can you set HOME to a valid path.\r\n\r\nI will need to release a new version of the file input."}}