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
Related
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.
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 am migrating my project to an instant apps structure and I have had to disable Crashlytics to continue my development.
I have setup Crashlytics in the base module and applied all suugestions in this thread:
How do I integrate Crashlytics with Android Instant Apps?
However, this thread doesn't have any update in 2018.
This is the error that I get:
:base:fabricGenerateResourcesDebugFeature
ERROR - Crashlytics Developer Tools error.
java.lang.IllegalArgumentException: Crashlytics found an invalid API key: null.
Check the Crashlytics plugin to make sure that the application has been added successfully!
Contact support#fabric.io for assistance.
at com.crashlytics.tools.android.DeveloperTools.processApiKey(DeveloperTools.java:375)
at com.crashlytics.tools.android.DeveloperTools.processProperties(DeveloperTools.java:517)
at com.crashlytics.tools.android.DeveloperTools.processArgsInternal(DeveloperTools.java:348)
at com.crashlytics.tools.android.DeveloperTools.gradleMain(DeveloperTools.java:292)
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:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.invoke(StaticMetaMethodSite.java:46)
at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.call(StaticMetaMethodSite.java:91)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
at com.crashlytics.tools.gradle.tasks.FabricTaskBuilder.callDevtoolsWrappingRuntimeExceptions(FabricTaskBuilder.groovy:367)
at com.crashlytics.tools.gradle.tasks.FabricTaskBuilder.this$2$callDevtoolsWrappingRuntimeExceptions(FabricTaskBuilder.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:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:384)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:69)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166)
at com.crashlytics.tools.gradle.tasks.FabricTaskBuilder$_pluginGenerateResources_closure4.doCall(FabricTaskBuilder.groovy:133)
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:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
at groovy.lang.Closure.call(Closure.java:414)
at groovy.lang.Closure.call(Closure.java:430)
at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:726)
at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:699)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:124)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:113)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:95)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:73)
at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101)
at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:256)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:249)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:238)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:663)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:597)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
at java.lang.Thread.run(Thread.java:745)
:base:fabricGenerateResourcesDebugFeature FAILED
My root project gradle file:
buildscript {
project.ext.compileSdkVersion = 27
project.ext.buildToolsVersion = "27.0.1"
repositories {
jcenter()
maven {
url 'https://maven.google.com'
}
google()
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'io.fabric.tools:gradle:1.26.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven {
url 'https://maven.google.com'
}
jcenter()
}
}
My base module gradle file:
apply plugin: 'com.android.feature'
apply plugin: 'io.fabric'
android {
buildToolsVersion '27.0.1'
compileSdkVersion 27
baseFeature true
dataBinding {
enabled = true
}
defaultConfig {
minSdkVersion 21
targetSdkVersion 27
testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
}
buildTypes {
release {
minifyEnabled true
}
}
packagingOptions {
exclude 'LICENSE.txt'
}
}
ext {
supportLibVersion = "27.0.1"
espressoVersion = "2.2.2"
androidTestVersion = "0.5"
hamcrestVersion = "1.3"
junitVersion = "4.12"
}
crashlytics {
instantAppSupport true
}
dependencies {
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.7'
compile "com.android.support:appcompat-v7:${supportLibVersion}"
compile "com.android.support:cardview-v7:${supportLibVersion}"
compile "com.android.support:design:${supportLibVersion}"
compile "com.android.support:recyclerview-v7:${supportLibVersion}"
compile "com.android.support.test.espresso:espresso-idling-resource:${espressoVersion}"
testCompile "junit:junit:${junitVersion}"
androidTestCompile("com.android.support.test.espresso:espresso-core:${espressoVersion}") {
exclude module: "espresso-idling-resource"
exclude group: "com.android.support"
}
androidTestCompile("com.android.support.test.espresso:espresso-contrib:${espressoVersion}") {
exclude module: "espresso-core"
exclude module: "recyclerview-v7"
exclude group: "com.android.support"
}
androidTestCompile("com.android.support.test:rules:${androidTestVersion}") {
exclude group: "com.android.support"
}
androidTestCompile("com.android.support.test:runner:${androidTestVersion}") {
exclude group: "com.android.support"
}
androidTestCompile "org.hamcrest:hamcrest-core:${hamcrestVersion}"
}
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.