I am trying to send a simple email from a gmail account using mailr:
send.mail(from = "XXXXXX#gmail.com",
to = c("YYYYYY#gmail.com"),
subject = "Subject of the email",
body = "test",
html = TRUE,
inline = TRUE,
smtp = list(host.name = "smtp.gmail.com", port = 465, user.name = "XXXXXX", passwd = "XXXXXX", ssl = TRUE),
authenticate = TRUE,
send = TRUE)
and it gives me the following error:
org.apache.commons.mail.EmailException: Sending the email to the following server failed : smtp.gmail.com:465
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1410)
at org.apache.commons.mail.Email.send(Email.java:1437)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at RJavaTools.invokeMethod(RJavaTools.java:386)
Caused by: javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465;
nested exception is:
javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2055)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:697)
at javax.mail.Service.connect(Service.java:386)
at javax.mail.Service.connect(Service.jaNULL
va:245)
at javax.mail.Service.connect(Service.java:194)
at javax.mail.Transport.send0(Transport.java:253)
at javax.mail.Transport.send(Transport.java:124)
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1400)
... 6 more
Caused by: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
at sun.security.ssl.HandshakeContext.<init>(Unknown Source)
at sun.security.ssl.ClientHandshakeContext.<init>(Unknown Source)
at sun.security.ssl.TransportContext.kickstart(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at com.sun.mail.util.SocketFetcher.configureSSLSocket(SocketFetcher.java:543)
at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:348)
at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:215)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2019)
... 13 more
Error: EmailException (Java): Sending the email to the following server failed : smtp.gmail.com:465
I just change the Unsafe application access to YES but nothing happens.
Related
I am working on one of my flutter project and trying to add firebase phone authentication but I encountered with the error related to safetynet.Whereas i am able to use other authentication methods e.g. SignInWithEmailAndPassword. Whenever I am calling my phoneLogin function i am getting the error. I have already installed google play service on my emulator.
CODE
Future phoneLogin(String phone) async {
BuildContext context;
try {
await auth.verifyPhoneNumber(
phoneNumber: '+91$phone',
timeout: const Duration(seconds: 30),
verificationCompleted: (PhoneAuthCredential credentials) async {
await auth.signInWithCredential(credentials);
},
verificationFailed: (FirebaseAuthException exception) {},
codeSent: (String verificationId, [int forcedResendingToken]) {
// print('1')
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) => OtpPage(phone: phone),
),
);
},
codeAutoRetrievalTimeout: (String abc) {});
return null;
} catch (e) {
return null;
}
}
ERROR
E/zzbf ( 6483): SafetyNet Attestation fails basic integrity.
I/zzkn ( 6483): Provider GmsCore_OpenSSL not available
W/System ( 6483): Ignoring header X-Firebase-Locale because its value was null.
D/AndroidRuntime( 6483): Shutting down VM
E/AndroidRuntime( 6483): FATAL EXCEPTION: main
E/AndroidRuntime( 6483): Process: com.oneobit.greenobit, PID: 6483
E/AndroidRuntime( 6483): java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/browser/customtabs/CustomTabsIntent$Builder;
E/AndroidRuntime( 6483): at com.google.firebase.auth.internal.RecaptchaActivity.zza(com.google.firebase:firebase-auth##20.0.2:13)
E/AndroidRuntime( 6483): at com.google.android.gms.internal.firebase-auth-api.zztw.zzb(com.google.firebase:firebase-auth##20.0.2:7)
E/AndroidRuntime( 6483): at com.google.android.gms.internal.firebase-auth-api.zztw.onPostExecute(Unknown Source:2)
E/AndroidRuntime( 6483): at android.os.AsyncTask.finish(AsyncTask.java:771)
E/AndroidRuntime( 6483): at android.os.AsyncTask.access$900(AsyncTask.java:199)
E/AndroidRuntime( 6483): at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:788)
E/AndroidRuntime( 6483): at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime( 6483): at android.os.Looper.loop(Looper.java:223)
E/AndroidRuntime( 6483): at android.app.ActivityThread.main(ActivityThread.java:7656)
E/AndroidRuntime( 6483): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 6483): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
E/AndroidRuntime( 6483): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
E/AndroidRuntime( 6483): Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.browser.customtabs.CustomTabsIntent$Builder" on path: DexPathList[[zip file "/data/app/~~VMK8TkW9ozBJD9t7dnRn8g==/com.oneobit.greenobit-EtKxl5CBj6rDZiliq4I1ZQ==/base.apk"],nativeLibraryDirectories=[/data/app/~~VMK8TkW9ozBJD9t7dnRn8g==/com.oneobit.greenobit-EtKxl5CBj6rDZiliq4I1ZQ==/lib/x86, /data/app/~~VMK8TkW9ozBJD9t7dnRn8g==/com.oneobit.greenobit-EtKxl5CBj6rDZiliq4I1ZQ==/base.apk!/lib/x86, /system/lib, /system_ext/lib]]
E/AndroidRuntime( 6483): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:207)
E/AndroidRuntime( 6483): at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
E/AndroidRuntime( 6483): at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
E/AndroidRuntime( 6483): ... 12 more
I/Process ( 6483): Sending signal. PID: 6483 SIG: 9
Lost connection to device.
I have already updated SHA256 key to my Firebase console.
Firebase have updated certain things one of them is they have included captcha verification before sending the code or OTP to mobile devices.
To solve this issue see bellow:
add the following to project/android/app/build.gradle
implementation "androidx.browser:browser:1.3.0"
add this in the dependencies section ...
dependencies {
implementation "androidx.browser:browser:1.3.0"
///
}
you can find the latest version here: android browser .
REASON:
The app tries to verify the captcha and send the code, for that it tries to launch a browser but because of the missing implementation it fails to load a browser and crashes the application.
I'm fairly new to Flutter and haven't ever used Firebase before so my aplogies if there is an obvious solution to this.
I'm working on a Flutter app which involves recording form submissions and submitting them to a central location.
Firebase Storage seemed like a good fit since as I understood it the app can upload files to the cloud bucket and then they can be accessed through the Firebase console. Correct me if I'm wrong.
So I found this module for Flutter;
https://pub.dartlang.org/packages/firebase_storage
I used the example code as a basis.
once at the start of the code I call;
final FirebaseApp app = await FirebaseApp.configure(
name: 'test',
options: new FirebaseOptions(
googleAppID: Platform.isIOS
? '{ios app id}'
: '{android app ID}',
gcmSenderID: '{project number code}',
apiKey: '{web api key from the firebase console}',
projectID: '{project ID}',
),
);
storage = new FirebaseStorage(
app: app, storageBucket: '{address to data bucket}');
Then to upload a file I've tried;
final StorageReference ref =
storage.ref().child('uploads').child(filename);
final StorageUploadTask uploadTask = ref.putFile(
file,
new StorageMetadata(
contentLanguage: 'en',
customMetadata: <String, String>{'activity': 'submission'},
),
);
final Uri downloadUrl = (await uploadTask.future).downloadUrl;
final http.Response downloadData = await http.get(downloadUrl);
final String name = await ref.getName();
final String bucket = await ref.getBucket();
final String path = await ref.getPath();
return downloadData.statusCode >= 200 && 299 >= downloadData.statusCode;
and in the Firebase console I created the Uploads folder and I think set everything else up correctly.
My Firebase storage access rules look like this;
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write: if request.auth != null;
}
}
}
My issue is that when I try to upload the file I get the following error;
W/DynamiteModule(25832): Local module descriptor class for com.google.android.gms.firebasestorage not found.
I/DynamiteModule(25832): Considering local module com.google.android.gms.firebasestorage:0 and remote module com.google.android.gms.firebasestorage:6
I/DynamiteModule(25832): Selected remote version of com.google.android.gms.firebasestorage, version >= 6
W/System (25832): ClassLoader referenced unknown path: /data/data/com.google.android.gms/app_chimera/m/00000040/n/armeabi-v7a
W/System (25832): ClassLoader referenced unknown path: /data/data/com.google.android.gms/app_chimera/m/00000040/n/armeabi
E/StorageUtil(25832): error getting token java.util.concurrent.ExecutionException: com.google.firebase.internal.api.FirebaseNoSignedInUserException: Please sign in before trying to get a token.
W/NetworkRequest(25832): no auth token for request
E/StorageException(25832): StorageException has occurred.
E/StorageException(25832): User does not have permission to access this object.
E/StorageException(25832): Code: -13021 HttpResult: 403
E/StorageException(25832): The server has terminated the upload session
E/StorageException(25832): java.io.IOException: The server has terminated the upload session
E/StorageException(25832): at com.google.firebase.storage.UploadTask.zzs(Unknown Source)
E/StorageException(25832): at com.google.firebase.storage.UploadTask.zzr(Unknown Source)
E/StorageException(25832): at com.google.firebase.storage.UploadTask.run(Unknown Source)
E/StorageException(25832): at com.google.firebase.storage.StorageTask.zzl(Unknown Source)
E/StorageException(25832): at com.google.firebase.storage.zzq.run(Unknown Source)
E/StorageException(25832): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
E/StorageException(25832): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
E/StorageException(25832): at java.lang.Thread.run(Thread.java:818)
E/StorageException(25832): Caused by: java.io.IOException: { "error": { "code": 403, "message": "Permission denied. Could not perform this operation" }}
E/StorageException(25832): at bha.a(:com.google.android.gms.dynamite_dynamitemodulesc#12685022#12.6.85 (040308-197041431):147)
E/StorageException(25832): at bha.a(:com.google.android.gms.dynamite_dynamitemodulesc#12685022#12.6.85 (040308-197041431):119)
E/StorageException(25832): at bgu.onTransact(:com.google.android.gms.dynamite_dynamitemodulesc#12685022#12.6.85 (040308-197041431):7)
E/StorageException(25832): at android.os.Binder.transact(Binder.java:387)
E/StorageException(25832): at com.google.android.gms.internal.firebase_storage.zza.transactAndReadExceptionReturnVoid(Unknown Source)
E/StorageException(25832): at com.google.android.gms.internal.firebase_storage.zzm.zzf(Unknown Source)
E/StorageException(25832): at com.google.android.gms.internal.firebase_storage.zzq.zza(Unknown Source)
E/StorageException(25832): at com.google.android.gms.internal.firebase_storage.zzf.zza(Unknown Source)
E/StorageException(25832): at com.google.firebase.storage.UploadTask.zzc(Unknown Source)
E/StorageException(25832): ... 6 more
E/StorageException(25832): StorageException has occurred.
E/StorageException(25832): User does not have permission to access this object.
E/StorageException(25832): Code: -13021 HttpResult: 403
E/StorageException(25832): The server has terminated the upload session
E/StorageException(25832): java.io.IOException: The server has terminated the upload session
E/StorageException(25832): at com.google.firebase.storage.UploadTask.zzs(Unknown Source)
E/StorageException(25832): at com.google.firebase.storage.UploadTask.zzr(Unknown Source)
E/StorageException(25832): at com.google.firebase.storage.UploadTask.run(Unknown Source)
E/StorageException(25832): at com.google.firebase.storage.StorageTask.zzl(Unknown Source)
E/StorageException(25832): at com.google.firebase.storage.zzq.run(Unknown Source)
E/StorageException(25832): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
E/StorageException(25832): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
E/StorageException(25832): at java.lang.Thread.run(Thread.java:818)
E/StorageException(25832): Caused by: java.io.IOException: { "error": { "code": 403, "message": "Permission denied. Could not perform this operation" }}
E/StorageException(25832): at bha.a(:com.google.android.gms.dynamite_dynamitemodulesc#12685022#12.6.85 (040308-197041431):147)
E/StorageException(25832): at bha.a(:com.google.android.gms.dynamite_dynamitemodulesc#12685022#12.6.85 (040308-197041431):119)
E/StorageException(25832): at bgu.onTransact(:com.google.android.gms.dynamite_dynamitemodulesc#12685022#12.6.85 (040308-197041431):7)
E/StorageException(25832): at android.os.Binder.transact(Binder.java:387)
E/StorageException(25832): at com.google.android.gms.internal.firebase_storage.zza.transactAndReadExceptionReturnVoid(Unknown Source)
E/StorageException(25832): at com.google.android.gms.internal.firebase_storage.zzm.zzf(Unknown Source)
E/StorageException(25832): at com.google.android.gms.internal.firebase_storage.zzq.zza(Unknown Source)
E/StorageException(25832): at com.google.android.gms.internal.firebase_storage.zzf.zza(Unknown Source)
E/StorageException(25832): at com.google.firebase.storage.UploadTask.zzc(Unknown Source)
E/StorageException(25832): ... 6 more
Is it possible to log in with an app account (service account?) so individual users do not need to log in?
What am I doing wrong here?
Quoting from your StorageException:
User does not have permission to access this object.
This is what you would expect because your rules state the following:
allow read, write: if request.auth != null;
Firebase uses authentication.
There are two options to solve this:
Either you authenticate your users with Firebase using the firebase_auth plugin
Or you make your files publicly available by changing your rules to allow read, write;
The Storage Rules documentation contains information about integrating Firebase Authentication.
I connect to gremlin-server from gremlin console with this configuration:
connect_config.yaml
hosts: [XXX.XXX.XXX.XXX]
port: XXXX
serializer: {
className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0,
config: {
serializeResultToString: true,
ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry]
}
}
when i run method graph.openManagement() it will ok
gremlin> graph.openManagement()
==>org.janusgraph.graphdb.database.management.ManagementSystem#392e7533
but when i try save reference to management object and use it i get error:
gremlin> m=graph.openManagement()
==>org.janusgraph.graphdb.database.management.ManagementSystem#326fbc0a
gremlin> m.commit()
No such property: m for class: Script8
Type ':help' or ':h' for help.
Display stack trace? [yN]y
org.apache.tinkerpop.gremlin.groovy.plugin.RemoteException: No such property: m for class: Script8
at org.apache.tinkerpop.gremlin.console.groovy.plugin.DriverRemoteAcceptor.submit(DriverRemoteAcceptor.java:188)
at org.apache.tinkerpop.gremlin.console.GremlinGroovysh.execute(GremlinGroovysh.groovy:99)
at org.codehaus.groovy.tools.shell.Shell.leftShift(Shell.groovy:122)
at org.codehaus.groovy.tools.shell.ShellRunner.work(ShellRunner.groovy:95)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$work(InteractiveShellRunner.groovy)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1225)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:145)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:165)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.work(InteractiveShellRunner.groovy:130)
at org.codehaus.groovy.tools.shell.ShellRunner.run(ShellRunner.groovy:59)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$run(InteractiveShellRunner.groovy)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1225)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:145)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:165)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.run(InteractiveShellRunner.groovy:89)
at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:236)
at org.apache.tinkerpop.gremlin.console.Console.<init>(Console.groovy:169)
at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:236)
at org.apache.tinkerpop.gremlin.console.Console.main(Console.groovy:481)
What is this error, and what i must do to fix it?
I assume the problem is that you are not using a session in Gremlin Console:
:remote connect tinkerpop.server connect_config session
I'm fairly new to Flutter and haven't ever used Firebase before so my aplogies if there is an obvious solution to this.
I'm working on a Flutter app which involves recording form submissions and submitting them to a central location.
Firebase Storage seemed like a good fit since as I understood it the app can upload files to the cloud bucket and then they can be accessed through the Firebase console. Correct me if I'm wrong.
So I found this module for Flutter;
https://pub.dartlang.org/packages/firebase_storage
I used the example code as a basis.
once at the start of the code I call;
final FirebaseApp app = await FirebaseApp.configure(
name: 'test',
options: new FirebaseOptions(
googleAppID: Platform.isIOS
? '{ios app id}'
: '{android app ID}',
gcmSenderID: '{project number code}',
apiKey: '{web api key from the firebase console}',
projectID: '{project ID}',
),
);
storage = new FirebaseStorage(
app: app, storageBucket: '{address to data bucket}');
Then to upload a file I've tried;
final StorageReference ref =
storage.ref().child('uploads').child(filename);
final StorageUploadTask uploadTask = ref.putFile(
file,
new StorageMetadata(
contentLanguage: 'en',
customMetadata: <String, String>{'activity': 'submission'},
),
);
final Uri downloadUrl = (await uploadTask.future).downloadUrl;
final http.Response downloadData = await http.get(downloadUrl);
final String name = await ref.getName();
final String bucket = await ref.getBucket();
final String path = await ref.getPath();
return downloadData.statusCode >= 200 && 299 >= downloadData.statusCode;
and in the Firebase console I created the Uploads folder and I think set everything else up correctly.
My Firebase storage access rules look like this;
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write: if request.auth != null;
}
}
}
My issue is that when I try to upload the file I get the following error;
W/DynamiteModule(25832): Local module descriptor class for com.google.android.gms.firebasestorage not found.
I/DynamiteModule(25832): Considering local module com.google.android.gms.firebasestorage:0 and remote module com.google.android.gms.firebasestorage:6
I/DynamiteModule(25832): Selected remote version of com.google.android.gms.firebasestorage, version >= 6
W/System (25832): ClassLoader referenced unknown path: /data/data/com.google.android.gms/app_chimera/m/00000040/n/armeabi-v7a
W/System (25832): ClassLoader referenced unknown path: /data/data/com.google.android.gms/app_chimera/m/00000040/n/armeabi
E/StorageUtil(25832): error getting token java.util.concurrent.ExecutionException: com.google.firebase.internal.api.FirebaseNoSignedInUserException: Please sign in before trying to get a token.
W/NetworkRequest(25832): no auth token for request
E/StorageException(25832): StorageException has occurred.
E/StorageException(25832): User does not have permission to access this object.
E/StorageException(25832): Code: -13021 HttpResult: 403
E/StorageException(25832): The server has terminated the upload session
E/StorageException(25832): java.io.IOException: The server has terminated the upload session
E/StorageException(25832): at com.google.firebase.storage.UploadTask.zzs(Unknown Source)
E/StorageException(25832): at com.google.firebase.storage.UploadTask.zzr(Unknown Source)
E/StorageException(25832): at com.google.firebase.storage.UploadTask.run(Unknown Source)
E/StorageException(25832): at com.google.firebase.storage.StorageTask.zzl(Unknown Source)
E/StorageException(25832): at com.google.firebase.storage.zzq.run(Unknown Source)
E/StorageException(25832): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
E/StorageException(25832): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
E/StorageException(25832): at java.lang.Thread.run(Thread.java:818)
E/StorageException(25832): Caused by: java.io.IOException: { "error": { "code": 403, "message": "Permission denied. Could not perform this operation" }}
E/StorageException(25832): at bha.a(:com.google.android.gms.dynamite_dynamitemodulesc#12685022#12.6.85 (040308-197041431):147)
E/StorageException(25832): at bha.a(:com.google.android.gms.dynamite_dynamitemodulesc#12685022#12.6.85 (040308-197041431):119)
E/StorageException(25832): at bgu.onTransact(:com.google.android.gms.dynamite_dynamitemodulesc#12685022#12.6.85 (040308-197041431):7)
E/StorageException(25832): at android.os.Binder.transact(Binder.java:387)
E/StorageException(25832): at com.google.android.gms.internal.firebase_storage.zza.transactAndReadExceptionReturnVoid(Unknown Source)
E/StorageException(25832): at com.google.android.gms.internal.firebase_storage.zzm.zzf(Unknown Source)
E/StorageException(25832): at com.google.android.gms.internal.firebase_storage.zzq.zza(Unknown Source)
E/StorageException(25832): at com.google.android.gms.internal.firebase_storage.zzf.zza(Unknown Source)
E/StorageException(25832): at com.google.firebase.storage.UploadTask.zzc(Unknown Source)
E/StorageException(25832): ... 6 more
E/StorageException(25832): StorageException has occurred.
E/StorageException(25832): User does not have permission to access this object.
E/StorageException(25832): Code: -13021 HttpResult: 403
E/StorageException(25832): The server has terminated the upload session
E/StorageException(25832): java.io.IOException: The server has terminated the upload session
E/StorageException(25832): at com.google.firebase.storage.UploadTask.zzs(Unknown Source)
E/StorageException(25832): at com.google.firebase.storage.UploadTask.zzr(Unknown Source)
E/StorageException(25832): at com.google.firebase.storage.UploadTask.run(Unknown Source)
E/StorageException(25832): at com.google.firebase.storage.StorageTask.zzl(Unknown Source)
E/StorageException(25832): at com.google.firebase.storage.zzq.run(Unknown Source)
E/StorageException(25832): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
E/StorageException(25832): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
E/StorageException(25832): at java.lang.Thread.run(Thread.java:818)
E/StorageException(25832): Caused by: java.io.IOException: { "error": { "code": 403, "message": "Permission denied. Could not perform this operation" }}
E/StorageException(25832): at bha.a(:com.google.android.gms.dynamite_dynamitemodulesc#12685022#12.6.85 (040308-197041431):147)
E/StorageException(25832): at bha.a(:com.google.android.gms.dynamite_dynamitemodulesc#12685022#12.6.85 (040308-197041431):119)
E/StorageException(25832): at bgu.onTransact(:com.google.android.gms.dynamite_dynamitemodulesc#12685022#12.6.85 (040308-197041431):7)
E/StorageException(25832): at android.os.Binder.transact(Binder.java:387)
E/StorageException(25832): at com.google.android.gms.internal.firebase_storage.zza.transactAndReadExceptionReturnVoid(Unknown Source)
E/StorageException(25832): at com.google.android.gms.internal.firebase_storage.zzm.zzf(Unknown Source)
E/StorageException(25832): at com.google.android.gms.internal.firebase_storage.zzq.zza(Unknown Source)
E/StorageException(25832): at com.google.android.gms.internal.firebase_storage.zzf.zza(Unknown Source)
E/StorageException(25832): at com.google.firebase.storage.UploadTask.zzc(Unknown Source)
E/StorageException(25832): ... 6 more
Is it possible to log in with an app account (service account?) so individual users do not need to log in?
What am I doing wrong here?
Quoting from your StorageException:
User does not have permission to access this object.
This is what you would expect because your rules state the following:
allow read, write: if request.auth != null;
Firebase uses authentication.
There are two options to solve this:
Either you authenticate your users with Firebase using the firebase_auth plugin
Or you make your files publicly available by changing your rules to allow read, write;
The Storage Rules documentation contains information about integrating Firebase Authentication.
Getting the below error when trying to start the node (corda.jar) whose node config file contains the public IP address of my AWS instance instead of localhost:
1+0000 [main] internal.Node.run - Exception during node startup {}
.BindException: Cannot assign requested address: bind
t sun.nio.ch.Net.bind0(Native Method) ~[?:1.8.0_161]
t sun.nio.ch.Net.bind(Unknown Source) ~[?:1.8.0_161]
t sun.nio.ch.Net.bind(Unknown Source) ~[?:1.8.0_161]
t sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source) ~[?:1.8.0_161]
t io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:128) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
t io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:554) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
t io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1258) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
t io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:501) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
t io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:486) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
t io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:980) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
t io.netty.channel.AbstractChannel.bind(AbstractChannel.java:250) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
t io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:365) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
t io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
t io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:403) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
t io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:442) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
t io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
t java.lang.Thread.run(Unknown Source) ~[?:1.8.0_161]
Try setting the address and adminAddress in your node's RPC settings to 0.0.0.0, leaving the port untouched. For example:
rpcSettings {
address="0.0.0.0:10010"
adminAddress="0.0.0.0:10011"
}
These addresses do not need to be accessible from other nodes, as they are solely used by the node itself during start-up.