Skip to content

Commit 6ff3347

Browse files
Merge pull request #224750 from edebar01/patch-2
update troubleshooting doc again
2 parents a555889 + 48fac9c commit 6ff3347

File tree

1 file changed

+128
-55
lines changed

1 file changed

+128
-55
lines changed

articles/machine-learning/how-to-troubleshoot-environments.md

Lines changed: 128 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ This issue can happen when the name of your custom environment uses terms reserv
136136

137137
### *Docker issues*
138138

139-
*Applies to: Azure CLI & Python SDK v1 (Deprecated)*
139+
*Applies to: Azure CLI & Python SDK v1*
140140

141141
To create a new environment, you must use one of the following approaches (see [DockerSection](https://aka.ms/azureml/environment/environment-docker-section)):
142142
- Base image
@@ -165,7 +165,7 @@ To create a new environment, you must use one of the following approaches:
165165
- [Sample here](https://aka.ms/azureml/environment/create-env-conda-spec-v2)
166166

167167
### Missing Docker definition
168-
*Applies to: Azure CLI & Python SDK v1 (Deprecated)*
168+
*Applies to: Python SDK v1*
169169
<!--issueDescription-->
170170
This issue can happen when your environment definition is missing a `DockerSection.` This section configures settings related to the final Docker image built from your environment specification.
171171

@@ -195,16 +195,12 @@ myenv.docker.base_dockerfile = dockerfile
195195
**Resources**
196196
* [DockerSection](https://aka.ms/azureml/environment/environment-docker-section)
197197

198-
### Missing Docker build context location
199-
- If you're specifying a Docker build context as part of your environment build, you must provide the path of the build context directory
200-
- See [BuildContext](https://aka.ms/azureml/environment/build-context-class)
201-
202198
### Too many Docker options
203199
<!--issueDescription-->
204200

205201
**Potential causes:**
206202

207-
*Applies to: Azure CLI & Python SDK v1*
203+
*Applies to: Python SDK v1*
208204

209205
You have more than one of these Docker options specified in your environment definition
210206
- `base_image`
@@ -227,7 +223,7 @@ You have more than one of these Docker options specified in your environment def
227223

228224
Choose which Docker option you'd like to use to build your environment. Then set all other specified options to None.
229225

230-
*Applies to: Azure CLI & Python SDK v1*
226+
*Applies to: Python SDK v1*
231227

232228
```
233229
from azureml.core import Environment
@@ -248,7 +244,7 @@ myenv.docker.base_image = None
248244

249245
**Potential causes:**
250246

251-
*Applies to: Azure CLI & Python SDK v1*
247+
*Applies to: Python SDK v1*
252248

253249
You didn't specify one of the following options in your environment definition
254250
- `base_image`
@@ -271,15 +267,15 @@ You didn't specify one of the following options in your environment definition
271267

272268
Choose which Docker option you'd like to use to build your environment, then populate that option in your environment definition.
273269

274-
*Applies to: Azure CLI & Python SDK v1*
270+
*Applies to: Python SDK v1*
275271

276272
```
277273
from azureml.core import Environment
278274
myenv = Environment(name="myEnv")
279275
myenv.docker.base_image = "pytorch/pytorch:latest"
280276
```
281277

282-
*Applies to: Azure CLI & Python SDK v2*
278+
*Applies to: Python SDK v2*
283279

284280
```
285281
env_docker_image = Environment(
@@ -307,7 +303,7 @@ ml_client.environments.create_or_update(env_docker_image)
307303

308304
**Troubleshooting steps**
309305

310-
*Applies to: Python SDK azureml V1*
306+
*Applies to: Python SDK v1*
311307

312308
Add the missing username or password to your environment definition to fix the issue
313309

@@ -323,7 +319,7 @@ ws = Workspace.from_config()
323319
ws.set_connection("connection1", "ACR", "<URL>", "Basic", "{'Username': '<username>', 'Password': '<password>'}")
324320
```
325321

326-
*Applies to: Azure CLI extensions V1 & V2*
322+
*Applies to: Azure CLI extensions v1 & v2*
327323

328324
Create a workspace connection from a YAML specification file
329325

@@ -332,11 +328,11 @@ az ml connection create --file connection.yml --resource-group my-resource-group
332328
```
333329

334330
> [!NOTE]
335-
> * Providing credentials in your environment definition is deprecated. Use workspace connections instead.
331+
> * Providing credentials in your environment definition is no longer supported. Use workspace connections instead.
336332
337333
**Resources**
338-
* [Python SDK AzureML v1 workspace connections](https://aka.ms/azureml/environment/set-connection-v1)
339-
* [Python SDK AzureML v2 workspace connections](/python/api/azure-ai-ml/azure.ai.ml.entities.workspaceconnection)
334+
* [Python SDK v1 workspace connections](https://aka.ms/azureml/environment/set-connection-v1)
335+
* [Python SDK v2 workspace connections](/python/api/azure-ai-ml/azure.ai.ml.entities.workspaceconnection)
340336
* [Azure CLI workspace connections](/cli/azure/ml/connection)
341337

342338
### Multiple credentials for base image registry
@@ -352,7 +348,7 @@ az ml connection create --file connection.yml --resource-group my-resource-group
352348

353349
**Troubleshooting steps**
354350

355-
*Applies to: Python SDK azureml V1*
351+
*Applies to: Python SDK v1*
356352

357353
If you're using workspace connections, view the connections you have set, and delete whichever one(s) you don't want to use
358354

@@ -370,12 +366,12 @@ myEnv.docker.base_image_registry.registry_identity = None
370366
```
371367

372368
> [!NOTE]
373-
> * Providing credentials in your environment definition is deprecated. Use workspace connections instead.
369+
> * Providing credentials in your environment definition is no longer supported. Use workspace connections instead.
374370
375371
**Resources**
376372
* [Delete a workspace connection v1](https://aka.ms/azureml/environment/delete-connection-v1)
377-
* [Python SDK AzureML v1 workspace connections](https://aka.ms/azureml/environment/set-connection-v1)
378-
* [Python SDK AzureML v2 workspace connections](/python/api/azure-ai-ml/azure.ai.ml.entities.workspaceconnection)
373+
* [Python SDK v1 workspace connections](https://aka.ms/azureml/environment/set-connection-v1)
374+
* [Python SDK v2 workspace connections](/python/api/azure-ai-ml/azure.ai.ml.entities.workspaceconnection)
379375
* [Azure CLI workspace connections](/cli/azure/ml/connection)
380376

381377
### Secrets in base image registry
@@ -391,9 +387,9 @@ myEnv.docker.base_image_registry.registry_identity = None
391387

392388
**Troubleshooting steps**
393389

394-
Specifying credentials in your environment definition is deprecated. Delete credentials from your environment definition and use workspace connections instead.
390+
Specifying credentials in your environment definition is no longer supported. Delete credentials from your environment definition and use workspace connections instead.
395391

396-
*Applies to: Python SDK azureml V1*
392+
*Applies to: Python SDK v1*
397393

398394
Set a workspace connection on your workspace
399395

@@ -403,7 +399,7 @@ ws = Workspace.from_config()
403399
ws.set_connection("connection1", "ACR", "<URL>", "Basic", "{'Username': '<username>', 'Password': '<password>'}")
404400
```
405401

406-
*Applies to: Azure CLI extensions V1 & V2*
402+
*Applies to: Azure CLI extensions v1 & v2*
407403

408404
Create a workspace connection from a YAML specification file
409405

@@ -412,8 +408,8 @@ az ml connection create --file connection.yml --resource-group my-resource-group
412408
```
413409

414410
**Resources**
415-
* [Python SDK AzureML v1 workspace connections](https://aka.ms/azureml/environment/set-connection-v1)
416-
* [Python SDK AzureML v2 workspace connections](/python/api/azure-ai-ml/azure.ai.ml.entities.workspaceconnection)
411+
* [Python SDK v1 workspace connections](https://aka.ms/azureml/environment/set-connection-v1)
412+
* [Python SDK v2 workspace connections](/python/api/azure-ai-ml/azure.ai.ml.entities.workspaceconnection)
417413
* [Azure CLI workspace connections](/cli/azure/ml/connection)
418414

419415
### Deprecated Docker attribute
@@ -436,30 +432,107 @@ az ml connection create --file connection.yml --resource-group my-resource-group
436432

437433
**Troubleshooting steps**
438434

439-
*Applies to: Python SDK azureml V1*
435+
*Applies to: Python SDK v1*
440436

441437
Instead of specifying these attributes in the `DockerSection` of your environment definition, use [DockerConfiguration](https://aka.ms/azureml/environment/docker-configuration-class)
442438

443439
**Resources**
444440
* See `DockerSection` [deprecated variables](https://aka.ms/azureml/environment/docker-section-class)
445441

446442
### Dockerfile length over limit
447-
- The specified Dockerfile can't exceed the maximum Dockerfile size of 100 KB
448-
- Consider shortening your Dockerfile to get it under this limit
443+
<!--issueDescription-->
444+
**Potential causes:**
445+
* Your specified Dockerfile exceeded the maximum size of 100 KB
446+
447+
**Affected areas (symptoms):**
448+
* Failure in registering your environment
449+
<!--/issueDescription-->
450+
451+
**Troubleshooting steps**
452+
453+
Shorten your Dockerfile to get it under this limit
454+
455+
**Resources**
456+
* See [best practices](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/)
449457

450458
### *Docker build context issues*
459+
### Missing Docker build context location
460+
<!--issueDescription-->
461+
**Potential causes:**
462+
* You didn't provide the path of your build context directory in your environment definition
463+
464+
**Affected areas (symptoms):**
465+
* Failure in registering your environment
466+
<!--/issueDescription-->
467+
468+
**Troubleshooting steps**
469+
470+
*Applies to: Python SDK v1*
471+
472+
Include a path in the `build_context` of your [DockerSection](https://aka.ms/azureml/environment/docker-section-class)
473+
* See [DockerBuildContext Class](/python/api/azureml-core/azureml.core.environment.dockerbuildcontext)
474+
475+
*Applies to: Azure CLI & Python SDK v2*
476+
477+
Ensure that you include a path for your build context
478+
* See [BuildContext class](https://aka.ms/azureml/environment/build-context-class)
479+
* See this [sample](https://aka.ms/azureml/environment/create-env-build-context-v2)
480+
481+
**Resources**
482+
* [Understand build context](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#understand-build-context)
483+
451484
### Missing Dockerfile path
452-
- In the Docker build context, a Dockerfile path must be specified
453-
- The path should be relative to the root of the Docker build context directory
454-
- See [Build Context class](https://aka.ms/azureml/environment/build-context-class)
485+
<!--issueDescription-->
486+
This issue can happen when AzureML fails to find your Dockerfile. As a default, AzureML will look for a Dockerfile named 'Dockerfile' at the root of your build context directory unless a Dockerfile path is specified.
487+
488+
**Potential causes:**
489+
* Your Dockerfile isn't at the root of your build context directory and/or is named something other than 'Dockerfile,' and you didn't provide its path
490+
491+
**Affected areas (symptoms):**
492+
* Failure in registering your environment
493+
<!--/issueDescription-->
494+
495+
**Troubleshooting steps**
496+
497+
*Applies to: Python SDK v1*
498+
499+
In the `build_context` of your [DockerSection](https://aka.ms/azureml/environment/docker-section-class), include a `dockerfile_path`
500+
* See [DockerBuildContext Class](/python/api/azureml-core/azureml.core.environment.dockerbuildcontext)
501+
502+
*Applies to: Azure CLI & Python SDK v2*
503+
504+
Specify a Dockerfile path
505+
* [See BuildContext class](https://aka.ms/azureml/environment/build-context-class)
506+
* See this [sample](https://aka.ms/azureml/environment/create-env-build-context-v2)
507+
508+
**Resources**
509+
* [Understand build context](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#understand-build-context)
455510

456511
### Not allowed to specify attribute with Docker build context
457-
- If a Docker build context is specified, then the following items can't also be specified in the
458-
environment definition:
459-
- Environment variables
460-
- Conda dependencies
461-
- R
462-
- Spark
512+
<!--issueDescription-->
513+
This issue can happen when you've specified properties in your environment definition that can't be included with a Docker build context.
514+
515+
**Potential causes:**
516+
* You specified a Docker build context, along with at least one of the following in your environment definition:
517+
* Environment variables
518+
* Conda dependencies
519+
* R
520+
* Spark
521+
522+
**Affected areas (symptoms):**
523+
* Failure in registering your environment
524+
<!--/issueDescription-->
525+
526+
**Troubleshooting steps**
527+
528+
*Applies to: Python SDK v1*
529+
530+
If any of the above-listed properties are specified in your environment definition, remove them
531+
* If you're using a Docker build context and want to specify conda dependencies, your conda specification should reside in your build context directory
532+
533+
**Resources**
534+
* [Understand build context](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#understand-build-context)
535+
* Python SDK v1 [Environment Class](https://aka.ms/azureml/environment/environment-class-v1)
463536

464537
### Location type not supported/Unknown location type
465538
- The following are accepted location types:
@@ -601,18 +674,6 @@ environment definition
601674
version of a package on subsequent builds of an environment. This behavior can lead to unexpected errors
602675
- See [conda package pinning](https://aka.ms/azureml/environment/how-to-pin-conda-packages)
603676

604-
### UTF-8 decoding error
605-
<!--issueDescription-->
606-
This issue can happen when there's a failure decoding a character in your conda specification. 
607-
608-
**Potential causes:**
609-
* Your conda YAML file contains characters that aren't compatible with UTF-8.
610-
611-
**Affected areas (symptoms):**
612-
* Failure in building environments from UI, SDK, and CLI.
613-
* Failure in running jobs because it will implicitly build the environment in the first step.
614-
<!--/issueDescription-->
615-
616677
### *Pip issues*
617678
### Pip not specified
618679
- For reproducibility, pip should be specified as a dependency in your conda specification, and it should be pinned
@@ -656,7 +717,7 @@ This issue can happen by failing to access a workspace's associated Azure Contai
656717

657718
**Troubleshooting steps**
658719

659-
*Applies to: Python SDK azureml V1*
720+
*Applies to: Python SDK v1*
660721

661722
Update the workspace image build compute property using SDK:
662723

@@ -666,7 +727,7 @@ ws = Workspace.from_config()
666727
ws.update(image_build_compute = 'mycomputecluster')
667728
```
668729

669-
*Applies to: Azure CLI extensions V1 & V2*
730+
*Applies to: Azure CLI extensions v1 & v2*
670731

671732
Update the workspace image build compute property using Azure CLI:
672733

@@ -1016,15 +1077,15 @@ because you can't provide interactive authentication during a build
10161077

10171078
Provide authentication via workspace connections
10181079

1019-
*Applies to: Python SDK azureml V1*
1080+
*Applies to: Python SDK v1*
10201081

10211082
```
10221083
from azureml.core import Workspace
10231084
ws = Workspace.from_config()
10241085
ws.set_connection("connection1", "PythonFeed", "<URL>", "Basic", "{'Username': '<username>', 'Password': '<password>'}")
10251086
```
10261087

1027-
*Applies to: Azure CLI extensions V1 & V2*
1088+
*Applies to: Azure CLI extensions v1 & v2*
10281089

10291090
Create a workspace connection from a YAML specification file
10301091

@@ -1033,8 +1094,8 @@ az ml connection create --file connection.yml --resource-group my-resource-group
10331094
```
10341095

10351096
**Resources**
1036-
* [Python SDK AzureML v1 workspace connections](https://aka.ms/azureml/environment/set-connection-v1)
1037-
* [Python SDK AzureML v2 workspace connections](/python/api/azure-ai-ml/azure.ai.ml.entities.workspaceconnection)
1097+
* [Python SDK v1 workspace connections](https://aka.ms/azureml/environment/set-connection-v1)
1098+
* [Python SDK v2 workspace connections](/python/api/azure-ai-ml/azure.ai.ml.entities.workspaceconnection)
10381099
* [Azure CLI workspace connections](/cli/azure/ml/connection)
10391100

10401101
### Forbidden blob
@@ -1141,6 +1202,18 @@ This issue can happen when a package is specified on the command line using "<"
11411202
Add quotes around the package specification
11421203
* For example, change `conda install -y pip<=20.1.1` to `conda install -y "pip<=20.1.1"`
11431204

1205+
### UTF-8 decoding error
1206+
<!--issueDescription-->
1207+
This issue can happen when there's a failure decoding a character in your conda specification. 
1208+
1209+
**Potential causes:**
1210+
* Your conda YAML file contains characters that aren't compatible with UTF-8.
1211+
1212+
**Affected areas (symptoms):**
1213+
* Failure in building environments from UI, SDK, and CLI.
1214+
* Failure in running jobs because it will implicitly build the environment in the first step.
1215+
<!--/issueDescription-->
1216+
11441217
### *Pip issues during build*
11451218
### Failed to install packages
11461219
<!--issueDescription-->

0 commit comments

Comments
 (0)