Web portal error after 0.80 upgrade

2020-07-06 02:13:21 ERROR - Error in Web Request: client= error=undefined method []' for nil:NilClass backtrace=["/home/ares/aresmush/plugins/profile/web/character_groups_request_handler.rb:32:in block in handle’", “/home/ares/aresmush/plugins/profile/web/character_groups_request_handler.rb:20:in each'", "/home/ares/aresmush/plugins/profile/web/character_groups_request_handler.rb:20:in each_with_index’”, “/home/ares/aresmush/plugins/profile/web/character_groups_request_handler.rb:20:in handle'", "/home/ares/aresmush/engine/aresmush/commands/dispatcher.rb:145:in block (2 levels) in on_web_request’”, “/home/ares/aresmush/engine/aresmush/commands/dispatcher.rb:139:in each'", "/home/ares/aresmush/engine/aresmush/commands/dispatcher.rb:139:in block in on_web_request’”, “/home/ares/aresmush/engine/aresmush/error_block.rb:6:in with_error_handling'", "/home/ares/aresmush/engine/aresmush/commands/dispatcher.rb:138:in on_web_request’”, “/home/ares/aresmush/engine/aresmush/web/engine_api_server.rb:89:in `block in handle_request’”]
2020-07-06 02:13:21 ERROR - Unhandled web request: {“cmd”=>“characterGroups”, “api_key”=>"", “auth”=>{“authenticator”=>“authenticator:ares”, “token”=>"", “name”=>“August”, “id”=>“153”, “is_approved”=>“true”, “is_admin”=>“false”, “is_coder”=>“false”}}.

The exception’s coming from here:

  if (subgroup_key.blank?)
    subgroup_order = [ '' ]
  else
    subgroup_order = Demographics.all_groups[subgroup_key]["values"].keys || [ ]
  end

Any chance that second array needs to be [’’] too?

Ah ha, figured it out. The default for character_gallery_subgroup is false, which config treats as a boolean, yet the config setup complains if it’s not a string that it needs to be one. I tried to use Position and it definitely didn’t like that (‘Position is not a valid category’ was the error, I think), so I set it to the same value as character_gallery_group and that fixed it, sort of–no more error, though it lists the Group Category name twice now.

1 Like

Glad you sorted it out.

Not sure what you mean by this though:

The default is actually ‘Position’, and if you delete it (which is how you end up with ‘false’), you get a config warning when you try to save:

  • website:character_gallery_subgroup must be a text string.

You can make it an empty string if you don’t want a secondary sorting. Just set it to ''.

Just to clarify: @Grimdarque has taken over GH, so he’s dealing with all my weird shit. :slight_smile:

If you delete that config option, then save it, it changes it to ‘false’ but still saves. Before the config error check, there was nothing that told me that I wasn’t allowed to do that, and it worked just fine, so it’s always been like that on GH, as the game never had a subgroup sorting characters.

It might be worth adding the call-out to set it to ‘’ rather than just delete it to the config tutorial, as I would just have assumed a second sort option was mandatory now.

1 Like

Yeah, the system isn’t really designed to work with missing config options. Sometimes it might work by accident. The new config check system should protect you against accidentally deleting things in the future though.

1 Like

Ah, ty, that explains it! I ran through and fixed most of the other ones; there’s a whole slew of combat complaints which…at some point, I’ll do, but as we don’t do much with vehicle combat I am going to be lazy about them.

1 Like

If you’re not really using vehicles, you could just copy the vehicle config wholesale from default.
Just use the Advanced config editor and copy/paste the default installation file contents: https://github.com/AresMUSH/aresmush/tree/master/install/game.distr/config

I’m getting this error since upgrading to .80 as well and repeating the category group is not fixing the issue for me.

There are two similar errors that a couple folks have seen.

  1. Subgroup is nil. Make it an empty text string instead. ''
  2. Either the group or subgroup you’re using is a freeform group that doesn’t have a fixed list of values. This is just a bug. As a temporary workaround you can just create a list of values for the group. It’ll be fixed in the next patch.

Tried both of those approaches and I’m still getting the error unfortunately.

Can you show me the specific error trace from the debug log, and also the relevant config? (the gallery group/subgroup and the relevant groups)

Sure thing. For us it’s not a huge deal at the moment as we’re in development. I’m just not sure why one of the above fixes didn’t work for us.

2020-07-08 01:30:44 ERROR - Error in Web Request: client= error=undefined method []' for nil:NilClass backtrace=["/home/ares/aresmush/plugins/profile/web/character_groups_request_handler.rb:17:in handle’", “/home/ares/aresmush/engine/aresmush/commands/dispatcher.rb:145:in block (2 levels) in on_web_request'", "/home/ares/aresmush/engine/aresmush/commands/dispatcher.rb:139:in each’”, “/home/ares/aresmush/engine/aresmush/commands/dispatcher.rb:139:in block in on_web_request'", "/home/ares/aresmush/engine/aresmush/error_block.rb:6:in with_error_handling’”, “/home/ares/aresmush/engine/aresmush/commands/dispatcher.rb:138:in on_web_request'", "/home/ares/aresmush/engine/aresmush/web/engine_api_server.rb:89:in block in handle_request’”, “/home/ares/aresmush/engine/aresmush/error_block.rb:6:in with_error_handling'", "/home/ares/aresmush/engine/aresmush/web/engine_api_server.rb:81:in handle_request’”, “/home/ares/aresmush/engine/aresmush/web/engine_api_server.rb:66:in `block in class:EngineApiServer’”]

Group are set up like so(I actually don’t want a sub-group, I was just trying to use it to get the directory to work at all)

>   groups:
    Heritage:
      desc: What you are.
      wiki: ''
      values:
        Mortal: 
        Vampire: 
    Occupation:
      desc: What you do.
      wiki: ''
      Values:
        Barrista: The only job available right now.

The gallery is set up like this at the moment(though I’d like to remove Occupation entirely):

  character_gallery_group: heritage
  character_gallery_subgroup: occupation

I think the issue is that your Heritage values don’t have descriptions. The descriptions can be blank strings ('') but I don’t think they can be missing.

Also I’m not sure if these are copy/paste artifacts, but the groups aren’t indented properly and Occupation lists “Values” (capitalized) instead of “values”). Those may or may not be related.

So I think what you want is:

groups:
    Heritage:
      desc: What you are.
      wiki: ''
      values:
        Mortal: The mortals.
        Vampire:  The vamps.
    Occupation:
      desc: What you do.
      wiki: ''
      values:
        Barrista: The only job available right now.

Then in the web config:

  character_gallery_group: Heritage
  character_gallery_subgroup: ''

I just got it working. Stripped out the sub-groups entirely and then capitalized Heritage in character_gallery_group and that seems to work. Looks like the code wants things to be case sensitive now between the various files(they weren’t before and it worked).

1 Like

Yeah it’s not meant to be case-sensitive but I think it accidentally is.