realm / realm-dart

Realm is a mobile database: a replacement for SQLite & ORMs.
Apache License 2.0
770 stars 86 forks source link

[Bug]: can't install realm binary #1060

Closed amondnet closed 1 year ago

amondnet commented 1 year ago

What happened?

An error occurs when multiple users install realm binary on one computer. The realm binary is always downloaded to the same location.

    final destinationFile = File(path.join(Directory.systemTemp.absolute.path, "realm-binary", archiveName));

Repro steps

  1. [user 1] Build an app that uses realm
  2. [user 2] Build an app that uses realm

Version

3.3.8

What Realm SDK flavor are you using?

MongoDB Atlas (i.e. Sync, auth, functions)

What type of application is this?

Flutter Application

Client OS and version

any

Code snippets

No response

Stacktrace of the exception/crash you're getting

No response

Relevant log output

-> Installing realm (0.8.0+rc)
     > Running prepare command
       $ /bin/bash -c  set -e source "/Users/runner03/actions-runner/_work/chatbot-mobile/chatbot-mobile/package/balancefriends/ios/Flutter/flutter_export_environment.sh" && cd "$FLUTTER_APPLICATION_PATH" && "$FLUTTER_ROOT/bin/flutter" pub run realm install --target-os-type ios --package-name realm
       Downloading Realm binaries for realm@0.8.0+rc to /tmp/realm-binary/ios.tar.gz
    [!] /bin/bash -c 
    set -e
    source "/Users/runner03/actions-runner/_work/chatbot-mobile/chatbot-mobile/package/balancefriends/ios/Flutter/flutter_export_environment.sh" && cd "$FLUTTER_APPLICATION_PATH" && "$FLUTTER_ROOT/bin/flutter" pub run realm install --target-os-type ios --package-name realm

    Downloading Realm binaries for realm@0.8.0+rc to /tmp/realm-binary/ios.tar.gz
    Unhandled exception:
    FileSystemException: Cannot open file, path = '/tmp/realm-binary/ios.tar.gz' (OS Error: Permission denied, errno = 13)
    #0      _File.open.<anonymous closure> (dart:io/file_impl.dart:356:9)
    <asynchronous suspension>
    pub finished with exit code 255
nielsenko commented 1 year ago

You are right. Will be fixed with #1061