Solved Unable To Backup (Both Scheduled & Manual) After Migration To AWS Lightsail

Status
Not open for further replies.

jeremylwf

SOHO User
Basic Certified
Joined
May 13, 2021
Messages
5
Reaction score
0
Hi,

We recently migrated from Google Cloud to AWS Lightsail.

However, we have been getting this error message:

Your 3CX backup failed due to the following reason(s):
System.UnauthorizedAccessException: Access to the path '/var/lib/3cxpbx/Instance1/Data/Backups/3CXScheduledBackup.zip.tmp' is denied.
---> System.IO.IOException: Permission denied
--- End of inner exception stack trace ---
at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
at System.IO.FileStream.OpenHandle(FileMode mode, FileShare share, FileOptions options)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at _3cxFilesystemImplementations.Local.LocalFilesystem.CreateFile(String filename)
at _3cxBackupRestoreImpl.BackupRestoreUtils.Backup(IFilesystem filesystem, String instanceId, String cfgPath, String dbConnectionString, BackupConfig options, String fullpathFilename, Boolean sendEmail)
at BackupRestoreSchedule.BackupJob.Execute(IJobExecutionContext context)

Would appreciate some guidance in resolving this issue.

I suspect it has to do with a read/write permission setting but I'm not familiar with the Linux command needed to grant the access.
 
How did you migrate? It's clearly a permission issue, the question is why.
 
  • Like
Reactions: Evolute IT
How did you migrate? It's clearly a permission issue, the question is why.
Thanks for your reply!

1. Clean install via PBX Express to AWS Lightsail
2. Upload 3CX Backup via SFTP (Filezilla).

-> I had to update the read / write settings of "/var/lib/3cxpbx/Instance1/Data/Backups/" folder to enable me to upload the file successfully.
-> used SSH to run this command

chown -R admin /var/lib/3cxpbx/Instance1/Data/Backups/


3. Restore the 3CX Backup via web admin
 
Ahh.. so you should have been able to restore during the PBXExpress deployment but yes changing the settings is what screwed it up. It should be owned by the phonesystem user
 
  • Like
Reactions: Evolute IT
Ahh.. so you should have been able to restore during the PBXExpress deployment but yes changing the settings is what screwed it up. It should be owned by the phonesystem user
Yes oddly I couldn't find any way to restore it during PBXExpress deployment. Any idea how to run the command to change the ownership to phonesystem user?
 
I managed to find a fix by running:

sudo chown phonesystem /var/lib/3cxpbx/Instance1/Data/Backups/

Seems to be able to perform a backup via admin interface now.

Hopefully it doesn't cause any other issues.
 
Nice. If that's the only change you should be good.
 
Normally, to restore a backup on a PBXExpress instance, you use a SFTP server or Google Bucket to store the backup, then connect the new instance to that same remote location to be able to restore it directly in the Management Console. As long as it is using the same FQDN/License in the backup, it will work just fine.
 
Status
Not open for further replies.

Forum statistics

Threads
111,974
Messages
590,081
Members
164,899
Latest member
mazet