Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't add feed without title #744

Closed
guidopetri opened this issue Dec 27, 2022 · 5 comments · Fixed by #746
Closed

Can't add feed without title #744

guidopetri opened this issue Dec 27, 2022 · 5 comments · Fixed by #746

Comments

@guidopetri
Copy link
Collaborator

guidopetri commented Dec 27, 2022

I'm trying to add this feed which seemingly doesn't have a title, but I'm getting a 500 Internal Server Error whenever I try.

Logs
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: 2022-12-27 15:13:45 - NoMethodError - undefined method `gsub' for nil:NilClass:
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/stringer/app/utils/content_sanitizer.rb:3:in `sanitize'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/stringer/app/commands/feeds/add_new_feed.rb:12:in `add'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/stringer/app/controllers/feeds_controller.rb:40:in `block in <class:Stringer>'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1675:in `call'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1675:in `block in compile!'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1013:in `block (3 levels) in route!'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1032:in `route_eval'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1013:in `block (2 levels) in route!'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1061:in `block in process_route'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1059:in `catch'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1059:in `process_route'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1011:in `block in route!'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1008:in `each'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1008:in `route!'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1129:in `block in dispatch!'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1101:in `block in invoke'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1101:in `catch'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1101:in `invoke'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1124:in `dispatch!'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:939:in `block in call!'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1101:in `block in invoke'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1101:in `catch'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1101:in `invoke'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:939:in `call!'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:929:in `call'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rack-protection-2.1.0/lib/rack/protection/xss_header.rb:18:in `call'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rack-protection-2.1.0/lib/rack/protection/base.rb:50:in `call'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rack-protection-2.1.0/lib/rack/protection/base.rb:50:in `call'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rack-protection-2.1.0/lib/rack/protection/path_traversal.rb:16:in `call'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rack-protection-2.1.0/lib/rack/protection/json_csrf.rb:26:in `call'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rack-protection-2.1.0/lib/rack/protection/base.rb:50:in `call'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rack-protection-2.1.0/lib/rack/protection/base.rb:50:in `call'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rack-protection-2.1.0/lib/rack/protection/frame_options.rb:31:in `call'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/session/abstract/id.rb:266:in `context'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/session/abstract/id.rb:260:in `call'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/logger.rb:17:in `call'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/common_logger.rb:38:in `call'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:253:in `call'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:246:in `call'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/head.rb:12:in `call'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/method_override.rb:24:in `call'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:216:in `call'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1991:in `call'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1542:in `block in call'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1769:in `synchronize'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1542:in `call'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/urlmap.rb:74:in `block in call'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/urlmap.rb:58:in `each'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/urlmap.rb:58:in `call'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/unicorn-6.0.0/lib/unicorn/http_server.rb:634:in `process_client'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/unicorn-6.0.0/lib/unicorn/http_server.rb:732:in `worker_loop'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/unicorn-6.0.0/lib/unicorn/http_server.rb:547:in `spawn_missing_workers'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/unicorn-6.0.0/lib/unicorn/http_server.rb:143:in `start'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/unicorn-6.0.0/bin/unicorn:128:in `<top (required)>'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/bin/unicorn:23:in `load'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/bin/unicorn:23:in `<top (required)>'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-2.2.24/lib/bundler/cli/exec.rb:63:in `load'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-2.2.24/lib/bundler/cli/exec.rb:63:in `kernel_load'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-2.2.24/lib/bundler/cli/exec.rb:28:in `run'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-2.2.24/lib/bundler/cli.rb:475:in `exec'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-2.2.24/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-2.2.24/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-2.2.24/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-2.2.24/lib/bundler/cli.rb:31:in `dispatch'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-2.2.24/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-2.2.24/lib/bundler/cli.rb:25:in `start'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-2.2.24/exe/bundle:49:in `block in <top (required)>'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-2.2.24/lib/bundler/friendly_errors.rb:128:in `with_friendly_errors'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-2.2.24/exe/bundle:37:in `<top (required)>'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/bin/bundle:23:in `load'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: #011/home/stringer/.rbenv/versions/2.7.2/bin/bundle:23:in `<main>'
Dec 27 15:13:45 vps stringer-web.1.service[1524212]: 24.143.53.19 - - [27/Dec/2022:15:13:45 -0500] "POST /feeds HTTP/1.1" 500 30 0.9183

As far as I can tell, the only place that uses gsub is in the ContentSanitizer class, which seems to be called on feed titles. Is this as easy of a fix as just adding a default / checking for existence of a title?

mockdeep added a commit that referenced this issue Dec 28, 2022
Use the URL in its place.

Fixes #744.
@mockdeep
Copy link
Collaborator

@guidopetri thanks for reporting! Can you give it another try? I've updated the new feed logic to fall back to using the URL for the feed name.

@guidopetri
Copy link
Collaborator Author

I don't have the easiest way of testing (I'm transitioning from a VPS to a local server setup with Docker) but I'll definitely try it out when I can. Thanks for the quick fix!

@mockdeep
Copy link
Collaborator

@guidopetri I'm curious, is it important to you to host your own instance? I'm thinking of setting up a service people can subscribe to so they don't have to set up Stringer themselves.

@guidopetri
Copy link
Collaborator Author

For me? yeah. I really value being in control of my data myself, even for something tiny like this :)

That being said I've seen quite a few services that are similarly able to self-host, but also subscribable for an easy setup (e.g.: Redash used to be that way, as is Monica CRM currently). I think it'd be a good value-add, and an easy way to infuse some money into the repo to fund e.g. bug bounties or new features.

@mockdeep
Copy link
Collaborator

Thanks, that's helpful. At any rate, if you do manage to get things updated on your end, any updates to the docs would be much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants