AWS Elastic Beanstalk EFS Mount Error: unknown filesystem type 'efs'
E

3

7

I am trying to mount my EFS to a multi-docker Elastic Beanstalk environment using task definition with Dockerrun.aws.json. Also, I have configured the security group of EFS to accept NFS traffic from EC2 (EB environment) security group.

However, I am facing with the error:

ECS task stopped due to: Error response from daemon: create ecs-awseb-SeyahatciBlog-env-k3k5grsrma-2-wordpress-88eff0a5fc88f9ae7500: VolumeDriver.Create: mounting volume failed: mount: unknown filesystem type 'efs'.

I am uploading this Dockerrun.aws.json file using AWS management console:

{
  "AWSEBDockerrunVersion": 2,
  "authentication": {
    "bucket": "seyahatci-docker",
    "key": "index.docker.io/.dockercfg"
  },
  "volumes": [
    {
      "name": "wordpress",
      "efsVolumeConfiguration": {
        "fileSystemId": "fs-d9689882",
        "rootDirectory": "/blog-web-app/wordpress",
        "transitEncryption": "ENABLED"
      }
    },
    {
      "name": "mysql-data",
      "efsVolumeConfiguration": {
        "fileSystemId": "fs-d9689882",
        "rootDirectory": "/blog-db/mysql-data",
        "transitEncryption": "ENABLED"
      }
    }
  ],
  "containerDefinitions": [
    {
      "name": "blog-web-app",
      "image": "bireysel/seyehatci-blog-web-app",
      "memory": 256,
      "essential": false,
      "portMappings": [
        {"hostPort": 80, "containerPort": 80}
      ],
      "links": ["blog-db"],
      "mountPoints": [
        {
          "sourceVolume": "wordpress",
          "containerPath": "/var/www/html"
        }
      ]
    },
    {
      "name": "blog-db",
      "image": "mysql:5.7",
      "hostname": "blog-db",
      "memory": 256,
      "essential": true,
      "mountPoints": [
        {
          "sourceVolume": "mysql-data",
          "containerPath": "/var/lib/mysql"
        }
      ]
    }
  ]
}

AWS Configuration Screenshots:

  1. EC2 Security Group (Automatically created by EB)
  2. EFS Security Group
  3. EFS networking
Edison answered 10/3, 2021 at 6:23 Comment(0)
E
5

After searching the entire web, I didn't encounter any solution for this problem. I contacted with AWS Support. They told me that the issue is with missing "amazon-efs-utils" extension on EC2 instances created by Elastic Beanstalk and then I fixed the error by creating a file named efs.config inside .ebextensions folder:

.ebextensions/efs.config

packages:
  yum:
    amazon-efs-utils: 1.2

Finally, I zipped the .ebextensions folder and my Dockerrun.aws.json file before uploading and the problem has been resolved.

Edison answered 11/3, 2021 at 7:45 Comment(0)
S
21

My Scenario:

  • Setup some EC2s with Amazon Linux 2 AMIs.
  • Try to setup EFS

Had the same error when trying to mount the EFS drive.

It seems like the package WAS NOT included in the Amazon Linux 2 AMI even though the documentation specifies that it should be included.

The amzn-efs-utils package comes preinstalled on Amazon Linux and Amazon Linux 2 Amazon Machine Images (AMIs).

https://docs.aws.amazon.com/efs/latest/ug/overview-amazon-efs-utils.html

Running which amzn-efs-utils returns: no amzn-efs-utils installed.

$ which amzn-efs-utils
/usr/bin/which: no amzn-efs-utils in (/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/ec2-user/.local/bin:/home/ec2-user/bin)

Fix

Install the amzn-efs-utils

sudo yum install amazon-efs-utils
Singband answered 2/10, 2021 at 12:54 Comment(1)
OMG!!!! But you rock thank you for saving me hours!Anisette
E
5

After searching the entire web, I didn't encounter any solution for this problem. I contacted with AWS Support. They told me that the issue is with missing "amazon-efs-utils" extension on EC2 instances created by Elastic Beanstalk and then I fixed the error by creating a file named efs.config inside .ebextensions folder:

.ebextensions/efs.config

packages:
  yum:
    amazon-efs-utils: 1.2

Finally, I zipped the .ebextensions folder and my Dockerrun.aws.json file before uploading and the problem has been resolved.

Edison answered 11/3, 2021 at 7:45 Comment(0)
K
0

which command shows "no amazon-efs-utils in " even after installing package. But this command shows the installation status rpm -qa | grep amazon-efs-utils correctly .Now the mount command is running fine

Katharinekatharsis answered 18/6 at 10:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.