You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
sagemaker_config related Networking bugs in ModelTrainer #5766
Networkingsecurity_group_ids not successfully added here in a silent bug.
if self.networking.subnets is None:
self.networking.subnets = self.config_mgr.resolve_value_from_config(
config_path=TRAINING_JOB_SUBNETS_PATH
)
if self.networking.security_group_ids is None:
self.networking.subnets = self.config_mgr.resolve_value_from_config(
config_path=TRAINING_JOB_SUBNETS_PATH
)
To reproduce
from sagemaker.core.helper.session_helper import Session
from sagemaker.train.model_trainer import ModelTrainer
sagemaker_config = {
"SageMaker": {
"TrainingJob": {
"VpcConfig": {
"SecurityGroupIds": ["sg-blah"],
"Subnets": ["subnet-blah"]
}
}
},
"SchemaVersion": "1.0",
}
sagemaker_session = Session(sagemaker_config=sagemaker_config)
model_trainer = ModelTrainer(
training_image="685385470294.dkr.ecr.eu-west-1.amazonaws.com/sagemaker-xgboost:1.7-1",
sagemaker_session=sagemaker_session,
)
# Error occurs here when SDK tries to instantiate Networking
model_trainer.train(input_data_config={})
ValidationError: 1 validation error for Networking
default_enable_network_isolation
Extra inputs are not permitted [type=extra_forbidden, input_value=None, input_type=NoneType]
For further information visit https://errors.pydantic.dev/2.13/v/extra_forbidden
Expected behavior sagemaker_config variables to be successfully added to ModelTrainer.
changed the title [-]Fix `sagemaker_config` related `Networking` bugs in `ModelTrainer`[/-][+]`sagemaker_config` related `Networking` bugs in `ModelTrainer`[/+]on Apr 16, 2026
Both Networking bugs are fixed in #6064, released in v3.17.0.
The ValidationError was caused by passing default_enable_network_isolation= to the Networking constructor; it now correctly uses enable_network_isolation=.
The silent bug where the security_group_ids branch wrote to subnets (and read the subnets config path) is corrected to assign security_group_ids from TRAINING_JOB_SECURITY_GROUP_IDS_PATH.
Your repro (VpcConfig from sagemaker_config) now populates ModelTrainer networking correctly. Please upgrade to v3.17.0 or later. Closing as resolved.
Activity
[-]Fix `sagemaker_config` related `Networking` bugs in `ModelTrainer`[/-][+]`sagemaker_config` related `Networking` bugs in `ModelTrainer`[/+]sandbox: iteration 1 for issue #5766
sandbox: iteration 1 for issue #5766
sandbox: iteration 1 for issue #5766
fix(train): correct Networking field names in ModelTrainer intelligen…
mohamedzeidan2021 commentedon Sep 1, 2026
Both Networking bugs are fixed in #6064, released in v3.17.0.
ValidationErrorwas caused by passingdefault_enable_network_isolation=to theNetworkingconstructor; it now correctly usesenable_network_isolation=.security_group_idsbranch wrote tosubnets(and read the subnets config path) is corrected to assignsecurity_group_idsfromTRAINING_JOB_SECURITY_GROUP_IDS_PATH.Your repro (VpcConfig from
sagemaker_config) now populatesModelTrainernetworking correctly. Please upgrade to v3.17.0 or later. Closing as resolved.