Aupajo / almanack

Aggregate iCal and Google Calendar events. Pluggable or standalone app. UI optional and 100% customisable.
MIT License
54 stars 25 forks source link

Can't Subscribe to the Almanack ical feed #27

Closed steveb85 closed 5 years ago

steveb85 commented 5 years ago

Steps to reproduce (I have done it three times)

Build Almanack Calendar, following iCloud, Gcal and Outlook calendars. Publish on Heroku through Deploy command. The page works perfectly. When you try and subscribe using the link, (https:// or webcam://) throws Error -1. download the linked file and had the following in it

(I changed the heroku address to just avoid broadcasting that)

<!DOCTYPE html>

Something went wrong – Steve Bartlett Sync

Steve Bartlett Sync

The Next 30 Days

Oops.

Something went wrong.

Return home

steveb85 commented 5 years ago

tried subscribing in Google calendar as well, no errors, but no events either.

steveb85 commented 5 years ago

https://icalendar.org/validator.html?url=https://gentle-shelf-11243.herokuapp.com/feed.ics for information

Aupajo commented 5 years ago

Thanks, @steveb85! I'm getting a 500 error when I try to visit that:

$ curl -I https://gentle-shelf-11243.herokuapp.com/feed.ics
HTTP/1.1 500 Internal Server Error

What happens when you look at the logs? heroku logs --tail?

steveb85 commented 5 years ago

@Aupajo sorry for the delay, crazy few days the logs are below

2019-05-28T00:05:32.561702+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.7/lib/rack/head.rb:12:in `call'
2019-05-28T00:05:32.561703+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:194:in `call'
2019-05-28T00:05:32.561705+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:1957:in `call'
2019-05-28T00:05:32.561714+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:1502:in `block in call'
2019-05-28T00:05:32.561716+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:1729:in `synchronize'
2019-05-28T00:05:32.561718+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:1502:in `call'
2019-05-28T00:05:32.561719+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.7/lib/rack/handler/webrick.rb:86:in `service'
2019-05-28T00:05:32.561721+00:00 app[web.1]: /app/vendor/ruby-2.5.3/lib/ruby/2.5.0/webrick/httpserver.rb:140:in `service'
2019-05-28T00:05:32.561722+00:00 app[web.1]: /app/vendor/ruby-2.5.3/lib/ruby/2.5.0/webrick/httpserver.rb:96:in `run'
2019-05-28T00:05:32.561724+00:00 app[web.1]: /app/vendor/ruby-2.5.3/lib/ruby/2.5.0/webrick/server.rb:307:in `block in start_thread'
2019-05-28T00:05:32.607397+00:00 heroku[router]: at=info method=GET path="/feed.ics" host=gentle-shelf-11243.herokuapp.com request_id=08668604-ae78-4aa1-af71-f8ac238ac885 fwd="66.249.92.95" dyno=web.1 connect=0ms service=1913ms status=500 bytes=996 protocol=https
2019-05-28T00:38:41.361326+00:00 heroku[web.1]: Idling
2019-05-28T00:38:41.367224+00:00 heroku[web.1]: State changed from up to down
2019-05-28T00:38:42.431533+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2019-05-28T00:38:42.454903+00:00 app[web.1]: [2019-05-28 00:38:42] FATAL SignalException: SIGTERM
2019-05-28T00:38:42.454915+00:00 app[web.1]: /app/vendor/ruby-2.5.3/lib/ruby/2.5.0/webrick/server.rb:170:in `select'
2019-05-28T00:38:42.454918+00:00 app[web.1]: /app/vendor/ruby-2.5.3/lib/ruby/2.5.0/webrick/server.rb:170:in `block in start'
2019-05-28T00:38:42.454920+00:00 app[web.1]: /app/vendor/ruby-2.5.3/lib/ruby/2.5.0/webrick/server.rb:32:in `start'
2019-05-28T00:38:42.454922+00:00 app[web.1]: /app/vendor/ruby-2.5.3/lib/ruby/2.5.0/webrick/server.rb:157:in `start'
2019-05-28T00:38:42.454924+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.7/lib/rack/handler/webrick.rb:34:in `run'
2019-05-28T00:38:42.454925+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.7/lib/rack/server.rb:297:in `start'
2019-05-28T00:38:42.454927+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.7/lib/rack/server.rb:148:in `start'
2019-05-28T00:38:42.454929+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.7/bin/rackup:4:in `<top (required)>'
2019-05-28T00:38:42.454930+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/bin/rackup:23:in `load'
2019-05-28T00:38:42.454932+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/bin/rackup:23:in `<top (required)>'
2019-05-28T00:38:42.454934+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/bundler-2.0.1/lib/bundler/cli/exec.rb:74:in `load'
2019-05-28T00:38:42.454935+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/bundler-2.0.1/lib/bundler/cli/exec.rb:74:in `kernel_load'
2019-05-28T00:38:42.454937+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/bundler-2.0.1/lib/bundler/cli/exec.rb:28:in `run'
2019-05-28T00:38:42.454938+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/bundler-2.0.1/lib/bundler/cli.rb:463:in `exec'
2019-05-28T00:38:42.454941+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/bundler-2.0.1/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
2019-05-28T00:38:42.454943+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/bundler-2.0.1/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
2019-05-28T00:38:42.454945+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/bundler-2.0.1/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
2019-05-28T00:38:42.454946+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/bundler-2.0.1/lib/bundler/cli.rb:27:in `dispatch'
2019-05-28T00:38:42.454948+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/bundler-2.0.1/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
2019-05-28T00:38:42.454950+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/bundler-2.0.1/lib/bundler/cli.rb:18:in `start'
2019-05-28T00:38:42.454951+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/bundler-2.0.1/exe/bundle:30:in `block in <top (required)>'
2019-05-28T00:38:42.454953+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/bundler-2.0.1/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
2019-05-28T00:38:42.454955+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/bundler-2.0.1/exe/bundle:22:in `<top (required)>'
2019-05-28T00:38:42.454957+00:00 app[web.1]: /app/vendor/bundle/bin/bundle:104:in `load'
2019-05-28T00:38:42.454959+00:00 app[web.1]: /app/vendor/bundle/bin/bundle:104:in `<main>'
2019-05-28T00:38:42.455103+00:00 app[web.1]: [2019-05-28 00:38:42] INFO  going to shutdown ...
2019-05-28T00:38:42.455170+00:00 app[web.1]: [2019-05-28 00:38:42] INFO  WEBrick::HTTPServer#start done.
2019-05-28T00:38:42.550934+00:00 heroku[web.1]: Process exited with status 143
2019-05-28T00:50:23.786118+00:00 heroku[web.1]: Unidling
2019-05-28T00:50:23.793546+00:00 heroku[web.1]: State changed from down to starting
2019-05-28T00:50:25.542859+00:00 heroku[web.1]: Starting process with command `bundle exec rackup config.ru -p 42874`
2019-05-28T00:50:28.119726+00:00 app[web.1]: [2019-05-28 00:50:28] INFO  WEBrick 1.4.2
2019-05-28T00:50:28.119756+00:00 app[web.1]: [2019-05-28 00:50:28] INFO  ruby 2.5.3 (2018-10-18) [x86_64-linux]
2019-05-28T00:50:28.120050+00:00 app[web.1]: [2019-05-28 00:50:28] INFO  WEBrick::HTTPServer#start: pid=4 port=42874
2019-05-28T00:50:29.192749+00:00 heroku[web.1]: State changed from starting to up
2019-05-28T00:50:31.809566+00:00 app[web.1]: 2019-05-28 00:50:31 - NoMethodError - undefined method `utc' for #<Date: 2019-05-31 ((2458635j,0s,0n),+0s,2299161j)>:
2019-05-28T00:50:31.809594+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/almanack-1.1.2/lib/almanack/representation/ical_feed.rb:37:in `ical_event_for'
2019-05-28T00:50:31.809596+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/almanack-1.1.2/lib/almanack/representation/ical_feed.rb:30:in `block in ical_calendar'
2019-05-28T00:50:31.809599+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/almanack-1.1.2/lib/almanack/representation/ical_feed.rb:29:in `each'
2019-05-28T00:50:31.809600+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/almanack-1.1.2/lib/almanack/representation/ical_feed.rb:29:in `each_with_object'
2019-05-28T00:50:31.809602+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/almanack-1.1.2/lib/almanack/representation/ical_feed.rb:29:in `ical_calendar'
2019-05-28T00:50:31.809604+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/almanack-1.1.2/lib/almanack/representation/ical_feed.rb:11:in `ical'
2019-05-28T00:50:31.809606+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/almanack-1.1.2/lib/almanack/representation/ical_feed.rb:15:in `to_s'
2019-05-28T00:50:31.809608+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/almanack-1.1.2/lib/almanack/calendar.rb:32:in `ical_feed'
2019-05-28T00:50:31.809610+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/almanack-1.1.2/lib/almanack/server.rb:48:in `block in <class:Server>'
2019-05-28T00:50:31.809612+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:1635:in `call'
2019-05-28T00:50:31.809613+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:1635:in `block in compile!'
2019-05-28T00:50:31.809615+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:992:in `block (3 levels) in route!'
2019-05-28T00:50:31.809617+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:1011:in `route_eval'
2019-05-28T00:50:31.809618+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:992:in `block (2 levels) in route!'
2019-05-28T00:50:31.809620+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:1040:in `block in process_route'
2019-05-28T00:50:31.809622+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:1038:in `catch'
2019-05-28T00:50:31.809624+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:1038:in `process_route'
2019-05-28T00:50:31.809625+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:990:in `block in route!'
2019-05-28T00:50:31.809627+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:989:in `each'
2019-05-28T00:50:31.809628+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:989:in `route!'
2019-05-28T00:50:31.809630+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:1097:in `block in dispatch!'
2019-05-28T00:50:31.809631+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:1076:in `block in invoke'
2019-05-28T00:50:31.809633+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:1076:in `catch'
2019-05-28T00:50:31.809635+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:1076:in `invoke'
2019-05-28T00:50:31.809636+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:1094:in `dispatch!'
2019-05-28T00:50:31.809638+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:924:in `block in call!'
2019-05-28T00:50:31.809639+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:1076:in `block in invoke'
2019-05-28T00:50:31.809641+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:1076:in `catch'
2019-05-28T00:50:31.809642+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:1076:in `invoke'
2019-05-28T00:50:31.809644+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:924:in `call!'
2019-05-28T00:50:31.809645+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:913:in `call'
2019-05-28T00:50:31.809647+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/rack-contrib-2.1.0/lib/rack/contrib/jsonp.rb:37:in `call'
2019-05-28T00:50:31.809648+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/rack-protection-2.0.5/lib/rack/protection/xss_header.rb:18:in `call'
2019-05-28T00:50:31.809650+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/rack-protection-2.0.5/lib/rack/protection/path_traversal.rb:16:in `call'
2019-05-28T00:50:31.809654+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/rack-protection-2.0.5/lib/rack/protection/json_csrf.rb:26:in `call'
2019-05-28T00:50:31.809656+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/rack-protection-2.0.5/lib/rack/protection/base.rb:50:in `call'
2019-05-28T00:50:31.809657+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/rack-protection-2.0.5/lib/rack/protection/base.rb:50:in `call'
2019-05-28T00:50:31.809659+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.7/lib/rack/null_logger.rb:9:in `call'
2019-05-28T00:50:31.809662+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.7/lib/rack/head.rb:12:in `call'
2019-05-28T00:50:31.809663+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:194:in `call'
2019-05-28T00:50:31.809665+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:1957:in `call'
2019-05-28T00:50:31.809673+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:1502:in `block in call'
2019-05-28T00:50:31.809675+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:1729:in `synchronize'
2019-05-28T00:50:31.809676+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:1502:in `call'
2019-05-28T00:50:31.809678+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.7/lib/rack/handler/webrick.rb:86:in `service'
2019-05-28T00:50:31.809679+00:00 app[web.1]: /app/vendor/ruby-2.5.3/lib/ruby/2.5.0/webrick/httpserver.rb:140:in `service'
2019-05-28T00:50:31.809681+00:00 app[web.1]: /app/vendor/ruby-2.5.3/lib/ruby/2.5.0/webrick/httpserver.rb:96:in `run'
2019-05-28T00:50:31.809682+00:00 app[web.1]: /app/vendor/ruby-2.5.3/lib/ruby/2.5.0/webrick/server.rb:307:in `block in start_thread'
2019-05-28T00:50:31.818820+00:00 heroku[router]: at=info method=HEAD path="/feed.ics" host=gentle-shelf-11243.herokuapp.com request_id=f9696d5d-9d63-43c6-9430-4c5a58e033bf fwd="108.30.172.54" dyno=web.1 connect=2ms service=939ms status=500 bytes=239 protocol=https
Aupajo commented 5 years ago

@steveb85 Hmm, okay so this issue is the same as #21.

Is it possible your calendar contains an “all-day” event?

I think there's two solutions to this:

  1. Handle Date values
  2. Alter error handling behaviour in general so that single event parsing to cause the whole thing to fail

Should be relatively easy to solve both. I'll see if I can find some time to fix it.

steveb85 commented 5 years ago

@Aupajo thanks! yes, it does have all day events. I didn't even pick up that it could be linked to #21 really appreciate it.

Aupajo commented 5 years ago

Hey @steveb85! Sorry it's taken a little while – had a crazy busy couple of weeks.

I think I've fixed this issue now. If you modify your Gemfile to read:

gem 'almanack', '1.1.3.rc1'

And run bundle install, I think this should fix your issue.

Let me know if it does, and I'll release a new version.

steveb85 commented 5 years ago

@Aupajo sorry for the delay, I updated as you suggested, and it didn't seem to change the problem, same result, I did notice however, that none of the events are displaying the time just the date, and that is weird, to help out, i've changed any events on my calendar that are "all day" events and it still seems to be causing issues.

steveb85 commented 5 years ago

I double checked and the heroku app is using 1.1.3.rc1 now, but same problem

Aupajo commented 5 years ago

@steveb85 Darn. Are you still getting this error in your stack trace?

NoMethodError - undefined method `utc' for #<Date: 2019-05-31 ((2458635j,0s,0n),+0s,2299161j)>
steveb85 commented 5 years ago

did something change @Aupajo ?? i just went through and it's working now. everything seems to be as expected! thanks, you're the best! I assume you'll release as a full update now?

steveb85 commented 5 years ago

@Aupajo turns out the problem was the outlook calendar uses UTC timezone information which was causing the problem, without that calendar in the mix it was fine

Aupajo commented 5 years ago

Awesome, glad this is working for you @steveb85!

I've just released 1.1.3. To keep things up-to-date in the future, update your Gemfile with:

gem 'almanack', '~> 1.1'

…and run bundle update to keep it up-to-date in the future.

I'm curious to learn more about the problem. If you a version the iCal feed, I might be able to look through it and figure out why this error happens.

steveb85 commented 5 years ago

@Aupajo Thanks heaps. I can email you the ical feed, but it seems to me that they use different time zones, exchange uses UTC which isn't recognized by the tzinfo which prefered the method that identified "America/New_York" let me know if you'd like me to email through the ical feed to check out yourself. really appreciate it!

Aupajo commented 5 years ago

Thanks, yeah that'd be helpful!

steveb85 commented 5 years ago

sent thanks @Aupajo appreciate it! stay well