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

Potential unhandled exception in JSON processing #116

Open
vrthra opened this issue Nov 9, 2024 · 2 comments
Open

Potential unhandled exception in JSON processing #116

vrthra opened this issue Nov 9, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@vrthra
Copy link
Contributor

vrthra commented Nov 9, 2024

Observed this exception in the logs. It is not clear which message caused this though.

2024-11-09 05:36:42 UTC 200 GET /objects/hxWiJIe2XC4/remote-like 12.76ms                                                                                    
Exception: Cast from String to Array(T) failed, at /data/crystal-1.10.1-1/share/crystal/src/json/any.cr:262:5:262 (TypeCastError)                           
  from /data/crystal-1.10.1-1/share/crystal/src/json/any.cr:261:3 in 'as_a'                                                                                 
  from /data/rgop2232/ktistec-2.3.0/src/models/activity_pub/collection.cr:117:9 in 'map_items'                                                              
  from /data/rgop2232/ktistec-2.3.0/src/models/activity_pub/collection.cr:135:11 in 'map:default'                                                           
  from /data/rgop2232/ktistec-2.3.0/src/models/activity_pub.cr:13:5 in 'from_json_ld:default'                                                               
  from /data/rgop2232/ktistec-2.3.0/src/models/activity_pub/collection.cr:25:5 in 'from_json_ld'                                                            
  from /data/rgop2232/ktistec-2.3.0/src/models/activity_pub/collection.cr:141:11 in 'map:default'                                                           
  from /data/rgop2232/ktistec-2.3.0/src/models/activity_pub.cr:13:5 in 'from_json_ld:default'                                                               
  from /data/rgop2232/ktistec-2.3.0/src/models/activity_pub/collection.cr:25:5 in 'from_json_ld'                                                            
  from /data/rgop2232/ktistec-2.3.0/src/models/activity_pub/object.cr:701:11 in 'map'                                                                       
  from /data/rgop2232/ktistec-2.3.0/src/models/activity_pub.cr:13:5 in 'from_json_ld'                                                                       
  from /data/rgop2232/ktistec-2.3.0/src/models/activity_pub/activity.cr:96:11 in 'map:default'                                                              
  from /data/rgop2232/ktistec-2.3.0/src/models/activity_pub.cr:13:5 in 'from_json_ld:default'                                                               
  from /data/rgop2232/ktistec-2.3.0/src/models/activity_pub/activity.cr:26:5 in 'from_json_ld'                                                              
  from /data/rgop2232/ktistec-2.3.0/src/controllers/inboxes.cr:30:9 in '->'                                                                                 
  from /data/rgop2232/ktistec-2.3.0/lib/kemal/src/kemal/route.cr:12:26 in '->'                                                                              
  from /data/rgop2232/ktistec-2.3.0/lib/kemal/src/kemal/route_handler.cr:52:39 in 'process_request'                                                         
  from /data/rgop2232/ktistec-2.3.0/lib/kemal/src/kemal/route_handler.cr:17:7 in 'call'                                                                     
  from /data/crystal-1.10.1-1/share/crystal/src/http/server/handler.cr:30:7 in 'call_next'                                                                  
  from /data/rgop2232/ktistec-2.3.0/lib/kemal/src/kemal/websocket_handler.cr:13:14 in 'call'                                                                
  from /data/crystal-1.10.1-1/share/crystal/src/http/server/handler.cr:30:7 in 'call_next'                                                                  
  from /data/rgop2232/ktistec-2.3.0/src/handlers/canonical.cr:15:14 in 'call'                                                                               
  from /data/crystal-1.10.1-1/share/crystal/src/http/server/handler.cr:30:7 in 'call_next'                                                                  
  from /data/rgop2232/ktistec-2.3.0/src/framework/rewrite.cr:8:14 in 'call'                                                                                 
  from /data/crystal-1.10.1-1/share/crystal/src/http/server/handler.cr:30:7 in 'call_next'                                                                  
  from /data/rgop2232/ktistec-2.3.0/src/framework/method.cr:21:14 in 'call'                                                                                 
  from /data/crystal-1.10.1-1/share/crystal/src/http/server/handler.cr:30:7 in 'call_next'                                                                  
  from /data/rgop2232/ktistec-2.3.0/src/framework/csrf.cr:49:14 in 'call'                                                                                   
  from /data/crystal-1.10.1-1/share/crystal/src/http/server/handler.cr:30:7 in 'call_next'                                                                  
  from /data/rgop2232/ktistec-2.3.0/src/framework/auth.cr:13:14 in 'call'                                                                                   
  from /data/crystal-1.10.1-1/share/crystal/src/http/server/handler.cr:30:7 in 'call_next'                                                                  
  from /data/rgop2232/ktistec-2.3.0/lib/kemal/src/kemal/static_file_handler.cr:11:11 in 'call'                                                              
  from /data/crystal-1.10.1-1/share/crystal/src/http/server/handler.cr:30:7 in 'call_next'                                                                  
  from /data/rgop2232/ktistec-2.3.0/lib/kemal/src/kemal/exception_handler.cr:8:7 in 'call'                                                                  
  from /data/crystal-1.10.1-1/share/crystal/src/http/server/handler.cr:30:7 in 'call_next'                                                                  
  from /data/rgop2232/ktistec-2.3.0/lib/kemal/src/kemal/head_request_handler.cr:57:7 in 'call'                                                              
  from /data/crystal-1.10.1-1/share/crystal/src/http/server/handler.cr:30:7 in 'call_next'                                                                  
  from /data/crystal-1.10.1-1/share/crystal/src/time.cr:357:5 in 'call'                                                                                     
  from /data/crystal-1.10.1-1/share/crystal/src/http/server/handler.cr:30:7 in 'call_next'                                                                  
  from /data/rgop2232/ktistec-2.3.0/lib/kemal/src/kemal/init_handler.cr:15:7 in 'call'                                                                      
  from /data/crystal-1.10.1-1/share/crystal/src/http/server/request_processor.cr:51:11 in 'process'                                                         
  from /data/crystal-1.10.1-1/share/crystal/src/http/server.cr:521:5 in 'handle_client'                                                                     
  from /data/crystal-1.10.1-1/share/crystal/src/http/server.cr:451:5 in '->'                                                                                
  from /data/crystal-1.10.1-1/share/crystal/src/fiber.cr:146:11 in 'run'                                                                                    
  from /data/crystal-1.10.1-1/share/crystal/src/fiber.cr:98:34 in '->'                                                                                      
  from ???                             
@toddsundsted toddsundsted added the bug Something isn't working label Nov 22, 2024
@toddsundsted
Copy link
Owner

i haven't seen this one in my logs. it looks like someone sent an activity/object to your inbox with a collection that consisted of a string instead of an array of strings.

i'd like to get a look at this message. do you see this in the logs on a regular basis and can you tell where it's coming from? i can easily modify the code to just throw this away, but i'd like to handle it correctly if possible.

the error itself isn't a problem with the server, however.

@vrthra
Copy link
Contributor Author

vrthra commented Nov 23, 2024

I quickly checked my logs now. I do not see it in the recent logs. I will keep a watch for it, and update it here if I find this again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants