dawarich icon indicating copy to clipboard operation
dawarich copied to clipboard

Error suggesting visits

Open AlexNathan345 opened this issue 1 year ago • 31 comments

Today I got this notification titled "Error suggesting visits":

Error suggesting visits: PG::InternalError: ERROR: parse error - invalid geometry HINT: "SRID=4326;POINT( )" <-- parse error at position 19 within geometry /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:162:in 'PG::Connection#exec_params' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:162:in 'ActiveRecord::ConnectionAdapters::PostgreSQL::DatabaseStatements#perform_query' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:556:in 'block (2 levels) in ActiveRecord::ConnectionAdapters::DatabaseStatements#raw_execute' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract_adapter.rb:1011:in 'block in ActiveRecord::ConnectionAdapters::AbstractAdapter#with_raw_connection' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/concurrency/null_lock.rb:9:in 'ActiveSupport::Concurrency::NullLock#synchronize' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract_adapter.rb:983:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#with_raw_connection' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:555:in 'block in ActiveRecord::ConnectionAdapters::DatabaseStatements#raw_execute' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/notifications/instrumenter.rb:58:in 'ActiveSupport::Notifications::Instrumenter#instrument' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract_adapter.rb:1129:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#log' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:554:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#raw_execute' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:591:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#internal_execute' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:547:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#internal_exec_query' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:693:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#select' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:73:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#select_all' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract/query_cache.rb:248:in 'block in ActiveRecord::ConnectionAdapters::QueryCache#select_all' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract/query_cache.rb:286:in 'block (2 levels) in ActiveRecord::ConnectionAdapters::QueryCache#cache_sql' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract/query_cache.rb:80:in 'ActiveRecord::ConnectionAdapters::QueryCache::Store#compute_if_absent' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract/query_cache.rb:284:in 'block in ActiveRecord::ConnectionAdapters::QueryCache#cache_sql' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/concurrency/null_lock.rb:9:in 'ActiveSupport::Concurrency::NullLock#synchronize' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract/query_cache.rb:283:in 'ActiveRecord::ConnectionAdapters::QueryCache#cache_sql' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract/query_cache.rb:248:in 'ActiveRecord::ConnectionAdapters::QueryCache#select_all' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/querying.rb:68:in 'ActiveRecord::Querying#_query_by_sql' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/relation.rb:1449:in 'block (2 levels) in ActiveRecord::Relation#exec_main_query' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:412:in 'ActiveRecord::ConnectionAdapters::ConnectionPool#with_connection' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_handling.rb:310:in 'ActiveRecord::ConnectionHandling#with_connection' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/relation.rb:1448:in 'block in ActiveRecord::Relation#exec_main_query' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/relation.rb:1470:in 'ActiveRecord::Relation#skip_query_cache_if_necessary' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/relation.rb:1432:in 'ActiveRecord::Relation#exec_main_query' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/relation.rb:1410:in 'block in ActiveRecord::Relation#exec_queries' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/relation.rb:1470:in 'ActiveRecord::Relation#skip_query_cache_if_necessary' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/relation.rb:1404:in 'ActiveRecord::Relation#exec_queries' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/relation.rb:1181:in 'ActiveRecord::Relation#load' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/relation.rb:343:in 'ActiveRecord::Relation#records' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/relation.rb:338:in 'ActiveRecord::Relation#to_ary' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/relation/finder_methods.rb:615:in 'ActiveRecord::FinderMethods#find_nth_with_limit' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/relation/finder_methods.rb:600:in 'ActiveRecord::FinderMethods#find_nth' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/relation/finder_methods.rb:177:in 'ActiveRecord::FinderMethods#first' /var/app/app/services/visits/place_finder.rb:121:in 'Visits::PlaceFinder#create_place_from_point' /var/app/app/services/visits/place_finder.rb:100:in 'block in Visits::PlaceFinder#extract_places_from_points' /var/app/app/services/visits/place_finder.rb:99:in 'Array#each' /var/app/app/services/visits/place_finder.rb:99:in 'Visits::PlaceFinder#extract_places_from_points' /var/app/app/services/visits/place_finder.rb:67:in 'Visits::PlaceFinder#collect_potential_places' /var/app/app/services/visits/place_finder.rb:31:in 'Visits::PlaceFinder#find_or_create_place' /var/app/app/services/visits/creator.rb:24:in 'block (2 levels) in Visits::Creator#create_visits' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract/transaction.rb:626:in 'block in ActiveRecord::ConnectionAdapters::TransactionManager#within_new_transaction' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/concurrency/null_lock.rb:9:in 'ActiveSupport::Concurrency::NullLock#synchronize' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract/transaction.rb:623:in 'ActiveRecord::ConnectionAdapters::TransactionManager#within_new_transaction' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:367:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#within_new_transaction' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:359:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#transaction' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/transactions.rb:234:in 'block in ActiveRecord::Transactions::ClassMethods#transaction' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:418:in 'ActiveRecord::ConnectionAdapters::ConnectionPool#with_connection' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_handling.rb:310:in 'ActiveRecord::ConnectionHandling#with_connection' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/transactions.rb:233:in 'ActiveRecord::Transactions::ClassMethods#transaction' /var/app/app/services/visits/creator.rb:19:in 'block in Visits::Creator#create_visits' /var/app/app/services/visits/creator.rb:13:in 'Array#map' /var/app/app/services/visits/creator.rb:13:in 'Visits::Creator#create_visits' /var/app/app/services/visits/smart_detect.rb:28:in 'Visits::SmartDetect#call' /var/app/app/services/visits/suggest.rb:16:in 'Visits::Suggest#call' /var/app/app/jobs/visit_suggesting_job.rb:18:in 'VisitSuggestingJob#perform' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.1/lib/active_job/execution.rb:68:in 'block in ActiveJob::Execution#_perform_job' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/callbacks.rb:120:in 'block in ActiveSupport::Callbacks#run_callbacks' /var/app/vendor/bundle/ruby/3.4.0/gems/i18n-1.14.7/lib/i18n.rb:353:in 'I18n::Base#with_locale' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.1/lib/active_job/translation.rb:9:in 'block (2 levels) in ' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/callbacks.rb:129:in 'BasicObject#instance_exec' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/callbacks.rb:129:in 'block in ActiveSupport::Callbacks#run_callbacks' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/core_ext/time/zones.rb:65:in 'Time.use_zone' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.1/lib/active_job/timezones.rb:9:in 'block (2 levels) in ' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/callbacks.rb:129:in 'BasicObject#instance_exec' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/callbacks.rb:129:in 'block in ActiveSupport::Callbacks#run_callbacks' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/callbacks.rb:140:in 'ActiveSupport::Callbacks#run_callbacks' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.1/lib/active_job/execution.rb:67:in 'ActiveJob::Execution#_perform_job' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.1/lib/active_job/instrumentation.rb:32:in 'ActiveJob::Instrumentation#_perform_job' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.1/lib/active_job/execution.rb:51:in 'ActiveJob::Execution#perform_now' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.1/lib/active_job/instrumentation.rb:26:in 'block in ActiveJob::Instrumentation#perform_now' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/railties/job_runtime.rb:13:in 'block in ActiveRecord::Railties::JobRuntime#instrument' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.1/lib/active_job/instrumentation.rb:40:in 'block in ActiveJob::Instrumentation#instrument' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/notifications.rb:210:in 'block in ActiveSupport::Notifications.instrument' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/notifications/instrumenter.rb:58:in 'ActiveSupport::Notifications::Instrumenter#instrument' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/notifications.rb:210:in 'ActiveSupport::Notifications.instrument' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.1/lib/active_job/instrumentation.rb:39:in 'ActiveJob::Instrumentation#instrument' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/railties/job_runtime.rb:11:in 'ActiveRecord::Railties::JobRuntime#instrument' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.1/lib/active_job/instrumentation.rb:26:in 'ActiveJob::Instrumentation#perform_now' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.1/lib/active_job/logging.rb:32:in 'block in ActiveJob::Logging#perform_now' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.1/lib/active_job/logging.rb:41:in 'ActiveJob::Logging#tag_logger' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.1/lib/active_job/logging.rb:32:in 'ActiveJob::Logging#perform_now' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.1/lib/active_job/execution.rb:29:in 'block in ActiveJob::Execution::ClassMethods#execute' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/callbacks.rb:120:in 'block in ActiveSupport::Callbacks#run_callbacks' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.1/lib/active_job/railtie.rb:95:in 'block (4 levels) in ' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/reloader.rb:77:in 'block in ActiveSupport::Reloader.wrap' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/execution_wrapper.rb:87:in 'ActiveSupport::ExecutionWrapper.wrap' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/reloader.rb:74:in 'ActiveSupport::Reloader.wrap' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.1/lib/active_job/railtie.rb:94:in 'block (3 levels) in ' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/callbacks.rb:129:in 'BasicObject#instance_exec' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/callbacks.rb:129:in 'block in ActiveSupport::Callbacks#run_callbacks' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/callbacks.rb:140:in 'ActiveSupport::Callbacks#run_callbacks' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.1/lib/active_job/execution.rb:27:in 'ActiveJob::Execution::ClassMethods#execute' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/rails.rb:13:in 'Sidekiq::ActiveJob::Wrapper#perform' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:220:in 'Sidekiq::Processor#execute_job' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:185:in 'block (4 levels) in Sidekiq::Processor#process' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/middleware/chain.rb:180:in 'Sidekiq::Middleware::Chain#traverse' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/middleware/chain.rb:183:in 'block in Sidekiq::Middleware::Chain#traverse' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/job/interrupt_handler.rb:9:in 'Sidekiq::Job::InterruptHandler#call' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/middleware/chain.rb:182:in 'Sidekiq::Middleware::Chain#traverse' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/middleware/chain.rb:183:in 'block in Sidekiq::Middleware::Chain#traverse' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/metrics/tracking.rb:26:in 'Sidekiq::Metrics::ExecutionTracker#track' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/metrics/tracking.rb:134:in 'Sidekiq::Metrics::Middleware#call' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/middleware/chain.rb:182:in 'Sidekiq::Middleware::Chain#traverse' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/middleware/chain.rb:173:in 'Sidekiq::Middleware::Chain#invoke' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:184:in 'block (3 levels) in Sidekiq::Processor#process' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:145:in 'block (6 levels) in Sidekiq::Processor#dispatch' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/job_retry.rb:118:in 'Sidekiq::JobRetry#local' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:144:in 'block (5 levels) in Sidekiq::Processor#dispatch' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/rails.rb:27:in 'block in Sidekiq::Rails::Reloader#call' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/reloader.rb:77:in 'block in ActiveSupport::Reloader.wrap' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/execution_wrapper.rb:91:in 'ActiveSupport::ExecutionWrapper.wrap' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/reloader.rb:74:in 'ActiveSupport::Reloader.wrap' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/rails.rb:26:in 'Sidekiq::Rails::Reloader#call' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:139:in 'block (4 levels) in Sidekiq::Processor#dispatch' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:281:in 'Sidekiq::Processor#stats' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:134:in 'block (3 levels) in Sidekiq::Processor#dispatch' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/job_logger.rb:15:in 'Sidekiq::JobLogger#call' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:133:in 'block (2 levels) in Sidekiq::Processor#dispatch' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/job_retry.rb:85:in 'Sidekiq::JobRetry#global' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:132:in 'block in Sidekiq::Processor#dispatch' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/job_logger.rb:40:in 'Sidekiq::JobLogger#prepare' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:131:in 'Sidekiq::Processor#dispatch' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:183:in 'block (2 levels) in Sidekiq::Processor#process' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:182:in 'Thread.handle_interrupt' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:182:in 'block in Sidekiq::Processor#process' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:181:in 'Thread.handle_interrupt' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:181:in 'Sidekiq::Processor#process' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:86:in 'Sidekiq::Processor#process_one' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:76:in 'Sidekiq::Processor#run' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/component.rb:10:in 'Sidekiq::Component#watchdog' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/component.rb:19:in 'block in Sidekiq::Component#safe_thread'

What can I do? Also, my "Places and visits" is always empty, meaning I never get any suggestions for visits. Is this normal? How can I fix this? I'm on v0.25.3. Thanks very much for your help.

AlexNathan345 avatar Mar 25 '25 08:03 AlexNathan345

Seeing the same on my end.

Bestivus avatar Mar 25 '25 13:03 Bestivus

Me too.

schoebelh avatar Mar 25 '25 15:03 schoebelh

Same.

shaman007 avatar Mar 25 '25 15:03 shaman007

same

lexinger avatar Mar 26 '25 03:03 lexinger

Same here :/

Rudi1977 avatar Mar 26 '25 05:03 Rudi1977

same

applesoff avatar Mar 29 '25 21:03 applesoff

same

tttuntcloud avatar Mar 30 '25 09:03 tttuntcloud

I hope this makes it a bit more readable.

        Error suggesting visits: PG::InternalError: ERROR:  parse error - invalid geometry
HINT:  "SRID=4326;POINT( )" &lt;-- parse error at position 19 within geometry

/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:162:in 'PG::Connection#exec_params'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:162:in 'ActiveRecord::ConnectionAdapters::PostgreSQL::DatabaseStatements#perform_query'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:556:in 'block (2 levels) in ActiveRecord::ConnectionAdapters::DatabaseStatements#raw_execute'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract_adapter.rb:1011:in 'block in ActiveRecord::ConnectionAdapters::AbstractAdapter#with_raw_connection'
/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/concurrency/null_lock.rb:9:in 'ActiveSupport::Concurrency::NullLock#synchronize'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract_adapter.rb:983:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#with_raw_connection'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:555:in 'block in ActiveRecord::ConnectionAdapters::DatabaseStatements#raw_execute'
/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/notifications/instrumenter.rb:58:in 'ActiveSupport::Notifications::Instrumenter#instrument'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract_adapter.rb:1129:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#log'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:554:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#raw_execute'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:591:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#internal_execute'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:547:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#internal_exec_query'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:693:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#select'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:73:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#select_all'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract/query_cache.rb:248:in 'block in ActiveRecord::ConnectionAdapters::QueryCache#select_all'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract/query_cache.rb:286:in 'block (2 levels) in ActiveRecord::ConnectionAdapters::QueryCache#cache_sql'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract/query_cache.rb:80:in 'ActiveRecord::ConnectionAdapters::QueryCache::Store#compute_if_absent'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract/query_cache.rb:284:in 'block in ActiveRecord::ConnectionAdapters::QueryCache#cache_sql'
/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/concurrency/null_lock.rb:9:in 'ActiveSupport::Concurrency::NullLock#synchronize'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract/query_cache.rb:283:in 'ActiveRecord::ConnectionAdapters::QueryCache#cache_sql'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract/query_cache.rb:248:in 'ActiveRecord::ConnectionAdapters::QueryCache#select_all'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/querying.rb:68:in 'ActiveRecord::Querying#_query_by_sql'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/relation.rb:1449:in 'block (2 levels) in ActiveRecord::Relation#exec_main_query'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:412:in 'ActiveRecord::ConnectionAdapters::ConnectionPool#with_connection'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_handling.rb:310:in 'ActiveRecord::ConnectionHandling#with_connection'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/relation.rb:1448:in 'block in ActiveRecord::Relation#exec_main_query'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/relation.rb:1470:in 'ActiveRecord::Relation#skip_query_cache_if_necessary'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/relation.rb:1432:in 'ActiveRecord::Relation#exec_main_query'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/relation.rb:1410:in 'block in ActiveRecord::Relation#exec_queries'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/relation.rb:1470:in 'ActiveRecord::Relation#skip_query_cache_if_necessary'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/relation.rb:1404:in 'ActiveRecord::Relation#exec_queries'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/relation.rb:1181:in 'ActiveRecord::Relation#load'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/relation.rb:343:in 'ActiveRecord::Relation#records'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/relation.rb:338:in 'ActiveRecord::Relation#to_ary'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/relation/finder_methods.rb:615:in 'ActiveRecord::FinderMethods#find_nth_with_limit'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/relation/finder_methods.rb:600:in 'ActiveRecord::FinderMethods#find_nth'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/relation/finder_methods.rb:177:in 'ActiveRecord::FinderMethods#first'
/var/app/app/services/visits/place_finder.rb:121:in 'Visits::PlaceFinder#create_place_from_point'
/var/app/app/services/visits/place_finder.rb:100:in 'block in Visits::PlaceFinder#extract_places_from_points'
/var/app/app/services/visits/place_finder.rb:99:in 'Array#each'
/var/app/app/services/visits/place_finder.rb:99:in 'Visits::PlaceFinder#extract_places_from_points'
/var/app/app/services/visits/place_finder.rb:67:in 'Visits::PlaceFinder#collect_potential_places'
/var/app/app/services/visits/place_finder.rb:31:in 'Visits::PlaceFinder#find_or_create_place'
/var/app/app/services/visits/creator.rb:24:in 'block (2 levels) in Visits::Creator#create_visits'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract/transaction.rb:626:in 'block in ActiveRecord::ConnectionAdapters::TransactionManager#within_new_transaction'
/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/concurrency/null_lock.rb:9:in 'ActiveSupport::Concurrency::NullLock#synchronize'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract/transaction.rb:623:in 'ActiveRecord::ConnectionAdapters::TransactionManager#within_new_transaction'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:367:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#within_new_transaction'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:359:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#transaction'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/transactions.rb:234:in 'block in ActiveRecord::Transactions::ClassMethods#transaction'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:418:in 'ActiveRecord::ConnectionAdapters::ConnectionPool#with_connection'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_handling.rb:310:in 'ActiveRecord::ConnectionHandling#with_connection'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/transactions.rb:233:in 'ActiveRecord::Transactions::ClassMethods#transaction'
/var/app/app/services/visits/creator.rb:19:in 'block in Visits::Creator#create_visits'
/var/app/app/services/visits/creator.rb:13:in 'Array#map'
/var/app/app/services/visits/creator.rb:13:in 'Visits::Creator#create_visits'
/var/app/app/services/visits/smart_detect.rb:28:in 'Visits::SmartDetect#call'
/var/app/app/services/visits/suggest.rb:16:in 'Visits::Suggest#call'
/var/app/app/jobs/visit_suggesting_job.rb:18:in 'VisitSuggestingJob#perform'
/var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.1/lib/active_job/execution.rb:68:in 'block in ActiveJob::Execution#_perform_job'
/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/callbacks.rb:120:in 'block in ActiveSupport::Callbacks#run_callbacks'
/var/app/vendor/bundle/ruby/3.4.0/gems/i18n-1.14.7/lib/i18n.rb:353:in 'I18n::Base#with_locale'
/var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.1/lib/active_job/translation.rb:9:in 'block (2 levels) in <module:translation>'
/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/callbacks.rb:129:in 'BasicObject#instance_exec'
/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/callbacks.rb:129:in 'block in ActiveSupport::Callbacks#run_callbacks'
/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/core_ext/time/zones.rb:65:in 'Time.use_zone'
/var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.1/lib/active_job/timezones.rb:9:in 'block (2 levels) in <module:timezones>'
/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/callbacks.rb:129:in 'BasicObject#instance_exec'
/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/callbacks.rb:129:in 'block in ActiveSupport::Callbacks#run_callbacks'
/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/callbacks.rb:140:in 'ActiveSupport::Callbacks#run_callbacks'
/var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.1/lib/active_job/execution.rb:67:in 'ActiveJob::Execution#_perform_job'
/var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.1/lib/active_job/instrumentation.rb:32:in 'ActiveJob::Instrumentation#_perform_job'
/var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.1/lib/active_job/execution.rb:51:in 'ActiveJob::Execution#perform_now'
/var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.1/lib/active_job/instrumentation.rb:26:in 'block in ActiveJob::Instrumentation#perform_now'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/railties/job_runtime.rb:13:in 'block in ActiveRecord::Railties::JobRuntime#instrument'
/var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.1/lib/active_job/instrumentation.rb:40:in 'block in ActiveJob::Instrumentation#instrument'
/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/notifications.rb:210:in 'block in ActiveSupport::Notifications.instrument'
/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/notifications/instrumenter.rb:58:in 'ActiveSupport::Notifications::Instrumenter#instrument'
/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/notifications.rb:210:in 'ActiveSupport::Notifications.instrument'
/var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.1/lib/active_job/instrumentation.rb:39:in 'ActiveJob::Instrumentation#instrument'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/railties/job_runtime.rb:11:in 'ActiveRecord::Railties::JobRuntime#instrument'
/var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.1/lib/active_job/instrumentation.rb:26:in 'ActiveJob::Instrumentation#perform_now'
/var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.1/lib/active_job/logging.rb:32:in 'block in ActiveJob::Logging#perform_now'
/var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.1/lib/active_job/logging.rb:41:in 'ActiveJob::Logging#tag_logger'
/var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.1/lib/active_job/logging.rb:32:in 'ActiveJob::Logging#perform_now'
/var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.1/lib/active_job/execution.rb:29:in 'block in ActiveJob::Execution::ClassMethods#execute'
/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/callbacks.rb:120:in 'block in ActiveSupport::Callbacks#run_callbacks'
/var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.1/lib/active_job/railtie.rb:95:in 'block (4 levels) in <class:railtie>'
/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/reloader.rb:77:in 'block in ActiveSupport::Reloader.wrap'
/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/execution_wrapper.rb:87:in 'ActiveSupport::ExecutionWrapper.wrap'
/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/reloader.rb:74:in 'ActiveSupport::Reloader.wrap'
/var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.1/lib/active_job/railtie.rb:94:in 'block (3 levels) in <class:railtie>'
/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/callbacks.rb:129:in 'BasicObject#instance_exec'
/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/callbacks.rb:129:in 'block in ActiveSupport::Callbacks#run_callbacks'
/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/callbacks.rb:140:in 'ActiveSupport::Callbacks#run_callbacks'
/var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.1/lib/active_job/execution.rb:27:in 'ActiveJob::Execution::ClassMethods#execute'
/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/rails.rb:13:in 'Sidekiq::ActiveJob::Wrapper#perform'
/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:220:in 'Sidekiq::Processor#execute_job'
/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:185:in 'block (4 levels) in Sidekiq::Processor#process'
/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/middleware/chain.rb:180:in 'Sidekiq::Middleware::Chain#traverse'
/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/middleware/chain.rb:183:in 'block in Sidekiq::Middleware::Chain#traverse'
/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/job/interrupt_handler.rb:9:in 'Sidekiq::Job::InterruptHandler#call'
/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/middleware/chain.rb:182:in 'Sidekiq::Middleware::Chain#traverse'
/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/middleware/chain.rb:183:in 'block in Sidekiq::Middleware::Chain#traverse'
/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/metrics/tracking.rb:26:in 'Sidekiq::Metrics::ExecutionTracker#track'
/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/metrics/tracking.rb:134:in 'Sidekiq::Metrics::Middleware#call'
/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/middleware/chain.rb:182:in 'Sidekiq::Middleware::Chain#traverse'
/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/middleware/chain.rb:173:in 'Sidekiq::Middleware::Chain#invoke'
/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:184:in 'block (3 levels) in Sidekiq::Processor#process'
/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:145:in 'block (6 levels) in Sidekiq::Processor#dispatch'
/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/job_retry.rb:118:in 'Sidekiq::JobRetry#local'
/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:144:in 'block (5 levels) in Sidekiq::Processor#dispatch'
/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/rails.rb:27:in 'block in Sidekiq::Rails::Reloader#call'
/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/reloader.rb:77:in 'block in ActiveSupport::Reloader.wrap'
/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/execution_wrapper.rb:91:in 'ActiveSupport::ExecutionWrapper.wrap'
/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/reloader.rb:74:in 'ActiveSupport::Reloader.wrap'
/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/rails.rb:26:in 'Sidekiq::Rails::Reloader#call'
/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:139:in 'block (4 levels) in Sidekiq::Processor#dispatch'
/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:281:in 'Sidekiq::Processor#stats'
/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:134:in 'block (3 levels) in Sidekiq::Processor#dispatch'
/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/job_logger.rb:15:in 'Sidekiq::JobLogger#call'
/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:133:in 'block (2 levels) in Sidekiq::Processor#dispatch'
/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/job_retry.rb:85:in 'Sidekiq::JobRetry#global'
/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:132:in 'block in Sidekiq::Processor#dispatch'
/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/job_logger.rb:40:in 'Sidekiq::JobLogger#prepare'
/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:131:in 'Sidekiq::Processor#dispatch'
/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:183:in 'block (2 levels) in Sidekiq::Processor#process'
/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:182:in 'Thread.handle_interrupt'
/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:182:in 'block in Sidekiq::Processor#process'
/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:181:in 'Thread.handle_interrupt'
/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:181:in 'Sidekiq::Processor#process'
/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:86:in 'Sidekiq::Processor#process_one'
/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:76:in 'Sidekiq::Processor#run'
/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/component.rb:10:in 'Sidekiq::Component#watchdog'
/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/component.rb:19:in 'block in Sidekiq::Component#safe_thread'

The only thing in the logs that stands out is from sidekiq:

dawarich_sidekiq  | D, [2025-04-01T22:05:08.905713 #129] DEBUG -- :   Place Load (1.7ms)  SELECT "places".* FROM "places" WHERE "places"."name" = $1 AND (ST_DWithin( lonlat::geography, ST_GeomFromEWKT('SRID=4326;POINT( )')::geography, 50 )) ORDER BY "places"."id" ASC LIMIT $2  [["name", "<REDACTED>"], ["LIMIT", 1]]
dawarich_sidekiq  | D, [2025-04-01T22:05:08.906222 #129] DEBUG -- :   ↳ app/services/visits/place_finder.rb:121:in 'Visits::PlaceFinder#create_place_from_point'
dawarich_sidekiq  | D, [2025-04-01T22:05:08.907081 #129] DEBUG -- :   TRANSACTION (0.1ms)  ROLLBACK
dawarich_sidekiq  | D, [2025-04-01T22:05:08.907673 #129] DEBUG -- :   ↳ app/services/visits/creator.rb:19:in 'block in Visits::Creator#create_visits'
dawarich_sidekiq  | D, [2025-04-01T22:05:09.171175 #129] DEBUG -- :   TRANSACTION (0.9ms)  BEGIN
dawarich_sidekiq  | D, [2025-04-01T22:05:09.172794 #129] DEBUG -- :   ↳ app/services/visits/suggest.rb:25:in 'Visits::Suggest#call'
dawarich_sidekiq  | D, [2025-04-01T22:05:09.309802 #129] DEBUG -- :   Notification Create (137.7ms)  INSERT INTO "notifications" ("title", "content", "user_id", "kind", "read_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"  [["title", "Error suggesting visits"], ["content", "Error suggesting visits: PG::InternalError: ERROR:  parse error - invalid geometry\nHINT:  \"SRID=4326;POINT( )\" [...]

I hope that helps.

thor-ondir avatar Apr 01 '25 22:04 thor-ondir

The error indicates that some points have lonlat attribute empty. I'll ask you all to check presence of such points in the points table, either via SQL, or the console:

Point.where(lonlat: nil).count

Freika avatar Apr 02 '25 22:04 Freika

Getting same invalid geometry error - running above command gives 0

DEBUG -- :   Point Count (12.7ms)  SELECT COUNT(*) FROM "points" WHERE "points"."lonlat" IS NULL
=> 0

kenkuo avatar Apr 02 '25 22:04 kenkuo

Same here:

/var/app # bin/rails console
[dotenv] Set DATABASE_PORT
[dotenv] Loaded .env.development
Loading development environment (Rails 8.0.1)
[1] pry(main)> Point.where(lonlat: nil).count
D, [2025-04-03T05:50:54.988155 #619643] DEBUG -- :   Point Count (3.8ms)  SELECT COUNT(*) FROM "points" WHERE "points"."lonlat" IS NULL
=> 0
[2] pry(main)> 

schoebelh avatar Apr 03 '25 05:04 schoebelh

同樣在這裡:

/var/app # bin/rails console
[dotenv] Set DATABASE_PORT
[dotenv] Loaded .env.development
Loading development environment (Rails 8.0.1)
[1] pry(main)> Point.where(lonlat: nil).count
D, [2025-04-03T05:50:54.988155 #619643] DEBUG -- :   Point Count (3.8ms)  SELECT COUNT(*) FROM "points" WHERE "points"."lonlat" IS NULL
=> 0
[2] pry(main)> 

same DEBUG -- : Point Count (11.5ms) SELECT COUNT(*) FROM "points" WHERE "points"."lonlat" IS NULL => 0

chen55487 avatar Apr 03 '25 12:04 chen55487

Same error here and no points with empty lonlat:

/var/app # bin/rails console
[dotenv] Set DATABASE_PORT
[dotenv] Loaded .env.development
Loading development environment (Rails 8.0.1)
[1] pry(main)> Point.where(lonlat: nil).count
D, [2025-04-04T17:25:04.255078 #479012] DEBUG -- :   Point Count (862.0ms)  SELECT COUNT(*) FROM "points" WHERE "points"."lonlat" IS NULL
=> 0

kevinior avatar Apr 04 '25 17:04 kevinior

Let's debug further. Try these:


points1 = Point.where("NOT ST_IsValid(lonlat) OR ST_AsText(lonlat) = 'POINT()'")
points1.count
points1.last(3)

points2 = Point.where("ST_AsText(lonlat) IS NULL OR ST_AsText(lonlat) = 'POINT( )'")
points2.count
points2.last(3)

If there are points with malformed lonlat attribute, it'll show the number of them and last 3 points, so we could see if they contain coordinates in lontigude, latitude and raw_data columns

Freika avatar Apr 09 '25 21:04 Freika

Ok. For the first action i got these:

[10] pry(main)> points1 = Point.where("NOT ST_IsValid(lonlat) OR ST_AsText(lonlat) = 'POINT()'")
D, [2025-04-10T05:35:16.722691 #150425] DEBUG -- :   Point Load (84.9ms)  SELECT "points".* FROM "points" WHERE (NOT ST_IsValid(lonlat) OR ST_AsText(lonlat) = 'POINT()') /* loading for pp */ LIMIT $1  [["LIMIT", 11]]
D, [2025-04-10T05:35:16.724560 #150425] DEBUG -- :   Point Load (0.7ms)  SELECT "points".* FROM "points" WHERE (NOT ST_IsValid(lonlat) OR ST_AsText(lonlat) = 'POINT()') /* loading for inspect */ LIMIT $1  [["LIMIT", 11]]
=> #<Point::ActiveRecord_Relation:0x26a0>
[11] pry(main)> points1.count
D, [2025-04-10T05:35:31.402030 #150425] DEBUG -- :   Point Count (1.0ms)  SELECT COUNT(*) FROM "points" WHERE (NOT ST_IsValid(lonlat) OR ST_AsText(lonlat) = 'POINT()')
ActiveRecord::StatementInvalid: PG::UndefinedFunction: ERROR:  function st_isvalid(geography) does not exist
LINE 1: SELECT COUNT(*) FROM "points" WHERE (NOT ST_IsValid(lonlat) ...
                                                 ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

from /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:160:in 'PG::Connection#exec'
Caused by PG::UndefinedFunction: ERROR:  function st_isvalid(geography) does not exist
LINE 1: SELECT COUNT(*) FROM "points" WHERE (NOT ST_IsValid(lonlat) ...
                                                 ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

from /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:160:in 'PG::Connection#exec'
[12] pry(main)> points1.last(3)
D, [2025-04-10T05:35:59.035680 #150425] DEBUG -- :   Point Load (0.7ms)  SELECT "points".* FROM "points" WHERE (NOT ST_IsValid(lonlat) OR ST_AsText(lonlat) = 'POINT()') ORDER BY "points"."id" DESC LIMIT $1  [["LIMIT", 3]]
ActiveRecord::StatementInvalid: PG::UndefinedFunction: ERROR:  function st_isvalid(geography) does not exist
LINE 1: SELECT "points".* FROM "points" WHERE (NOT ST_IsValid(lonlat...
                                                   ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

from /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:162:in 'PG::Connection#exec_params'
Caused by PG::UndefinedFunction: ERROR:  function st_isvalid(geography) does not exist
LINE 1: SELECT "points".* FROM "points" WHERE (NOT ST_IsValid(lonlat...
                                                   ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

from /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:162:in 'PG::Connection#exec_params'
[13] pry(main)> 

For the second:

[20] pry(main)> points2 = Point.where("ST_AsText(lonlat) IS NULL OR ST_AsText(lonlat) = 'POINT( )'")
D, [2025-04-10T05:39:02.111089 #150425] DEBUG -- :   Point Load (4775.4ms)  SELECT "points".* FROM "points" WHERE (ST_AsText(lonlat) IS NULL OR ST_AsText(lonlat) = 'POINT( )') /* loading for pp */ LIMIT $1  [["LIMIT", 11]]
=> []
[21] pry(main)> points2.count
D, [2025-04-10T05:39:14.791351 #150425] DEBUG -- :   Point Count (1529.7ms)  SELECT COUNT(*) FROM "points" WHERE (ST_AsText(lonlat) IS NULL OR ST_AsText(lonlat) = 'POINT( )')
=> 0
[22] pry(main)> points2.last(3)
D, [2025-04-10T05:39:39.830961 #150425] DEBUG -- :   Point Load (12816.4ms)  SELECT "points".* FROM "points" WHERE (ST_AsText(lonlat) IS NULL OR ST_AsText(lonlat) = 'POINT( )') ORDER BY "points"."id" DESC LIMIT $1  [["LIMIT", 3]]
=> []
[23] pry(main)> 

schoebelh avatar Apr 10 '25 05:04 schoebelh

i try

`[1] pry(main)> points1 = Point.where("NOT ST_IsValid(lonlat) OR ST_AsText(lonlat) = 'POINT()'")

D, [2025-04-10T11:19:09.703155 #241136] DEBUG -- : Point Load (109.5ms) SELECT "points".* FROM "points" WHERE (NOT ST_IsValid(lonlat) OR ST_AsText(lonlat) = 'POINT()') /* loading for pp / LIMIT $1 [["LIMIT", 11]] D, [2025-04-10T11:19:09.711914 #241136] DEBUG -- : Point Load (7.8ms) SELECT "points". FROM "points" WHERE (NOT ST_IsValid(lonlat) OR ST_AsText(lonlat) = 'POINT()') /* loading for inspect / LIMIT $1 [["LIMIT", 11]] => #Point::ActiveRecord_Relation:0x25e8 [2] pry(main)> points1.count D, [2025-04-10T11:19:24.446414 #241136] DEBUG -- : Point Count (3.0ms) SELECT COUNT() FROM "points" WHERE (NOT ST_IsValid(lonlat) OR ST_AsText(lonlat) = 'POINT()') ActiveRecord::StatementInvalid: PG::UndefinedFunction: ERROR: function st_isvalid(geography) does not exist LINE 1: SELECT COUNT(*) FROM "points" WHERE (NOT ST_IsValid(lonlat) ... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts.

from /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:160:in 'PG::Connection#exec' Caused by PG::UndefinedFunction: ERROR: function st_isvalid(geography) does not exist LINE 1: SELECT COUNT(*) FROM "points" WHERE (NOT ST_IsValid(lonlat) ... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts.

from /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:160:in 'PG::Connection#exec' [3] pry(main)> points1.last(3) D, [2025-04-10T11:19:58.994511 #241136] DEBUG -- : Point Load (3.0ms) SELECT "points".* FROM "points" WHERE (NOT ST_IsValid(lonlat) OR ST_AsText(lonlat) = 'POINT()') ORDER BY "points"."id" DESC LIMIT $1 [["LIMIT", 3]] ActiveRecord::StatementInvalid: PG::UndefinedFunction: ERROR: function st_isvalid(geography) does not exist LINE 1: SELECT "points".* FROM "points" WHERE (NOT ST_IsValid(lonlat... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts.

from /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:162:in 'PG::Connection#exec_params' Caused by PG::UndefinedFunction: ERROR: function st_isvalid(geography) does not exist LINE 1: SELECT "points".* FROM "points" WHERE (NOT ST_IsValid(lonlat... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts.

from /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:162:in 'PG::Connection#exec_params' [4] pry(main)> points2 = Point.where("ST_AsText(lonlat) IS NULL OR ST_AsText(lonlat) = 'POINT( )'") D, [2025-04-10T11:20:15.346962 #241136] DEBUG -- : Point Load (179.9ms) SELECT "points".* FROM "points" WHERE (ST_AsText(lonlat) IS NULL OR ST_AsText(lonlat) = 'POINT( )') /* loading for pp / LIMIT $1 [["LIMIT", 11]] => [] [5] pry(main)> points2.count D, [2025-04-10T11:20:21.566828 #241136] DEBUG -- : Point Count (130.9ms) SELECT COUNT() FROM "points" WHERE (ST_AsText(lonlat) IS NULL OR ST_AsText(lonlat) = 'POINT( )') => 0 [6] pry(main)> points2.last(3) D, [2025-04-10T11:20:27.819192 #241136] DEBUG -- : Point Load (242.7ms) SELECT "points".* FROM "points" WHERE (ST_AsText(lonlat) IS NULL OR ST_AsText(lonlat) = 'POINT( )') ORDER BY "points"."id" DESC LIMIT $1 [["LIMIT", 3]] => [] [7] pry(main)> `

chen55487 avatar Apr 10 '25 11:04 chen55487

Same here:

[1] pry(main)> points1 = Point.where("NOT ST_IsValid(lonlat) OR ST_AsText(lonlat) = 'POINT()'")
D, [2025-04-10T13:34:38.033100 #64353] DEBUG -- :   Point Load (92.3ms)  SELECT "points".* FROM "points" WHERE (NOT ST_IsValid(lonlat) OR ST_AsText(lonlat) = 'POINT()') /* loading for pp */ LIMIT $1  [["LIMIT", 11]]
D, [2025-04-10T13:34:38.035087 #64353] DEBUG -- :   Point Load (0.8ms)  SELECT "points".* FROM "points" WHERE (NOT ST_IsValid(lonlat) OR ST_AsText(lonlat) = 'POINT()') /* loading for inspect */ LIMIT $1  [["LIMIT", 11]]
=> #<Point::ActiveRecord_Relation:0x25e8>
[2] pry(main)> points1.count
D, [2025-04-10T13:34:42.923032 #64353] DEBUG -- :   Point Count (1.3ms)  SELECT COUNT(*) FROM "points" WHERE (NOT ST_IsValid(lonlat) OR ST_AsText(lonlat) = 'POINT()')
ActiveRecord::StatementInvalid: PG::UndefinedFunction: ERROR:  function st_isvalid(geography) does not exist
LINE 1: SELECT COUNT(*) FROM "points" WHERE (NOT ST_IsValid(lonlat) ...
                                                 ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

from /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:160:in 'PG::Connection#exec'
Caused by PG::UndefinedFunction: ERROR:  function st_isvalid(geography) does not exist
LINE 1: SELECT COUNT(*) FROM "points" WHERE (NOT ST_IsValid(lonlat) ...
                                                 ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

from /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:160:in 'PG::Connection#exec'
[3] pry(main)> points1.last(3)
D, [2025-04-10T13:35:30.921469 #64353] DEBUG -- :   Point Load (0.8ms)  SELECT "points".* FROM "points" WHERE (NOT ST_IsValid(lonlat) OR ST_AsText(lonlat) = 'POINT()') ORDER BY "points"."id" DESC LIMIT $1  [["LIMIT", 3]]
ActiveRecord::StatementInvalid: PG::UndefinedFunction: ERROR:  function st_isvalid(geography) does not exist
LINE 1: SELECT "points".* FROM "points" WHERE (NOT ST_IsValid(lonlat...
                                                   ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

from /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:162:in 'PG::Connection#exec_params'
Caused by PG::UndefinedFunction: ERROR:  function st_isvalid(geography) does not exist
LINE 1: SELECT "points".* FROM "points" WHERE (NOT ST_IsValid(lonlat...
                                                   ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

from /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:162:in 'PG::Connection#exec_params'

and

[8] pry(main)> points2 = Point.where("ST_AsText(lonlat) IS NULL OR ST_AsText(lonlat) = 'POINT( )'")
D, [2025-04-10T13:35:45.200113 #64353] DEBUG -- :   Point Load (821.4ms)  SELECT "points".* FROM "points" WHERE (ST_AsText(lonlat) IS NULL OR ST_AsText(lonlat) = 'POINT( )') /* loading for pp */ LIMIT $1  [["LIMIT", 11]]
=> []
[9] pry(main)> points2.count
D, [2025-04-10T13:35:51.332951 #64353] DEBUG -- :   Point Count (297.3ms)  SELECT COUNT(*) FROM "points" WHERE (ST_AsText(lonlat) IS NULL OR ST_AsText(lonlat) = 'POINT( )')
=> 0
[10] pry(main)> points2.last(3)
D, [2025-04-10T13:36:00.729983 #64353] DEBUG -- :   Point Load (1267.6ms)  SELECT "points".* FROM "points" WHERE (ST_AsText(lonlat) IS NULL OR ST_AsText(lonlat) = 'POINT( )') ORDER BY "points"."id" DESC LIMIT $1  [["LIMIT", 3]]
=> []

kevinior avatar Apr 10 '25 13:04 kevinior

ST_IsValid only accepts geometry, so an additional cast is required.

select count(*) from points where NOT ST_IsValid(lonlat::geometry) OR ST_AsText(lonlat) = 'POINT()';
dawarich=# select count(*) from points where NOT ST_IsValid(lonlat::geometry) OR ST_AsText(lonlat) = 'POINT()' OR ST_AsText(lonlat) IS NULL OR ST_AsText(lonlat) = 'POINT( )';
 count
-------
     0
(1 row)

zivillian avatar Apr 14 '25 13:04 zivillian

sidekiq log after manual trigger

D, [2025-04-14T14:05:10.907676 #7] DEBUG -- :   ↳ app/services/visits/suggest.rb:25:in 'Visits::Suggest#call'
D, [2025-04-14T14:05:10.909677 #7] DEBUG -- :   Point Exists? (0.8ms)  SELECT 1 AS one FROM "points" WHERE "points"."user_id" = $1 AND "points"."visit_id" IS NULL AND "points"."timestamp" BETWEEN $2 AND $3 LIMIT $4  [["user_id", 2], ["timestamp", 1743206400], ["timestamp", 1743292800], ["LIMIT", 1]]
D, [2025-04-14T14:05:10.910226 #7] DEBUG -- :   ↳ app/services/visits/smart_detect.rb:22:in 'Visits::SmartDetect#call'
D, [2025-04-14T14:05:10.963571 #7] DEBUG -- :   Point Load (52.8ms)  SELECT "points".* FROM "points" WHERE "points"."user_id" = $1 AND "points"."visit_id" IS NULL AND "points"."timestamp" BETWEEN $2 AND $3 ORDER BY "points"."timestamp" ASC  [["user_id", 2], ["timestamp", 1743206400], ["timestamp", 1743292800]]
D, [2025-04-14T14:05:10.964697 #7] DEBUG -- :   ↳ app/services/visits/detector.rb:20:in 'Visits::Detector#detect_potential_visits'
D, [2025-04-14T14:05:10.993775 #7] DEBUG -- :   TRANSACTION (0.6ms)  BEGIN
D, [2025-04-14T14:05:10.994642 #7] DEBUG -- :   ↳ app/services/visits/place_finder.rb:50:in 'Visits::PlaceFinder#find_existing_place'
D, [2025-04-14T14:05:10.995708 #7] DEBUG -- :   Place Load (2.6ms)  SELECT "places".* FROM "places" WHERE (ST_DWithin( lonlat::geography, ST_GeomFromEWKT('SRID=4326;POINT(13.XXXXXXXXXXXXXXX 52.XXXXXXXXXXXXXXX)')::geography, 50 )) ORDER BY "places"."id" ASC LIMIT $1  [["LIMIT", 1]]
D, [2025-04-14T14:05:10.996299 #7] DEBUG -- :   ↳ app/services/visits/place_finder.rb:50:in 'Visits::PlaceFinder#find_existing_place'
D, [2025-04-14T14:05:10.998154 #7] DEBUG -- :   Place Load (1.1ms)  SELECT "places".* FROM "places" WHERE "places"."name" = $1 AND (ST_DWithin( lonlat::geography, ST_GeomFromEWKT('SRID=4326;POINT( )')::geography, 50 )) ORDER BY "places"."id" ASC LIMIT $2  [["name", "Street, Number, Zip, City"], ["LIMIT", 1]]
D, [2025-04-14T14:05:10.998746 #7] DEBUG -- :   ↳ app/services/visits/place_finder.rb:121:in 'Visits::PlaceFinder#create_place_from_point'
D, [2025-04-14T14:05:10.999289 #7] DEBUG -- :   TRANSACTION (0.4ms)  ROLLBACK
D, [2025-04-14T14:05:10.999697 #7] DEBUG -- :   ↳ app/services/visits/creator.rb:19:in 'block in Visits::Creator#create_visits'
D, [2025-04-14T14:05:11.000980 #7] DEBUG -- :   TRANSACTION (0.4ms)  BEGIN
D, [2025-04-14T14:05:11.002045 #7] DEBUG -- :   ↳ app/services/visits/suggest.rb:25:in 'Visits::Suggest#call'
D, [2025-04-14T14:05:11.004097 #7] DEBUG -- :   Notification Create (3.0ms)  INSERT INTO "notifications" ("title", "content", "user_id", "kind", "read_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"  [["title", "Error suggesting visits"], ["content", "Error suggesting visits: PG::InternalError: ERROR:...'"], ["user_id", 2], ["kind", 2], ["read_at", nil], ["created_at", "2025-04-14 14:05:11.000256"], ["updated_at", "2025-04-14 14:05:11.000256"]]
D, [2025-04-14T14:05:11.005302 #7] DEBUG -- :   ↳ app/services/visits/suggest.rb:25:in 'Visits::Suggest#call'
D, [2025-04-14T14:05:11.009439 #7] DEBUG -- :   TRANSACTION (3.9ms)  COMMIT

zivillian avatar Apr 14 '25 14:04 zivillian

if I'm correct the issue is https://github.com/Freika/dawarich/blob/291486c55ccac9f60e069805d981f2cc0074da02/app/services/visits/place_finder.rb#L119-L121 which was probably missed in d9eac918344c3bce912342b7134e43cf2ffa5c44.

zivillian avatar Apr 14 '25 15:04 zivillian

I was seeing this error, found this thread and the fix suggested by @zivillian seems to work for me. Thanks :)

brewston avatar Apr 16 '25 07:04 brewston

Just tried with the fix and I'm still getting the error:

Error suggesting visits: PG::InternalError: ERROR: parse error - invalid geometry HINT: "SRID=4326;POINT( )" <-- parse error at position 19 within geometry /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/

But two new visits appeared, so perhaps it's a partial fix.

Update: please ignore, I made a typo in the fix.

Update 2: typo fixed, the error is still there.

jorgeml avatar Apr 16 '25 17:04 jorgeml

Image still the same every night :-( is there anything we could do here to solve this issue?

I wonder why it did work 4 days ago though.... 🤔

noway42 avatar May 06 '25 09:05 noway42

same here on 0.26.1

Error suggesting visits: PG::InternalError: ERROR: parse error - invalid geometry HINT: "SRID=4326;POINT( )" <-- parse error at position 19 within geometry /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/postgresql/database_statements.rb:162:in 'PG::Connection#exec_params' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/postgresql/database_statements.rb:162:in 'ActiveRecord::ConnectionAdapters::PostgreSQL::DatabaseStatements#perform_query' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:556:in 'block (2 levels) in ActiveRecord::ConnectionAdapters::DatabaseStatements#raw_execute' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract_adapter.rb:1015:in 'block in ActiveRecord::ConnectionAdapters::AbstractAdapter#with_raw_connection' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/concurrency/null_lock.rb:9:in 'ActiveSupport::Concurrency::NullLock#synchronize' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract_adapter.rb:984:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#with_raw_connection' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:555:in 'block in ActiveRecord::ConnectionAdapters::DatabaseStatements#raw_execute' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/notifications/instrumenter.rb:58:in 'ActiveSupport::Notifications::Instrumenter#instrument' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract_adapter.rb:1135:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#log' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:554:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#raw_execute' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:591:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#internal_execute' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:547:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#internal_exec_query' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:693:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#select' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:73:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#select_all' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:248:in 'block in ActiveRecord::ConnectionAdapters::QueryCache#select_all' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:286:in 'block (2 levels) in ActiveRecord::ConnectionAdapters::QueryCache#cache_sql' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:80:in 'ActiveRecord::ConnectionAdapters::QueryCache::Store#compute_if_absent' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:284:in 'block in ActiveRecord::ConnectionAdapters::QueryCache#cache_sql' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/concurrency/null_lock.rb:9:in 'ActiveSupport::Concurrency::NullLock#synchronize' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:283:in 'ActiveRecord::ConnectionAdapters::QueryCache#cache_sql' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:248:in 'ActiveRecord::ConnectionAdapters::QueryCache#select_all' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/querying.rb:68:in 'ActiveRecord::Querying#_query_by_sql' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/relation.rb:1449:in 'block (2 levels) in ActiveRecord::Relation#exec_main_query' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:412:in 'ActiveRecord::ConnectionAdapters::ConnectionPool#with_connection' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_handling.rb:310:in 'ActiveRecord::ConnectionHandling#with_connection' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/relation.rb:1448:in 'block in ActiveRecord::Relation#exec_main_query' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/relation.rb:1470:in 'ActiveRecord::Relation#skip_query_cache_if_necessary' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/relation.rb:1432:in 'ActiveRecord::Relation#exec_main_query' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/relation.rb:1410:in 'block in ActiveRecord::Relation#exec_queries' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/relation.rb:1470:in 'ActiveRecord::Relation#skip_query_cache_if_necessary' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/relation.rb:1404:in 'ActiveRecord::Relation#exec_queries' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/relation.rb:1181:in 'ActiveRecord::Relation#load' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/relation.rb:343:in 'ActiveRecord::Relation#records' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/relation.rb:338:in 'ActiveRecord::Relation#to_ary' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/relation/finder_methods.rb:615:in 'ActiveRecord::FinderMethods#find_nth_with_limit' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/relation/finder_methods.rb:600:in 'ActiveRecord::FinderMethods#find_nth' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/relation/finder_methods.rb:177:in 'ActiveRecord::FinderMethods#first' /var/app/app/services/visits/place_finder.rb:121:in 'Visits::PlaceFinder#create_place_from_point' /var/app/app/services/visits/place_finder.rb:100:in 'block in Visits::PlaceFinder#extract_places_from_points' /var/app/app/services/visits/place_finder.rb:99:in 'Array#each' /var/app/app/services/visits/place_finder.rb:99:in 'Visits::PlaceFinder#extract_places_from_points' /var/app/app/services/visits/place_finder.rb:67:in 'Visits::PlaceFinder#collect_potential_places' /var/app/app/services/visits/place_finder.rb:31:in 'Visits::PlaceFinder#find_or_create_place' /var/app/app/services/visits/creator.rb:24:in 'block (2 levels) in Visits::Creator#create_visits' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract/transaction.rb:626:in 'block in ActiveRecord::ConnectionAdapters::TransactionManager#within_new_transaction' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/concurrency/null_lock.rb:9:in 'ActiveSupport::Concurrency::NullLock#synchronize' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract/transaction.rb:623:in 'ActiveRecord::ConnectionAdapters::TransactionManager#within_new_transaction' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:367:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#within_new_transaction' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:359:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#transaction' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/transactions.rb:233:in 'block in ActiveRecord::Transactions::ClassMethods#transaction' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:418:in 'ActiveRecord::ConnectionAdapters::ConnectionPool#with_connection' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_handling.rb:310:in 'ActiveRecord::ConnectionHandling#with_connection' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/transactions.rb:232:in 'ActiveRecord::Transactions::ClassMethods#transaction' /var/app/app/services/visits/creator.rb:19:in 'block in Visits::Creator#create_visits' /var/app/app/services/visits/creator.rb:13:in 'Array#map' /var/app/app/services/visits/creator.rb:13:in 'Visits::Creator#create_visits' /var/app/app/services/visits/smart_detect.rb:28:in 'Visits::SmartDetect#call' /var/app/app/services/visits/suggest.rb:16:in 'Visits::Suggest#call' /var/app/app/jobs/visit_suggesting_job.rb:18:in 'VisitSuggestingJob#perform' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2/lib/active_job/execution.rb:68:in 'block in ActiveJob::Execution#_perform_job' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/callbacks.rb:120:in 'block in ActiveSupport::Callbacks#run_callbacks' /var/app/vendor/bundle/ruby/3.4.0/gems/i18n-1.14.7/lib/i18n.rb:353:in 'I18n::Base#with_locale' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2/lib/active_job/translation.rb:9:in 'block (2 levels) in ' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/callbacks.rb:129:in 'BasicObject#instance_exec' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/callbacks.rb:129:in 'block in ActiveSupport::Callbacks#run_callbacks' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/core_ext/time/zones.rb:65:in 'Time.use_zone' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2/lib/active_job/timezones.rb:9:in 'block (2 levels) in ' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/callbacks.rb:129:in 'BasicObject#instance_exec' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/callbacks.rb:129:in 'block in ActiveSupport::Callbacks#run_callbacks' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/callbacks.rb:140:in 'ActiveSupport::Callbacks#run_callbacks' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2/lib/active_job/execution.rb:67:in 'ActiveJob::Execution#_perform_job' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2/lib/active_job/instrumentation.rb:32:in 'ActiveJob::Instrumentation#_perform_job' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2/lib/active_job/execution.rb:51:in 'ActiveJob::Execution#perform_now' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2/lib/active_job/instrumentation.rb:26:in 'block in ActiveJob::Instrumentation#perform_now' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/railties/job_runtime.rb:13:in 'block in ActiveRecord::Railties::JobRuntime#instrument' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2/lib/active_job/instrumentation.rb:40:in 'block in ActiveJob::Instrumentation#instrument' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/notifications.rb:210:in 'block in ActiveSupport::Notifications.instrument' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/notifications/instrumenter.rb:58:in 'ActiveSupport::Notifications::Instrumenter#instrument' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/notifications.rb:210:in 'ActiveSupport::Notifications.instrument' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2/lib/active_job/instrumentation.rb:39:in 'ActiveJob::Instrumentation#instrument' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/railties/job_runtime.rb:11:in 'ActiveRecord::Railties::JobRuntime#instrument' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2/lib/active_job/instrumentation.rb:26:in 'ActiveJob::Instrumentation#perform_now' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2/lib/active_job/logging.rb:32:in 'block in ActiveJob::Logging#perform_now' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2/lib/active_job/logging.rb:41:in 'ActiveJob::Logging#tag_logger' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2/lib/active_job/logging.rb:32:in 'ActiveJob::Logging#perform_now' /var/app/vendor/bundle/ruby/3.4.0/gems/sentry-rails-5.23.0/lib/sentry/rails/active_job.rb:8:in 'Sentry::Rails::ActiveJobExtensions#perform_now' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2/lib/active_job/execution.rb:29:in 'block in ActiveJob::Execution::ClassMethods#execute' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/callbacks.rb:120:in 'block in ActiveSupport::Callbacks#run_callbacks' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2/lib/active_job/railtie.rb:95:in 'block (4 levels) in ' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/reloader.rb:77:in 'block in ActiveSupport::Reloader.wrap' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/execution_wrapper.rb:87:in 'ActiveSupport::ExecutionWrapper.wrap' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/reloader.rb:74:in 'ActiveSupport::Reloader.wrap' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2/lib/active_job/railtie.rb:94:in 'block (3 levels) in ' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/callbacks.rb:129:in 'BasicObject#instance_exec' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/callbacks.rb:129:in 'block in ActiveSupport::Callbacks#run_callbacks' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/callbacks.rb:140:in 'ActiveSupport::Callbacks#run_callbacks' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2/lib/active_job/execution.rb:27:in 'ActiveJob::Execution::ClassMethods#execute' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/rails.rb:13:in 'Sidekiq::ActiveJob::Wrapper#perform' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:220:in 'Sidekiq::Processor#execute_job' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:185:in 'block (4 levels) in Sidekiq::Processor#process' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/middleware/chain.rb:180:in 'Sidekiq::Middleware::Chain#traverse' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/middleware/chain.rb:183:in 'block in Sidekiq::Middleware::Chain#traverse' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/job/interrupt_handler.rb:9:in 'Sidekiq::Job::InterruptHandler#call' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/middleware/chain.rb:182:in 'Sidekiq::Middleware::Chain#traverse' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/middleware/chain.rb:183:in 'block in Sidekiq::Middleware::Chain#traverse' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/metrics/tracking.rb:26:in 'Sidekiq::Metrics::ExecutionTracker#track' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/metrics/tracking.rb:134:in 'Sidekiq::Metrics::Middleware#call' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/middleware/chain.rb:182:in 'Sidekiq::Middleware::Chain#traverse' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/middleware/chain.rb:173:in 'Sidekiq::Middleware::Chain#invoke' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:184:in 'block (3 levels) in Sidekiq::Processor#process' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:145:in 'block (6 levels) in Sidekiq::Processor#dispatch' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/job_retry.rb:118:in 'Sidekiq::JobRetry#local' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:144:in 'block (5 levels) in Sidekiq::Processor#dispatch' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/rails.rb:27:in 'block in Sidekiq::Rails::Reloader#call' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/reloader.rb:77:in 'block in ActiveSupport::Reloader.wrap' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/execution_wrapper.rb:91:in 'ActiveSupport::ExecutionWrapper.wrap' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/reloader.rb:74:in 'ActiveSupport::Reloader.wrap' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/rails.rb:26:in 'Sidekiq::Rails::Reloader#call' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:139:in 'block (4 levels) in Sidekiq::Processor#dispatch' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:281:in 'Sidekiq::Processor#stats' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:134:in 'block (3 levels) in Sidekiq::Processor#dispatch' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/job_logger.rb:15:in 'Sidekiq::JobLogger#call' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:133:in 'block (2 levels) in Sidekiq::Processor#dispatch' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/job_retry.rb:85:in 'Sidekiq::JobRetry#global' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:132:in 'block in Sidekiq::Processor#dispatch' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/job_logger.rb:40:in 'Sidekiq::JobLogger#prepare' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:131:in 'Sidekiq::Processor#dispatch' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:183:in 'block (2 levels) in Sidekiq::Processor#process' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:182:in 'Thread.handle_interrupt' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:182:in 'block in Sidekiq::Processor#process' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:181:in 'Thread.handle_interrupt' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:181:in 'Sidekiq::Processor#process' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:86:in 'Sidekiq::Processor#process_one' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:76:in 'Sidekiq::Processor#run' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/component.rb:10:in 'Sidekiq::Component#watchdog' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/component.rb:19:in 'block in Sidekiq::Component#safe_thread'

narucx avatar May 18 '25 20:05 narucx

It still indicates points without coordinates in lonlat column. The migration rake task should do the job

Freika avatar May 18 '25 20:05 Freika

It still indicates points without coordinates in lonlat column. The migration rake task should do the job

at least for me this is definitely not the case: docker exec -it dawarich_app /bin/sh /var/app # bin/rails console [dotenv] Set DATABASE_PORT [dotenv] Loaded .env.development Loading development environment (Rails 8.0.2) [1] pry(main)> Point.where(lonlat: nil).count D, [2025-05-19T06:45:43.184168 #663] DEBUG -- : Point Count (6.9ms) SELECT COUNT(*) FROM "points" WHERE "points"."lonlat" IS NULL => 0 [2] pry(main)> --> 0 points without lonlat

[4] pry(main)> points1 = Point.where("NOT ST_IsValid(lonlat::geometry) OR ST_AsText(lonlat) = 'POINT()'") D, [2025-05-19T06:57:20.880622 #663] DEBUG -- : Point Load (109.9ms) SELECT "points".* FROM "points" WHERE (NOT ST_IsValid(lonlat::geometry) OR ST_AsText(lonlat) = 'POINT()') /* loading for pp */ LIMIT $1 [["LIMIT", 11]] => [] [5] pry(main)> points1.count D, [2025-05-19T06:57:27.272672 #663] DEBUG -- : Point Count (271.6ms) SELECT COUNT(*) FROM "points" WHERE (NOT ST_IsValid(lonlat::geometry) OR ST_AsText(lonlat) = 'POINT()') => 0 --> all points /lonlat values are valid

What I do have is several points whith a lack of data in the longitude or latitude column. And also abount ~100 points which don't get reverse geocoded even if I continue the background job (the queue build up untill the amount, decreases, but these points don't get reverse geocoded although there is a valid lonlat value which I can open e.g. in pgadmin's map.). Might that have an impact?

noway42 avatar May 19 '25 06:05 noway42

Still not working for me on 0.26.3:

Error suggesting visits: PG::InternalError: ERROR: parse error - invalid geometry HINT: "SRID=4326;POINT( )" <-- parse error at position 19 within geometry /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/postgresql/database_statements.rb:162:in 'PG::Connection#exec_params' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/postgresql/database_statements.rb:162:in 'ActiveRecord::ConnectionAdapters::PostgreSQL::DatabaseStatements#perform_query' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:556:in 'block (2 levels) in ActiveRecord::ConnectionAdapters::DatabaseStatements#raw_execute' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract_adapter.rb:1015:in 'block in ActiveRecord::ConnectionAdapters::AbstractAdapter#with_raw_connection' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/concurrency/null_lock.rb:9:in 'ActiveSupport::Concurrency::NullLock#synchronize' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract_adapter.rb:984:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#with_raw_connection' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:555:in 'block in ActiveRecord::ConnectionAdapters::DatabaseStatements#raw_execute' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/notifications/instrumenter.rb:58:in 'ActiveSupport::Notifications::Instrumenter#instrument' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract_adapter.rb:1135:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#log' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:554:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#raw_execute' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:591:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#internal_execute' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:547:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#internal_exec_query' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:693:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#select' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:73:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#select_all' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:248:in 'block in ActiveRecord::ConnectionAdapters::QueryCache#select_all' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:286:in 'block (2 levels) in ActiveRecord::ConnectionAdapters::QueryCache#cache_sql' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:80:in 'ActiveRecord::ConnectionAdapters::QueryCache::Store#compute_if_absent' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:284:in 'block in ActiveRecord::ConnectionAdapters::QueryCache#cache_sql' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/concurrency/null_lock.rb:9:in 'ActiveSupport::Concurrency::NullLock#synchronize' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:283:in 'ActiveRecord::ConnectionAdapters::QueryCache#cache_sql' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:248:in 'ActiveRecord::ConnectionAdapters::QueryCache#select_all' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/querying.rb:68:in 'ActiveRecord::Querying#_query_by_sql' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/relation.rb:1449:in 'block (2 levels) in ActiveRecord::Relation#exec_main_query' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:412:in 'ActiveRecord::ConnectionAdapters::ConnectionPool#with_connection' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_handling.rb:310:in 'ActiveRecord::ConnectionHandling#with_connection' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/relation.rb:1448:in 'block in ActiveRecord::Relation#exec_main_query' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/relation.rb:1470:in 'ActiveRecord::Relation#skip_query_cache_if_necessary' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/relation.rb:1432:in 'ActiveRecord::Relation#exec_main_query' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/relation.rb:1410:in 'block in ActiveRecord::Relation#exec_queries' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/relation.rb:1470:in 'ActiveRecord::Relation#skip_query_cache_if_necessary' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/relation.rb:1404:in 'ActiveRecord::Relation#exec_queries' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/relation.rb:1181:in 'ActiveRecord::Relation#load' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/relation.rb:343:in 'ActiveRecord::Relation#records' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/relation.rb:338:in 'ActiveRecord::Relation#to_ary' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/relation/finder_methods.rb:615:in 'ActiveRecord::FinderMethods#find_nth_with_limit' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/relation/finder_methods.rb:600:in 'ActiveRecord::FinderMethods#find_nth' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/relation/finder_methods.rb:177:in 'ActiveRecord::FinderMethods#first' /var/app/app/services/visits/place_finder.rb:118:in 'Visits::PlaceFinder#create_place_from_point' /var/app/app/services/visits/place_finder.rb:97:in 'block in Visits::PlaceFinder#extract_places_from_points' /var/app/app/services/visits/place_finder.rb:96:in 'Array#each' /var/app/app/services/visits/place_finder.rb:96:in 'Visits::PlaceFinder#extract_places_from_points' /var/app/app/services/visits/place_finder.rb:67:in 'Visits::PlaceFinder#collect_potential_places' /var/app/app/services/visits/place_finder.rb:31:in 'Visits::PlaceFinder#find_or_create_place' /var/app/app/services/visits/creator.rb:28:in 'block (2 levels) in Visits::Creator#create_visits' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract/transaction.rb:626:in 'block in ActiveRecord::ConnectionAdapters::TransactionManager#within_new_transaction' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/concurrency/null_lock.rb:9:in 'ActiveSupport::Concurrency::NullLock#synchronize' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract/transaction.rb:623:in 'ActiveRecord::ConnectionAdapters::TransactionManager#within_new_transaction' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:367:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#within_new_transaction' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:359:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#transaction' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/transactions.rb:233:in 'block in ActiveRecord::Transactions::ClassMethods#transaction' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:418:in 'ActiveRecord::ConnectionAdapters::ConnectionPool#with_connection' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/connection_handling.rb:310:in 'ActiveRecord::ConnectionHandling#with_connection' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/transactions.rb:232:in 'ActiveRecord::Transactions::ClassMethods#transaction' /var/app/app/services/visits/creator.rb:23:in 'block in Visits::Creator#create_visits' /var/app/app/services/visits/creator.rb:13:in 'Array#map' /var/app/app/services/visits/creator.rb:13:in 'Visits::Creator#create_visits' /var/app/app/services/visits/smart_detect.rb:28:in 'Visits::SmartDetect#call' /var/app/app/services/visits/suggest.rb:16:in 'Visits::Suggest#call' /var/app/app/jobs/visit_suggesting_job.rb:18:in 'VisitSuggestingJob#perform' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2/lib/active_job/execution.rb:68:in 'block in ActiveJob::Execution#_perform_job' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/callbacks.rb:120:in 'block in ActiveSupport::Callbacks#run_callbacks' /var/app/vendor/bundle/ruby/3.4.0/gems/i18n-1.14.7/lib/i18n.rb:353:in 'I18n::Base#with_locale' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2/lib/active_job/translation.rb:9:in 'block (2 levels) in ' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/callbacks.rb:129:in 'BasicObject#instance_exec' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/callbacks.rb:129:in 'block in ActiveSupport::Callbacks#run_callbacks' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/core_ext/time/zones.rb:65:in 'Time.use_zone' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2/lib/active_job/timezones.rb:9:in 'block (2 levels) in ' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/callbacks.rb:129:in 'BasicObject#instance_exec' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/callbacks.rb:129:in 'block in ActiveSupport::Callbacks#run_callbacks' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/callbacks.rb:140:in 'ActiveSupport::Callbacks#run_callbacks' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2/lib/active_job/execution.rb:67:in 'ActiveJob::Execution#_perform_job' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2/lib/active_job/instrumentation.rb:32:in 'ActiveJob::Instrumentation#_perform_job' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2/lib/active_job/execution.rb:51:in 'ActiveJob::Execution#perform_now' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2/lib/active_job/instrumentation.rb:26:in 'block in ActiveJob::Instrumentation#perform_now' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/railties/job_runtime.rb:13:in 'block in ActiveRecord::Railties::JobRuntime#instrument' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2/lib/active_job/instrumentation.rb:40:in 'block in ActiveJob::Instrumentation#instrument' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/notifications.rb:210:in 'block in ActiveSupport::Notifications.instrument' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/notifications/instrumenter.rb:58:in 'ActiveSupport::Notifications::Instrumenter#instrument' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/notifications.rb:210:in 'ActiveSupport::Notifications.instrument' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2/lib/active_job/instrumentation.rb:39:in 'ActiveJob::Instrumentation#instrument' /var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/railties/job_runtime.rb:11:in 'ActiveRecord::Railties::JobRuntime#instrument' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2/lib/active_job/instrumentation.rb:26:in 'ActiveJob::Instrumentation#perform_now' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2/lib/active_job/logging.rb:32:in 'block in ActiveJob::Logging#perform_now' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2/lib/active_job/logging.rb:41:in 'ActiveJob::Logging#tag_logger' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2/lib/active_job/logging.rb:32:in 'ActiveJob::Logging#perform_now' /var/app/vendor/bundle/ruby/3.4.0/gems/sentry-rails-5.23.0/lib/sentry/rails/active_job.rb:8:in 'Sentry::Rails::ActiveJobExtensions#perform_now' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2/lib/active_job/execution.rb:29:in 'block in ActiveJob::Execution::ClassMethods#execute' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/callbacks.rb:120:in 'block in ActiveSupport::Callbacks#run_callbacks' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2/lib/active_job/railtie.rb:95:in 'block (4 levels) in ' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/reloader.rb:77:in 'block in ActiveSupport::Reloader.wrap' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/execution_wrapper.rb:87:in 'ActiveSupport::ExecutionWrapper.wrap' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/reloader.rb:74:in 'ActiveSupport::Reloader.wrap' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2/lib/active_job/railtie.rb:94:in 'block (3 levels) in ' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/callbacks.rb:129:in 'BasicObject#instance_exec' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/callbacks.rb:129:in 'block in ActiveSupport::Callbacks#run_callbacks' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/callbacks.rb:140:in 'ActiveSupport::Callbacks#run_callbacks' /var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2/lib/active_job/execution.rb:27:in 'ActiveJob::Execution::ClassMethods#execute' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/rails.rb:13:in 'Sidekiq::ActiveJob::Wrapper#perform' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:220:in 'Sidekiq::Processor#execute_job' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:185:in 'block (4 levels) in Sidekiq::Processor#process' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/middleware/chain.rb:180:in 'Sidekiq::Middleware::Chain#traverse' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/middleware/chain.rb:183:in 'block in Sidekiq::Middleware::Chain#traverse' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/job/interrupt_handler.rb:9:in 'Sidekiq::Job::InterruptHandler#call' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/middleware/chain.rb:182:in 'Sidekiq::Middleware::Chain#traverse' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/middleware/chain.rb:183:in 'block in Sidekiq::Middleware::Chain#traverse' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/metrics/tracking.rb:26:in 'Sidekiq::Metrics::ExecutionTracker#track' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/metrics/tracking.rb:134:in 'Sidekiq::Metrics::Middleware#call' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/middleware/chain.rb:182:in 'Sidekiq::Middleware::Chain#traverse' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/middleware/chain.rb:173:in 'Sidekiq::Middleware::Chain#invoke' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:184:in 'block (3 levels) in Sidekiq::Processor#process' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:145:in 'block (6 levels) in Sidekiq::Processor#dispatch' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/job_retry.rb:118:in 'Sidekiq::JobRetry#local' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:144:in 'block (5 levels) in Sidekiq::Processor#dispatch' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/rails.rb:27:in 'block in Sidekiq::Rails::Reloader#call' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/reloader.rb:77:in 'block in ActiveSupport::Reloader.wrap' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/execution_wrapper.rb:91:in 'ActiveSupport::ExecutionWrapper.wrap' /var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2/lib/active_support/reloader.rb:74:in 'ActiveSupport::Reloader.wrap' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/rails.rb:26:in 'Sidekiq::Rails::Reloader#call' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:139:in 'block (4 levels) in Sidekiq::Processor#dispatch' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:281:in 'Sidekiq::Processor#stats' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:134:in 'block (3 levels) in Sidekiq::Processor#dispatch' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/job_logger.rb:15:in 'Sidekiq::JobLogger#call' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:133:in 'block (2 levels) in Sidekiq::Processor#dispatch' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/job_retry.rb:85:in 'Sidekiq::JobRetry#global' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:132:in 'block in Sidekiq::Processor#dispatch' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/job_logger.rb:40:in 'Sidekiq::JobLogger#prepare' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:131:in 'Sidekiq::Processor#dispatch' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:183:in 'block (2 levels) in Sidekiq::Processor#process' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:182:in 'Thread.handle_interrupt' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:182:in 'block in Sidekiq::Processor#process' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:181:in 'Thread.handle_interrupt' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:181:in 'Sidekiq::Processor#process' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:86:in 'Sidekiq::Processor#process_one' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/processor.rb:76:in 'Sidekiq::Processor#run' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/component.rb:10:in 'Sidekiq::Component#watchdog' /var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-7.3.9/lib/sidekiq/component.rb:19:in 'block in Sidekiq::Component#safe_thread'

The migration to lonlat fails:

/var/app # bin/rake points:migrate_to_lonlat
[dotenv] Set DATABASE_PORT
[dotenv] Loaded .env.development
Updating points to use lonlat...
D, [2025-05-19T17:59:20.308219 #630] DEBUG -- :   Point Load (85.6ms)  SELECT "points"."id", "points"."battery_status", "points"."ping", "points"."battery", "points"."tracker_id", "points"."topic", "points"."altitude", "points"."longitude", "points"."velocity", "points"."trigger", "points"."bssid", "points"."ssid", "points"."connection", "points"."vertical_accuracy", "points"."accuracy", "points"."timestamp", "points"."latitude", "points"."mode", "points"."inrids", "points"."in_regions", "points"."import_id", "points"."city", "points"."country", "points"."created_at", "points"."updated_at", "points"."user_id", "points"."geodata", "points"."visit_id", "points"."reverse_geocoded_at", "points"."course", "points"."course_accuracy", "points"."external_track_id", "points"."lonlat", "points"."country_id" FROM "points" WHERE "points"."longitude" IS NULL AND "points"."latitude" IS NULL ORDER BY "points"."id" ASC LIMIT $1  [["LIMIT", 1000]]
D, [2025-05-19T17:59:20.324322 #630] DEBUG -- :   ↳ lib/tasks/points.rake:10:in 'block (2 levels) in <main>'
rake aborted!
ActiveModel::MissingAttributeError: missing attribute 'raw_data' for Point (ActiveModel::MissingAttributeError)
/var/app/vendor/bundle/ruby/3.4.0/gems/activemodel-8.0.2/lib/active_model/attribute.rb:251:in 'ActiveModel::Attribute::Uninitialized#value'
/var/app/vendor/bundle/ruby/3.4.0/gems/activemodel-8.0.2/lib/active_model/attribute_set/builder.rb:55:in 'block in ActiveModel::LazyAttributeSet#fetch_value'
/var/app/vendor/bundle/ruby/3.4.0/gems/activemodel-8.0.2/lib/active_model/attribute_set/builder.rb:46:in 'Hash#fetch'
/var/app/vendor/bundle/ruby/3.4.0/gems/activemodel-8.0.2/lib/active_model/attribute_set/builder.rb:46:in 'ActiveModel::LazyAttributeSet#fetch_value'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/attribute_methods/read.rb:39:in 'ActiveRecord::AttributeMethods::Read#_read_attribute'
/var/app/vendor/bundle/ruby/3.4.0/gems/activemodel-8.0.2/lib/active_model/attribute_methods.rb:273:in 'Point::GeneratedAttributeMethods#raw_data'
/var/app/app/services/points/raw_data_lonlat_extractor.rb:21:in 'Points::RawDataLonlatExtractor#extract_lonlat'
/var/app/app/services/points/raw_data_lonlat_extractor.rb:9:in 'Points::RawDataLonlatExtractor#call'
/var/app/lib/tasks/points.rake:11:in 'block (3 levels) in <main>'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/relation/batches.rb:88:in 'Array#each'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/relation/batches.rb:88:in 'block in ActiveRecord::Batches#find_each'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/relation/batches.rb:172:in 'block in ActiveRecord::Batches#find_in_batches'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/relation/batches.rb:461:in 'block in ActiveRecord::Batches#batch_on_unloaded_relation'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/relation/batches.rb:434:in 'ActiveRecord::Batches#batch_on_unloaded_relation'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/relation/batches.rb:289:in 'ActiveRecord::Batches#in_batches'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/relation/batches.rb:171:in 'ActiveRecord::Batches#find_in_batches'
/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2/lib/active_record/relation/batches.rb:87:in 'ActiveRecord::Batches#find_each'
/var/app/lib/tasks/points.rake:10:in 'block (2 levels) in <main>'
Tasks: TOP => points:migrate_to_lonlat
(See full trace by running task with --trace)

But I don't seem to have any point missing the raw_data atribute:

[7] pry(main)> Point.where(raw_data: nil).count D,
[7] pry(main)> 

jorgeml avatar May 19 '25 17:05 jorgeml

In my case, the lonlat migration no longer fails in 0.26.4, however it updated zero points and I still have many occurrences of the "Error suggesting visits" message in the frontend.

# rake points:migrate_to_lonlat
Updating points to use lonlat...
Successfully updated 0 points with lonlat values
#
# bin/rails console
Loading production environment (Rails 8.0.2)
dawarich(prod)> Point.where(lonlat: nil).count
=> 0

tigattack avatar May 20 '25 07:05 tigattack

Yesterday I took some time to dig int the database itself to look for problems and I think I've found it. I had no points with no "lotlan" anymore, but I did have around 650 places with no "lotlan" data in the places table. I then updated the data using SQL and did not receive an error this night. Let's see what the upcoming night says. Maybe we need some kind of rake job for the places table as well...

noway42 avatar May 20 '25 07:05 noway42

Since today is the second night in which I didn't have this issue, I think the null values in the lonlat column of the table places have been the cause. The SQL I ran on the DB is the following: UPDATE public.places SET lonlat = ST_SetSRID(ST_MakePoint(longitude, latitude), 4326) WHERE lonlat IS NULL AND longitude IS NOT NULL AND latitude IS NOT NULL;

Since I have zero knowledge concerning Ruby/Rails/Sidekiq, I am afraid I cannot provide this kind of rake job needed, but maybe somebody else can step in.

noway42 avatar May 21 '25 06:05 noway42