Skip to content

Resources server initialization does not populate domain field #366

Closed

Description

Describe the bug

When ng_init_resources_server is run to initialize a resources server, the configuration that is created for the new resources server does not include a value for the required field domain.

Steps/Code to reproduce bug

Run ng_init_resources_server to initialize a resources server. Then run ng_run to try to run the new resources server. An error message such as the following is printed:

═══════════════════════════════════════════════════
Configuration Warnings: Almost-Servers Detected                                             
═══════════════════════════════════════════════════                                                                                                                                                                                                                                 
    Almost-Server Detected: 'test_server_resources_server'                                  
    This server configuration failed validation:                                                                                                                                        
                                                                                            
  - function-after: Assertion failed, A domain is required for resource servers.            
                                                                                                                                                                                        
    This server will NOT be started.                                                        
                                                                                            
═══════════════════════════════════════════════════                                         

Expected behavior

When initializing a resources server, it would probably be reasonable to populate the domain field with a default allowed value so that the configuration that is generated can be used without further modifications.

Activity

  1. added theissue type on Nov 21, 2025
  2. added
    core-infra
    on Nov 21, 2025
  3. ffrujeri commented on Nov 25, 2025

    @ffrujeri
    Contributor

    I am trying to repro and understand the flow of this bug here.
    I am following the FAQ tutorial here, first calling:
    ng_init_resources_server +entrypoint=resources_servers/test_weather

    Those docs are a little incomplete, so, if I just follow the example in
    resources_servers/example_simple_weather/app.py

    I cannot reproduce the issue.

    So maybe @damon-mosk-aoyama-nvidia, could you share a reproducer a little bit more detailed? Thank you!

    I do see that the domain is missing on the init_resources_server() method.

    def init_resources_server():  # pragma: no cover
        config_dict = get_global_config_dict()
        run_config = RunConfig.model_validate(config_dict)
    
        if exists(run_config.entrypoint):
            print(f"Folder already exists: {run_config.entrypoint}. Exiting init.")
            exit()
    
        dirpath = Path(run_config.entrypoint)
        assert len(dirpath.parts) == 2
        makedirs(dirpath)
    
        server_type = dirpath.parts[0]
        assert server_type == "resources_servers"
        server_type_name = dirpath.parts[-1].lower()
        server_type_title = "".join(x.capitalize() for x in server_type_name.split("_"))
    
        configs_dirpath = dirpath / "configs"
        makedirs(configs_dirpath)
    
        config_fpath = configs_dirpath / f"{server_type_name}.yaml"
        with open(config_fpath, "w") as f:
            f.write(f"""{server_type_name}_resources_server:
      {server_type}:
        {server_type_name}:
          entrypoint: app.py
          domain: other                 <<<<<< MISSING
    

    Also @cwing-nvidia / @bxyu-nvidia , we need to create an issue / workitem specifically to improve this ng_init_resources_server tutorial, it is quite incomplete.

    For now I created #407

  4. damon-mosk-aoyama-nvidia commented on Dec 1, 2025

    @damon-mosk-aoyama-nvidia
    ContributorAuthor

    I ran the command

    ng_init_resources_server +entrypoint=resources_servers/test_server
    

    to initialize a resource server. Then I ran the command

    ng_run "+config_paths=[resources_servers/test_server/configs/test_server.yaml,responses_api_models/openai_model/configs/openai_model.yaml]"
    

    to run the new resources server, and the command failed with the error mentioned above.

  5. linked a pull request that will close this issuedocs: Add Create Resource Server Tutorial #407on Dec 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

core-infra

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions