SDK — Troubleshooting

Known failure modes with actionable fixes — auth, storage, submission, source extraction, networking, notebooks.

Auth

ResonAuthError: No platform api key

platform_api_key= was omitted and RESON_API_KEY isn't set. Mint one from Profile → Developer and either pass it on the config or export the env var.

ResonAuthError: Wrong API-key type

You passed a predict key (opaque, no rsk_ prefix) where the SDK expected a platform key. Predict keys go on InferenceClient(predict_api_key=...) and ride in X-API-Key; platform keys go on ResonTechConfig(platform_api_key=...) and ride in Authorization: Bearer.

401 invalid_api_key

Key was revoked, expired, or never valid. Rotation takes effect within seconds: if you just rotated, wait a moment, then retry. Otherwise, mint a fresh key from Profile → Developer.

ResonTechError: Cannot reach <base_url>

Almost always a wrong base_url. Open it in a browser — a healthy deployment returns a 404 page, not a login portal or a blank 200.

Storage / Bucket

StorageError: No S3 bucket configured

You haven't provisioned a bucket yet. Open the web UI → Profile → Storage → Provision Bucket, pick an alias and quota, and paste the returned secret into ResonTechConfig.

StorageError: Could not resolve your storage bucket

Your key works, but no bucket is attached to your account yet. The fix is the same: provision a bucket from Profile → Storage → Provision Bucket.

StorageError: s3_access_key_id and s3_secret_access_key are required

You constructed ResonTechConfig with empty strings. Pass both values before creating ResonTech(config).

StorageError: … AccessDenied

Credentials in s3_access_key_id / s3_secret_access_key don't match the bucket on your account. Rotate the key from Profile → Storage → Rotate Key and update your config.

StorageError: … InvalidAccessKeyId

The access key no longer exists. Someone (maybe you) already rotated it. Rotate again to get a fresh pair.

Slow or stalled shard upload

Check your upstream bandwidth. The SDK prints per-file progress to stderr.

Submission

ValidationError: No shard zip files found in './shards'

shards_dir must contain at least one *.zip. The filename pattern is free-form — shard_0.zip, part-01.zip, anything with a .zip suffix works.

ValidationError: shards_dir is not a directory

Typo or wrong path — confirm Path(shards_dir).is_dir() locally first.

ValidationError: model_checkpoint must be a .pt file

The platform enforces exactly one .pt in model/. Rename or convert your checkpoint before passing it.

HTTP 400: Folder not found in your S3 bucket: "/jobs/foo/scripts"

The platform re-checks every path when you submit. This usually means an upload failed silently earlier: re-run rt_submit or inspect the bucket with sdk.storage.list("jobs/foo/").

HTTP 400: Shard count (5) does not match worker count (3)

You passed explicit worker_ids=[...] with a different length than the shard count. Either upload fewer shards or pass the right number of workers. When you omit worker_ids and let the platform select, the platform matches the worker count to your shard count.

Source Extraction

ValueError: Could not extract source of 'MyModel'

Happens in some notebook kernels where torch patches inspect. Workarounds: save the class to a .py file and set ModelConfig(model_class="my_module.MyModel"); or restart the kernel before importing torch and define the class first.

NameError: name 'nn' is not defined (server-side)

Imports live in a different cell from the class. Consolidate them into the same cell and resubmit. Applies to model=, executor=, persistor=.

NameError: name 'torch' is not defined on the worker

Same fix — put import torch in the same cell as your class.

Network / Infrastructure

ResonTechError: Cannot reach <base_url>

The platform is down or your network blocks it. Try the same URL in a browser.

Workers can't read your shards (403)

This is on our side: contact Support with the job id.

Uploads fail with InvalidRequest: The Content-Md5 you specified was invalid

Rare boto3 regression on old versions. Upgrade: pip install -U boto3 (≥ 1.34 required).

Jupyter / Notebook Issues

ModuleNotFoundError: No module named 'resontech'

The SDK is not visible to the Python the notebook kernel is running. Compare sys.executable inside the notebook against the Python that your SDK was installed into — they need to match. The example notebooks call sys.executable when wiring up dependencies to avoid this mismatch.

Where Do I See the Real Error?

warn
The dashboard job detail page (job.dashboard_url) is the source of truth for runtime errors. Worker logs, training stdout, Python tracebacks — they all end up there. The SDK only surfaces errors from the submission pipeline itself.