We have setup the 3node HA and configured NFS shared path to the morpheus-ui location.When we tried to deploy the terraform app we are getting the below error.
2023-12-18_11:02:27.97772 '[2023-12-18 11:02:27,971] [RxCachedThreadScheduler-1173] WARN c.m.MorpheusUtils - error setting file owner on /var/opt/morpheus/morpheus-ui/workspace/terraform/cc5c9435278818ab79d826802ec160e1/app-7e88d397-4aad-44ad-a881-42371eee8251/terraform.tfstate to morpheus-app morpheus-local: {}
2023-12-18_11:02:27.97773 'java.nio.file.FileSystemException: /var/opt/morpheus/morpheus-ui/workspace/terraform/cc5c9435278818ab79d826802ec160e1/app-7e88d397-4aad-44ad-a881-42371eee8251/terraform.tfstate: Operation not permitted
2023-12-18_11:02:27.97773
We are able to change the permission manually to respective location but from the morpheus we are getting the above error? As Per my knowleadge when morpheus creating any files and folder its not able to change the user to morpheus-local.
can you do getfacl on morpheus-ui folder under /var/opt/morpheus
can you sudo as morpehus-app and morpehus-local user and see if you can create a file in this location?
/var/opt/morpheus/morpheus-ui/workspace/terraform/cc5c9435278818ab79d826802ec160e1/app-7e88d397-4aad-44ad-a881-42371eee8251/
user::rwx
group::rwx
other::—
2. can you sudo as Morpheus-app and Morpheus-local user and see if you can create a file in this location?
Yes
3. what you have in /etc/fstab ?
nfs-ip:/var/nfs /var/opt/morpheus/morpheus-ui nfs auto,noatime,nolock,bg,intr,actimeo=1800 0 0 -o
Error: Error locking state: [{%!s(tfdiags.Severity=69) Error acquiring the state lock Error message: mkdir /var/opt/morpheus/morpheus-ui/workspace/terraform/4f27bad95953da76e7efa291281af4c3/app-be901878-1a6f-49f7-8e41-53d73055bba0/.terraform: permission denied
Terraform acquires a state lock to protect the state from being written
by multiple users at the same time. Please resolve the issue above and try
again. For most commands, you can disable locking with the “-lock=false”
flag, but this is not recommended. }]
morpheus-ctl stop morpheus-ui
/var/opt/morpheus# cp -a morpheus-ui morpheus-ui.bak
mount -a
/var/opt/morpheus# cp -a morpheus-ui.bak/* morpheus-ui
morpheus-ctl start morpheus-ui