ICS Feed Broken: Unable to find feed data cached for key instance
I had enabled RSS + ICS feeds on my instance. These worked fine on v3.2.0.
After updating to v4.0.2, only the RSS feed (/feed/instance/rss) works, and the ICS feed (/feed/instance/ics) produces a 404 error and the following log entry:
21:48:18 localhost mobilizon[855706]: 21:48:18.544 request_id=... [info] GET /feed/instance/ics
21:48:18 localhost mobilizon[855706]: 21:48:18.583 request_id=... [warning] Unable to find feed data cached for key instance, returned
{
:error, %Cachex.ExecutionError{
message: "no function clause matching in String.replace/4",
stack: [
{
String, :replace, [nil, ~r/<li>/, "\\g{1}- ", [global: true]],
[file: ~c"lib/string.ex", line: 1520]
},
{
Mobilizon.Service.Formatter.HTML,
:html_to_text,
1,
[file: ~c"lib/service/formatter/html.ex", line: 47]
},
{Mobilizon.Service.Export.ICalendar,
:do_export_event,
1,
[file: ~c"lib/service/export/icalendar.ex", line: 127]
},
{
Enum,
:"-map/2-lists^map/1-1-",
2,
[file: ~c"lib/enum.ex", line: 1693]
},
{
Mobilizon.Service.Export.ICalendar,
:fetch_instance_feed,
0,
[file: ~c"lib/service/export/icalendar.ex", line: 66]
},
{
Mobilizon.Service.Export.ICalendar,
:create_cache,
1,
[file: ~c"lib/service/export/icalendar.ex", line: 59]
},
{
Cachex.Services.Courier,
:"-handle_call/3-fun-0-",
5,
[file: ~c"lib/cachex/services/courier.ex", line: 77]
},
{
Cachex.Services.Courier,
:dispatch,
3,
[file: ~c"lib/cachex/services/courier.ex", line: 44]
},
{
Cachex,
:fetch,
4,
[file: ~c"lib/cachex.ex", line: 693]
},
{
Mobilizon.Web.FeedController,
:return_data,
4,
[file: ~c"lib/web/controllers/feed_controller.ex", line: 74]
},
{
Mobilizon.Web.FeedController,
:action,
2,
[file: ~c"lib/web/controllers/feed_controller.ex", line: 1]
},
{
Mobilizon.Web.FeedController,
:phoenix_controller_pipeline,
2,
[file: ~c"lib/web/controllers/feed_controller.ex", line: 1]
},
{
Phoenix.Router,
:__call__,
5,
[file: ~c"lib/phoenix/router.ex", line: 432]
}
]
}
}
21:48:18 localhost mobilizon[855706]: 21:48:18.585 request_id=... [info] Sent 404 in 40ms
Something is happening is at this line. It tries to call String.replace
on a nil
value. Somebody did create an event with no description, so maybe that is why the event.description
is nil
for one of the events that gets parsed.
The issue does not happen with the RSS feed, so maybe we can use the same method as here to make sure we are not passing a nil
value to HTML.html_to_text
.
Edited by na bla