Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SqliteException(6922): disk I/O error Occurs During Amplify Storage File Upload in Flutter App #5571

Open
3 of 14 tasks
bjmcallister opened this issue Oct 18, 2024 · 2 comments
Labels
question A question about the Amplify Flutter libraries storage Issues related to the Storage Category to-be-reproduced Issues that have not been reproduced yet, but have reproduction steps provided

Comments

@bjmcallister
Copy link

Description

I'm experiencing a SqliteException(6922): disk I/O error when attempting to upload a video file using Amplify.Storage.uploadFile in my Flutter application. This error arises specifically during an INSERT operation into the transfer_records table within the SQLite database. The issue prevents successful uploads and disrupts the user experience.

Steps to Reproduce
Ensure the Flutter environment is correctly set up with all necessary dependencies.
Amplify is properly configured for storage in the Flutter app.

Code Execution
Trigger the upload process, which involves generating a UUID, checking file existence, creating an AWSFile instance, and invoking Amplify.Storage.uploadFile.

Error Trigger
During the execution of the uploadFile method, the app attempts to insert a new record into the transfer_records table.
The SqliteException(6922): disk I/O error is thrown at this point.
Expected Behavior
The video file should upload successfully to AWS Amplify Storage, and a corresponding record should be inserted into the transfer_records SQLite table without any errors.

Actual Behavior
An exception is thrown during the upload process, preventing the insertion of a new record into the transfer_records table and halting the upload operation.

SqliteException(6922): while executing statement, disk I/O error, disk I/O error (code 6922) Causing statement: INSERT INTO "transfer_records" ("upload_id", "object_key", "created_at") VALUES (?, ?, ?), parameters: IGn7zlX4vYK00bsxjMlTdd.UMaskDNIG21RylQ9ac6vA0vP4HBK8f71puCH0.PakERK7pymwvWbLEOkvLcuoPkkcqH2OUKwq987TmPDLewhbPDSvFrjwJRw2VseCzN6YMzZSdQp3JJeq1zVGJ9ZUi_FoTYurhFNFaEdbUvrTRx8-, videos/46c572e2-70d4-41de-b612-a5a82e952cce.mp4, 2024-10-18T11:40:47.705803 Reloaded 1 of 3917 libraries in 1,212ms (compile: 169 ms, reload: 501 ms, reassemble: 498 ms).

final uuid = Uuid();
final String keyName = uuid.v4();

final file = File(pendingUpload.path);
if (!await file.exists()) {
  throw Exception(
      'File does not exist at path: ${pendingUpload.path}');
}

// Create an AWSFile instance after confirming the file exists
final awsFile = AWSFile.fromPath(pendingUpload.path);

// Use a dynamic storage path to avoid conflicts
final result = Amplify.Storage.uploadFile(
  localFile: awsFile,
  path: StoragePath.fromString('videos/$keyName.mp4'),
  options: const StorageUploadFileOptions(
    metadata: {
      'project': 'salesmail',
    },
  ),
).result;

await result;

Categories

  • Analytics
  • API (REST)
  • API (GraphQL)
  • Auth
  • Authenticator
  • DataStore
  • Notifications (Push)
  • Storage

Steps to Reproduce

Ensure the Flutter environment is correctly set up with all necessary dependencies.
Amplify is properly configured for storage in the Flutter app.

Screenshots

No response

Platforms

  • iOS
  • Android
  • Web
  • macOS
  • Windows
  • Linux

Flutter Version

3.24.3

Amplify Flutter Version

2.1.0 & 2.4.0

Deployment Method

Amplify Gen 2

Schema

No response

@github-actions github-actions bot added pending-triage This issue is in the backlog of issues to triage pending-maintainer-response Pending response from a maintainer of this repository labels Oct 18, 2024
@bjmcallister
Copy link
Author

14d4a010-ad43-4764-b439-686a0bc13885.MOV
e56b6984-0c2f-45f3-8382-dd45be287a82.MOV

Two videos. The longer one does not work while the shorter one does.

@NikaHsn
Copy link
Member

NikaHsn commented Oct 18, 2024

Sorry that you are facing this issue. We will look into this and get back to you when we have updates.

@NikaHsn NikaHsn added question A question about the Amplify Flutter libraries storage Issues related to the Storage Category to-be-reproduced Issues that have not been reproduced yet, but have reproduction steps provided labels Oct 18, 2024
@github-actions github-actions bot removed the pending-maintainer-response Pending response from a maintainer of this repository label Oct 18, 2024
@NikaHsn NikaHsn removed the pending-triage This issue is in the backlog of issues to triage label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question A question about the Amplify Flutter libraries storage Issues related to the Storage Category to-be-reproduced Issues that have not been reproduced yet, but have reproduction steps provided
Projects
None yet
Development

No branches or pull requests

2 participants