Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ ModelArts/ Troubleshooting/ Training Jobs/ Permission Issues/ Error Message "Permission denied" Displayed in Logs

Error Message "Permission denied" Displayed in Logs

Updated on 2024-12-30 GMT+08:00

Symptom

When a training job accesses the attached EFS disks or executes the .sh boot script, an error occurs.

  • [Errno 13]Permission denied: '/xxx/xxxx'
    Figure 1 Error log
  • bash: /bin/ln: Permission denied
  • bash:/home/ma-user/.pip/pip.conf: Permission Denied (in a custom image)
  • tee: /xxx/xxxx: Permission denied cp: cannot stat '' No such file or directory (in a custom image)

Possible Causes

The possible causes are as follows:

  • [Errno 13]Permission denied: '/xxx/xxxx'
    • When data is uploaded, the ownership and permissions to the file are not changed. As a result, the work user group does not have the permission to access the training job.
    • After the .sh file in the code directory is copied to the container, the execution permission is not granted for the file.
  • bash: /bin/ln: Permission denied

    For security purposes, the ln command is not supported.

  • bash:/home/ma-user/.pip/pip.conf: Permission Denied

    After the version of training jobs is switched from V1 to V2, the UID of the ma-user user is still 1102.

  • tee: /xxx/xxxx: Permission denied cp: cannot stat '': No such file or directory

    The used startup script is run_train.sh of an earlier version. Some environment variables in the script are unavailable in the training jobs of the new version.

  • The APIs using the Python file concurrently read and write the same file.

Solution

  1. Add permissions to access the attached EFS disks so that the permissions are the same as those of user group (1000) used in the training container. For example, if the /nas disk is attached, run the following command:
    chown -R 1000: 1000 /nas
    Or
    chmod 777 -R /nas
  2. If the execution permission has not been granted for the .sh file used by the custom image, run chmod +x xxx.sh to grant the permission before starting the script.
  3. On the ModelArts console, if a training job is created using a custom image, a V2 container image is started using UID 1000 by default. In this case, change the UID of the ma-user user from 1102 to 1000. To obtain the sudo permission, comment out the sudoers line.

  4. Migrate environment variables from V1 training jobs to V2 training jobs.
    • Use V2 MA_NUM_HOSTS (the number of selected training nodes) to replace V1 DLS_TASK_NUMBER.
    • Use V2 VC_TASK_INDEX (or MA_TASK_INDEX that will be available later) to replace V1 DLS_TASK_INDEX. Obtain the environment variable using the method provided in the demo script for compatibility.
    • Use V2 ${MA_VJ_NAME}-${MA_TASK_NAME}-0.${MA_VJ_NAME}:6666 to replace V1 BATCH_CUSTOM0_HOSTS.
    • Use V2 ${MA_VJ_NAME}-${MA_TASK_NAME}-{N}.${MA_VJ_NAME}:6666 to replace V1 BATCH_CUSTOM{N}_HOSTS generally.
  5. Check whether there are settings that allow concurrent reading and writing of the same file in the code. If so, modify the settings to forbid this operation.

    If a job uses multiple cards, the same code for reading and writing data may be available on each card. In this case, do as follows to modify the code:

    import moxing as mox
    from mindspore.communication import init, get_rank, get_group_size
    init()
    rank_id = get_rank()
    # Enable only card 0 to download data.
    if rank_id % 8 == 0:
        mox.file.copy_parallel('obs://bucket-name/dir1/dir2/', '/cache')

Summary and Suggestions

Before creating a training job, use the ModelArts development environment to debug the training code to maximally eliminate errors in code migration.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback