dawarich icon indicating copy to clipboard operation
dawarich copied to clipboard

Fail to import google takeout from phone

Open ilijamt opened this issue 2 months ago • 6 comments

Version 0.33.0 (docker compose)

Describe the bug When trying to upload a Google takeout from phone, I get an HTTP 422 error. The only file exported is a Timeline.json which is ~70MB in total. proxy-body-size is set to 0.

Logs {"method":"POST","path":"/imports","format":"html","controller":"ImportsController","action":"create","status":422,"allocations":1169,"duration":7.3,"view":0.0,"db":2.27,"location":"https://dawarich.example.com/imports/new"}

ilijamt avatar Oct 03 '25 11:10 ilijamt

Feel free to send your file to [email protected] so I could debug it

Freika avatar Oct 07 '25 19:10 Freika

Switching to RAILS_ENV=development creates the import but it fails now with

The file is called just Timeline.json, is it supposed to be like this or compressed in a zip file?

  Notification Create (1.8ms)  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", "Import failed"], ["content", "Import \"Timeline.json\" failed: ActiveStorage::FileNotFoundError, stacktrace: /var/app/vendor/bundle/ruby/3.4.0/gems/activestorage-8.0.2.1/lib/active_storage/service/disk_service.rb:152:in 'ActiveStorage::Service::DiskService#stream'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activestorage-8.0.2.1/lib/active_storage/service/disk_service.rb:31:in 'block in ActiveStorage::Service::DiskService#download'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2.1/lib/active_support/notifications.rb:210:in 'block in ActiveSupport::Notifications.instrument'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2.1/lib/active_support/notifications/instrumenter.rb:58:in 'ActiveSupport::Notifications::Instrumenter#instrument'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2.1/lib/active_support/notifications.rb:210:in 'ActiveSupport::Notifications.instrument'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activestorage-8.0.2.1/lib/active_storage/service.rb:165:in 'ActiveStorage::Service#instrument'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activestorage-8.0.2.1/lib/active_storage/service/disk_service.rb:30:in 'ActiveStorage::Service::DiskService#download'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activestorage-8.0.2.1/app/models/active_storage/blob.rb:267:in 'ActiveStorage::Blob#download'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2.1/lib/active_support/delegation.rb:190:in 'Kernel#public_send'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2.1/lib/active_support/delegation.rb:190:in 'ActiveStorage::Attachment#method_missing'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2.1/lib/active_support/delegation.rb:169:in 'Kernel#public_send'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2.1/lib/active_support/delegation.rb:169:in 'ActiveStorage::Attached::One#method_missing'\n/var/app/app/services/imports/secure_file_downloader.rb:26:in 'block in Imports::SecureFileDownloader#download_to_temp_file'\n/var/app/vendor/bundle/ruby/3.4.0/gems/timeout-0.4.3/lib/timeout.rb:185:in 'block in Timeout.timeout'\n/var/app/vendor/bundle/ruby/3.4.0/gems/timeout-0.4.3/lib/timeout.rb:38:in 'Timeout::Error.handle_timeout'\n/var/app/vendor/bundle/ruby/3.4.0/gems/timeout-0.4.3/lib/timeout.rb:194:in 'Timeout.timeout'\n/var/app/app/services/imports/secure_file_downloader.rb:22:in 'Imports::SecureFileDownloader#download_to_temp_file'\n/var/app/app/services/imports/create.rb:17:in 'Imports::Create#call'\n/var/app/app/models/import.rb:32:in 'Import#process!'\n/var/app/app/jobs/import/process_job.rb:9:in 'Import::ProcessJob#perform'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2.1/lib/active_job/execution.rb:68:in 'block in ActiveJob::Execution#_perform_job'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2.1/lib/active_support/callbacks.rb:120:in 'block in ActiveSupport::Callbacks#run_callbacks'\n/var/app/vendor/bundle/ruby/3.4.0/gems/i18n-1.14.7/lib/i18n.rb:353:in 'I18n::Base#with_locale'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2.1/lib/active_job/translation.rb:9:in 'block (2 levels) in <module:Translation>'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2.1/lib/active_support/callbacks.rb:129:in 'BasicObject#instance_exec'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2.1/lib/active_support/callbacks.rb:129:in 'block in ActiveSupport::Callbacks#run_callbacks'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2.1/lib/active_support/core_ext/time/zones.rb:65:in 'Time.use_zone'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2.1/lib/active_job/timezones.rb:9:in 'block (2 levels) in <module:Timezones>'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2.1/lib/active_support/callbacks.rb:129:in 'BasicObject#instance_exec'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2.1/lib/active_support/callbacks.rb:129:in 'block in ActiveSupport::Callbacks#run_callbacks'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2.1/lib/active_support/callbacks.rb:140:in 'ActiveSupport::Callbacks#run_callbacks'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2.1/lib/active_job/execution.rb:67:in 'ActiveJob::Execution#_perform_job'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2.1/lib/active_job/instrumentation.rb:32:in 'ActiveJob::Instrumentation#_perform_job'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2.1/lib/active_job/execution.rb:51:in 'ActiveJob::Execution#perform_now'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2.1/lib/active_job/instrumentation.rb:26:in 'block in ActiveJob::Instrumentation#perform_now'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2.1/lib/active_record/railties/job_runtime.rb:13:in 'block in ActiveRecord::Railties::JobRuntime#instrument'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2.1/lib/active_job/instrumentation.rb:40:in 'block in ActiveJob::Instrumentation#instrument'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2.1/lib/active_support/notifications.rb:210:in 'block in ActiveSupport::Notifications.instrument'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2.1/lib/active_support/notifications/instrumenter.rb:58:in 'ActiveSupport::Notifications::Instrumenter#instrument'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2.1/lib/active_support/notifications.rb:210:in 'ActiveSupport::Notifications.instrument'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2.1/lib/active_job/instrumentation.rb:39:in 'ActiveJob::Instrumentation#instrument'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.2.1/lib/active_record/railties/job_runtime.rb:11:in 'ActiveRecord::Railties::JobRuntime#instrument'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2.1/lib/active_job/instrumentation.rb:26:in 'ActiveJob::Instrumentation#perform_now'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2.1/lib/active_job/logging.rb:32:in 'block in ActiveJob::Logging#perform_now'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2.1/lib/active_job/logging.rb:41:in 'ActiveJob::Logging#tag_logger'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2.1/lib/active_job/logging.rb:32:in 'ActiveJob::Logging#perform_now'\n/var/app/vendor/bundle/ruby/3.4.0/gems/sentry-rails-5.26.0/lib/sentry/rails/active_job.rb:10:in 'Sentry::Rails::ActiveJobExtensions#perform_now'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2.1/lib/active_job/execution.rb:29:in 'block in ActiveJob::Execution::ClassMethods#execute'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2.1/lib/active_support/callbacks.rb:120:in 'block in ActiveSupport::Callbacks#run_callbacks'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2.1/lib/active_job/railtie.rb:95:in 'block (4 levels) in <class:Railtie>'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2.1/lib/active_support/reloader.rb:77:in 'block in ActiveSupport::Reloader.wrap'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2.1/lib/active_support/execution_wrapper.rb:87:in 'ActiveSupport::ExecutionWrapper.wrap'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2.1/lib/active_support/reloader.rb:74:in 'ActiveSupport::Reloader.wrap'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2.1/lib/active_job/railtie.rb:94:in 'block (3 levels) in <class:Railtie>'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2.1/lib/active_support/callbacks.rb:129:in 'BasicObject#instance_exec'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2.1/lib/active_support/callbacks.rb:129:in 'block in ActiveSupport::Callbacks#run_callbacks'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2.1/lib/active_support/callbacks.rb:140:in 'ActiveSupport::Callbacks#run_callbacks'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activejob-8.0.2.1/lib/active_job/execution.rb:27:in 'ActiveJob::Execution::ClassMethods#execute'\n/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-8.0.4/lib/active_job/queue_adapters/sidekiq_adapter.rb:14:in 'Sidekiq::ActiveJob::Wrapper#perform'\n/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-8.0.4/lib/sidekiq/processor.rb:227:in 'Sidekiq::Processor#execute_job'\n/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-8.0.4/lib/sidekiq/processor.rb:192:in 'block (4 levels) in Sidekiq::Processor#process'\n/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-8.0.4/lib/sidekiq/middleware/chain.rb:180:in 'Sidekiq::Middleware::Chain#traverse'\n/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-8.0.4/lib/sidekiq/middleware/chain.rb:183:in 'block in Sidekiq::Middleware::Chain#traverse'\n/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-8.0.4/lib/sidekiq/job/interrupt_handler.rb:9:in 'Sidekiq::Job::InterruptHandler#call'\n/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-8.0.4/lib/sidekiq/middleware/chain.rb:182:in 'Sidekiq::Middleware::Chain#traverse'\n/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-8.0.4/lib/sidekiq/middleware/chain.rb:183:in 'block in Sidekiq::Middleware::Chain#traverse'\n/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-8.0.4/lib/sidekiq/metrics/tracking.rb:26:in 'Sidekiq::Metrics::ExecutionTracker#track'\n/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-8.0.4/lib/sidekiq/metrics/tracking.rb:136:in 'Sidekiq::Metrics::Middleware#call'\n/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-8.0.4/lib/sidekiq/middleware/chain.rb:182:in 'Sidekiq::Middleware::Chain#traverse'\n/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-8.0.4/lib/sidekiq/middleware/chain.rb:173:in 'Sidekiq::Middleware::Chain#invoke'\n/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-8.0.4/lib/sidekiq/processor.rb:191:in 'block (3 levels) in Sidekiq::Processor#process'\n/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-8.0.4/lib/sidekiq/processor.rb:151:in 'block (7 levels) in Sidekiq::Processor#dispatch'\n/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-8.0.4/lib/sidekiq/job_retry.rb:118:in 'Sidekiq::JobRetry#local'\n/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-8.0.4/lib/sidekiq/processor.rb:150:in 'block (6 levels) in Sidekiq::Processor#dispatch'\n/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-8.0.4/lib/sidekiq/rails.rb:20:in 'block in Sidekiq::Rails::Reloader#call'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2.1/lib/active_support/reloader.rb:77:in 'block in ActiveSupport::Reloader.wrap'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2.1/lib/active_support/execution_wrapper.rb:91:in 'ActiveSupport::ExecutionWrapper.wrap'\n/var/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.2.1/lib/active_support/reloader.rb:74:in 'ActiveSupport::Reloader.wrap'\n/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-8.0.4/lib/sidekiq/rails.rb:19:in 'Sidekiq::Rails::Reloader#call'\n/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-8.0.4/lib/sidekiq/processor.rb:145:in 'block (5 levels) in Sidekiq::Processor#dispatch'\n/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-8.0.4/lib/sidekiq/processor.rb:123:in 'Sidekiq::Processor#profile'\n/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-8.0.4/lib/sidekiq/processor.rb:140:in 'block (4 levels) in Sidekiq::Processor#dispatch'\n/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-8.0.4/lib/sidekiq/processor.rb:288:in 'Sidekiq::Processor#stats'\n/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-8.0.4/lib/sidekiq/processor.rb:139:in 'block (3 levels) in Sidekiq::Processor#dispatch'\n/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-8.0.4/lib/sidekiq/job_logger.rb:15:in 'Sidekiq::JobLogger#call'\n/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-8.0.4/lib/sidekiq/processor.rb:138:in 'block (2 levels) in Sidekiq::Processor#dispatch'\n/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-8.0.4/lib/sidekiq/job_retry.rb:85:in 'Sidekiq::JobRetry#global'\n/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-8.0.4/lib/sidekiq/processor.rb:137:in 'block in Sidekiq::Processor#dispatch'\n/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-8.0.4/lib/sidekiq/job_logger.rb:40:in 'Sidekiq::JobLogger#prepare'\n/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-8.0.4/lib/sidekiq/processor.rb:136:in 'Sidekiq::Processor#dispatch'\n/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-8.0.4/lib/sidekiq/processor.rb:190:in 'block (2 levels) in Sidekiq::Processor#process'\n/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-8.0.4/lib/sidekiq/processor.rb:189:in 'Thread.handle_interrupt'\n/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-8.0.4/lib/sidekiq/processor.rb:189:in 'block in Sidekiq::Processor#process'\n/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-8.0.4/lib/sidekiq/processor.rb:188:in 'Thread.handle_interrupt'\n/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-8.0.4/lib/sidekiq/processor.rb:188:in 'Sidekiq::Processor#process'\n/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-8.0.4/lib/sidekiq/processor.rb:87:in 'Sidekiq::Processor#process_one'\n/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-8.0.4/lib/sidekiq/processor.rb:77:in 'Sidekiq::Processor#run'\n/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-8.0.4/lib/sidekiq/component.rb:37:in 'Sidekiq::Component#watchdog'\n/var/app/vendor/bundle/ruby/3.4.0/gems/sidekiq-8.0.4/lib/sidekiq/component.rb:46:in 'block in Sidekiq::Component#safe_thread'"], ["user_id", 1], ["kind", 2], ["read_at", nil], ["created_at", "2025-10-07 20:28:32.190443"], ["updated_at", "2025-10-07 20:28:32.190443"]]

ilijamt avatar Oct 07 '25 20:10 ilijamt

Feel free to send your file to [email protected] so I could debug it

is there a way to debug it without sending it as it contains like 15 years worth of history in it, I would rather avoid sending the file

ilijamt avatar Oct 07 '25 20:10 ilijamt

@ilijamt unfortunately I can't debug importing a file I don't have access to

Freika avatar Oct 11 '25 12:10 Freika

The file is called just Timeline.json, is it supposed to be like this or compressed in a zip file?

Can you check that you mount one more volume

  - dawarich_storage:/var/app/storage

For both sidekiq and main container

https://github.com/Freika/dawarich/blob/493db274f5f7ed7160e3b65ae58ae3cc941605ca/docker/docker-compose.production.yml#L103C26-L103C42

UnamedRus avatar Oct 18 '25 15:10 UnamedRus

I had a similar issue, but no errrors in my log files; the only thing that showed me as a fail was a popup on my screen saying that the import failed from an unknown error.

This is using the takeout from my phone, I did not have an option for any other kind of takeout, so I'm assuming its the correct one. I sent you a copy to the email you listed for debugging.

I attempted to upload it to the Timeline visualiser on your site, and it appears to work correctly there. Is there an issue with the file size?

Image

Farrit1184 avatar Nov 25 '25 05:11 Farrit1184