Coder Social home page Coder Social logo

Comments (5)

patelia avatar patelia commented on August 17, 2024

Hi luvpreetsingh,

It sounds like you do not have the nfs-utils package installed, which will include /sbin/mount.nfs4. nfs-utils (or nfs-common on Debian distros) is required to mount EFS file systems, either with mount -t nfs4 or mount -t efs. Installing amazon-efs-utils should have also installed nfs-utils though, as it is a dependency. Were there any errors when installing amazon-efs-utils?

Ian

from efs-utils.

luvpreetsingh avatar luvpreetsingh commented on August 17, 2024

Hi patelia, thanks for the response.

Well, I did not check the output of sudo yum install amazon-efs-utils when I initially ran it, took it for granted which I shouldn't have done.

But I ran it again,

[ec2-user@ip-10-0-2-232 ~]$ sudo yum install amazon-efs-utils
Failed to set locale, defaulting to C
Loaded plugins: priorities, update-motd
amzn2-core                                                                                                              | 2.4 kB  00:00:00
Package amazon-efs-utils-1.7-1.amzn2.noarch already installed and latest version
Nothing to do

But then, I tried to check for nfs-utils,

[ec2-user@ip-10-0-2-232 ~]$ sudo yum install nfs-utils
Failed to set locale, defaulting to C
Loaded plugins: priorities, update-motd
Resolving Dependencies
--> Running transaction check
---> Package nfs-utils.x86_64 1:1.3.0-0.54.amzn2.0.2 will be installed
--> Processing Dependency: rpcbind for package: 1:nfs-utils-1.3.0-0.54.amzn2.0.2.x86_64
--> Running transaction check
---> Package rpcbind.x86_64 0:0.2.0-44.amzn2 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===============================================================================================================================================
 Package                        Arch                        Version                                      Repository                       Size
===============================================================================================================================================
Installing:
 nfs-utils                      x86_64                      1:1.3.0-0.54.amzn2.0.2                       amzn2-core                      408 k
Installing for dependencies:
 rpcbind                        x86_64                      0.2.0-44.amzn2                               amzn2-core                       60 k

Transaction Summary
===============================================================================================================================================
Install  1 Package (+1 Dependent package)

Total download size: 468 k
Installed size: 1.1 M
Is this ok [y/d/N]: y
Downloading packages:
(1/2): rpcbind-0.2.0-44.amzn2.x86_64.rpm                                                                                |  60 kB  00:00:00
(2/2): nfs-utils-1.3.0-0.54.amzn2.0.2.x86_64.rpm                                                                        | 408 kB  00:00:00
-----------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                          5.2 MB/s | 468 kB  00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
error: Couldn't create temporary file for %pre(rpcbind-0.2.0-44.amzn2.x86_64): Success
Error in PREIN scriptlet in rpm package rpcbind-0.2.0-44.amzn2.x86_64
error: rpcbind-0.2.0-44.amzn2.x86_64: install failed
error: error creating temporary file /var/tmp/rpm-tmp.MIiiyj: Not a directory
error: Couldn't create temporary file for %pre(nfs-utils-1:1.3.0-0.54.amzn2.0.2.x86_64): Not a directory
Error in PREIN scriptlet in rpm package 1:nfs-utils-1.3.0-0.54.amzn2.0.2.x86_64
  Verifying  : rpcbind-0.2.0-44.amzn2.x86_64                                                                                               1/2
  Verifying  : 1:nfs-utils-1.3.0-0.54.amzn2.0.2.x86_64                                                                                     2/2

Failed:
  nfs-utils.x86_64 1:1.3.0-0.54.amzn2.0.2                                    rpcbind.x86_64 0:0.2.0-44.amzn2

Complete!

So you are correct I guess, it did not install nfs-utils properly. Anyway, Any idea on this error? having trouble finding a solution for it.

from efs-utils.

patelia avatar patelia commented on August 17, 2024

Hi luvpreetsingh ,

The Not a directory message seems suspicious. I can recreate something like your issue if I delete the /var/tmp/ directory and replace it with a /var/tmp file.

$ sudo yum install -y amazon-efs-utils
Loaded plugins: priorities, update-motd
Resolving Dependencies
--> Running transaction check
---> Package amazon-efs-utils.noarch 0:1.7-1.amzn2 will be installed
--> Processing Dependency: nfs-utils for package: amazon-efs-utils-1.7-1.amzn2.noarch
--> Running transaction check
---> Package nfs-utils.x86_64 1:1.3.0-0.54.amzn2.0.2 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package                  Arch           Version                           Repository          Size
====================================================================================================
Installing:
 amazon-efs-utils         noarch         1.7-1.amzn2                       amzn2-core          19 k
Installing for dependencies:
 nfs-utils                x86_64         1:1.3.0-0.54.amzn2.0.2            amzn2-core         408 k

Transaction Summary
====================================================================================================
Install  1 Package (+1 Dependent package)

Total download size: 427 k
Installed size: 1.0 M
Downloading packages:
(1/2): amazon-efs-utils-1.7-1.amzn2.noarch.rpm                               |  19 kB  00:00:00     
(2/2): nfs-utils-1.3.0-0.54.amzn2.0.2.x86_64.rpm                             | 408 kB  00:00:00     
----------------------------------------------------------------------------------------------------
Total                                                               2.6 MB/s | 427 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
error: Couldn't create temporary file for %pre(nfs-utils-1:1.3.0-0.54.amzn2.0.2.x86_64): Success
Error in PREIN scriptlet in rpm package 1:nfs-utils-1.3.0-0.54.amzn2.0.2.x86_64
  Installing : amazon-efs-utils-1.7-1.amzn2.noarch                                              2/2 
error: nfs-utils-1:1.3.0-0.54.amzn2.0.2.x86_64: install failed
error: error creating temporary file /var/tmp/rpm-tmp.M8urQY: Not a directory
error: Couldn't create temporary file for %post(amazon-efs-utils-1.7-1.amzn2.noarch): Not a directory
Non-fatal POSTIN scriptlet failure in rpm package amazon-efs-utils-1.7-1.amzn2.noarch
  Verifying  : amazon-efs-utils-1.7-1.amzn2.noarch                                              1/2 
  Verifying  : 1:nfs-utils-1.3.0-0.54.amzn2.0.2.x86_64                                          2/2 

Installed:
  amazon-efs-utils.noarch 0:1.7-1.amzn2                                                             

Failed:
  nfs-utils.x86_64 1:1.3.0-0.54.amzn2.0.2                                                           

Complete!

There may be something about your setup that is replacing the directory with a file, which is causing issues for yum.

Ian

from efs-utils.

luvpreetsingh avatar luvpreetsingh commented on August 17, 2024

Okay so this is getting interesting. You are correct, something is wrong with the setup.

[ec2-user@ip-10-0-2-232 var]$ pwd
/var
[ec2-user@ip-10-0-2-232 var]$ ls -lh
total 8.0K
drwxr-xr-x  2 root root    6 Apr  9 19:57 adm
drwxr-xr-x  5 root root   44 Apr  9 19:57 cache
drwxr-xr-x  3 root root   18 Apr  9 19:57 db
drwxr-xr-x  3 root root   18 Apr  9 19:57 empty
drwxr-xr-x  2 root root    6 Apr  9 19:57 games
drwxr-xr-x  2 root root    6 Apr  9 19:57 gopher
drwxr-xr-x  3 root root   18 May  9  2018 kerberos
drwxr-xr-x 28 root root 4.0K Jun 27 22:23 lib
drwxr-xr-x  2 root root    6 Apr  9 19:57 local
lrwxrwxrwx  1 root root   11 May  9  2018 lock -> ../run/lock
drwxr-xr-x  9 root root 4.0K Jul  1 03:31 log
lrwxrwxrwx  1 root root   10 Jun 13 08:57 mail -> spool/mail
drwxr-xr-x  2 root root    6 Apr  9 19:57 nis
drwxr-xr-x  2 root root    6 Apr  9 19:57 opt
drwxr-xr-x  2 root root    6 Apr  9 19:57 preserve
lrwxrwxrwx  1 root root    6 May  9  2018 run -> ../run
drwxr-xr-x  7 root root   71 Apr  9 19:57 spool
-rw-rw-rw-  1 root root    0 Jul  2 09:57 tmp
drwxr-xr-x  2 root root    6 Apr  9 19:57 yp

I tried to remove this file,

[ec2-user@ip-10-0-2-232 var]$ sudo rm tmp
rm: cannot remove 'tmp': Operation not permitted

because its immutable,

[ec2-user@ip-10-0-2-232 var]$ lsattr | grep tmp
lsattr: Operation not supported While reading flags on ./run
lsattr: Operation not supported While reading flags on ./lock
lsattr: Operation not supported While reading flags on ./mail
----i----------- ./tmp

So, I did,

[ec2-user@ip-10-0-2-232 var]$ sudo chattr -i tmp
[ec2-user@ip-10-0-2-232 var]$ sudo rm tmp
[ec2-user@ip-10-0-2-232 var]$ sudo mkdir tmp
 mkdir: cannot create directory 'tmp': File exists

It automatically came back.

Interesting thing is, I took the same AMI, launched another instance out of the EKS cluster, and

[ec2-user@ip-10-0-3-42 ~]$ cd /var/
[ec2-user@ip-10-0-3-42 var]$ ls -lh | grep tmp
drwxrwxrwt  3 root root   85 Jul  2 09:48 tmp

In this instance, /tmp is a directory.

NOTE: I have never manually intervened with the worker nodes before. So, I am pretty sure I did not do anything.

So I guess this aws/efs-utils is not the right place to report this bug, something is wrong with the worker nodes in EKS.

from efs-utils.

luvpreetsingh avatar luvpreetsingh commented on August 17, 2024

I updated my worker node AMI to latest one and it worked. But I still don't know why it didn't work in the old version. Thanks for your time.

from efs-utils.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.