I am testing how to write a simple azure function that updates an azure sql database.
From VS2017 I made a new Cloud->Azure function v2 with netstandars 2.0. My code is the following:
[FunctionName("Activate")]
public static IActionResult Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)]HttpRequest req, TraceWriter log)
{
log.Info("C# HTTP trigger function processed a request.");
string serialNumber = req.Query["SerialNumber"];
try
{
var str = "CONNECTION_STRING_FOR AZURE SQL";
using (SqlConnection conn = new SqlConnection(str))
{
conn.Open();
var text = $"UPDATE CLIENT SET ACTIVATION_DATE = '2018-07-23 WHERE SERIAL_NUMBER='{serialNumber}'";
using (SqlCommand cmd = new SqlCommand(text, conn))
{
// Execute the command and log the # rows affected.
var rows = cmd.ExecuteNonQuery();
log.Info($"{rows} rows were updated");
}
}
}
catch (Exception ex)
{
return new BadRequestObjectResult(ex.Message);
}
return serialNumber != null
? (ActionResult)new OkObjectResult($"Hello, {serialNumber}")
: new BadRequestObjectResult("error");
}
It compiles and can be run locally from visual studio:
Hosting environment: Production
Content root path: C:\Projects\xxx\bin\Debug\netstandard2.0
Now listening on: http://localhost:7071
Application started. Press Ctrl+C to shut down.
[24/7/2018 8:50:48 πμ] Reading host configuration file 'C:\Projects\xxx\bin\Debug\netstandard2.0\host.json'
[24/7/2018 8:50:48 πμ] Host configuration file read:
[24/7/2018 8:50:48 πμ] {}
[24/7/2018 8:50:48 πμ] Starting Host (HostId=xxx-1133968365, InstanceId=58079dab-xxx-4bb9-aaf5-f24xxx63d3c, Version=2.0.11651.0, ProcessId=11304, AppDomainId=1, Debug=False, ConsecutiveErrors=0, StartupCount=1, FunctionsExtensionVersion=)
[24/7/2018 8:50:48 πμ] Unable to configure java worker. Could not find JAVA_HOME app setting.
[24/7/2018 8:50:48 πμ]
[24/7/2018 8:50:48 πμ] Could not configure language worker Java.
[24/7/2018 8:50:48 πμ]
[24/7/2018 8:50:49 πμ] Generating 1 job function(s)
[24/7/2018 8:50:49 πμ] Found the following functions:
[24/7/2018 8:50:49 πμ] ClientFunctions.Run
[24/7/2018 8:50:49 πμ]
[24/7/2018 8:50:49 πμ] Host initialized (1511ms)
[24/7/2018 8:50:49 πμ] Host started (1616ms)
[24/7/2018 8:50:49 πμ] Job host started
Listening on http://localhost:7071/
Hit CTRL-C to exit...
Http Functions:
Activate: http://localhost:7071/api/Activate
But if I access it through postman I get:
[24/7/2018 8:52:58 πμ] Executing 'Activate' (Reason='This function was programmatically called via the host APIs.', Id=30cff68d-b8db-446e-bd6d-407990524198)
[24/7/2018 8:52:58 πμ] Executed 'Activate' (Failed, Id=30cff68d-b8db-446e-bd6d-407990524198)
[24/7/2018 8:52:58 πμ] System.Private.CoreLib: Exception while executing function: Activate. Mik3UpdateFunctionNew: Could not load file or assembly 'System.Data.SqlClient, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Could not find or load a specific file. (Exception from HRESULT: 0x80131621). System.Private.CoreLib: Could not load file or assembly 'System.Data.SqlClient, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
What I find strange is that each time I start VS2017 and debug the program, a window appears that says downloading azure functions cli tools 2.3.2.
Can someone suggest anything?
Thanks
#Josh is right. The downloading tip you saw means VS tried to download the latest functin CLI. But actually the downloading failed and it fell back to use the old one, as you can see in your CLI output
Starting Host (...,Version=2.0.11651.0,...)
It represents the function host version, which is used by CLI 2.0.1-beta.25. While for now the latest host is 2.0.11933.0 with CLI 2.0.1-beta.33, i.e.2.3.2 specified by VS.
Here are some details about how to consume the latest CLI.
If you already has the tools folder %LocalAPPDATA%\AzureFunctionsTools, delete it to avoid corrupting new tools.
On VS menus, Tools->Extensions and Updates, find Azure Functions and Web Jobs Tools, make sure it's updated to latest version(right now 15.0.40617.0).
If it has been the latest, just restart VS and create a new Azure Function project, wait at the create dialog for VS to download new CLI and templates.
After a while, we can see the tip change to
Then you can see Starting Host (...,Version=2.0.11933.0,...) while debugging locally and your code should work.
If you still see 2.0.11651.0, go check whether this folder%LocalAPPDATA%\AzureFunctionsTools\Releases\2.3.2exists, which contains cli, templates and manifest.json. If the downloading turns out failed, just delete %LocalAPPDATA%\AzureFunctionsTools folder and restart VS to download again.
Update--how to download tools manually due to poor network.
Open %LocalAPPDATA%\AzureFunctionsTools\feed.json, find "2.3.2":{...} content. Download its cli, itemTemplates and projectTemplates.(Need to rename manually after download).
And folder structure in %LocalAPPDATA%\AzureFunctionsTools\Releases\2.3.2 is like this(same to 2.0.1-beta.25 folder)
cli
--...
templates
--ItemTemplates.nupkg
--ProjectTemplates.nupkg
manifest.json
Content of manifest.json
{
"ReleaseName": "2.3.2",
"CliEntrypointPath":"C:\\Users\\UserName\\AppData\\Local\\AzureFunctionsTools\\Releases\\2.3.2\\cli\\func.exe",
"TemplatesDirectory": "C:\\Users\\UserName\\AppData\\Local\\AzureFunctionsTools\\Releases\\2.3.2\\templates",
"FunctionsExtensionVersion": "beta",
"SdkPackageVersion": "1.0.14"
}
The prompt you are seeing is the Azure Functions extensions for Visual Studio updating your local Azure Functions CLI to the latest version. There has been a lot of updates recently with the Azure Functions 2.0 preview, especially with how assemblies are being resolved (which falls into the category of your error). I would encourage you to allow the update to complete. With all the changes occurring as of late with 2.0 it's easy to get some mismatched versions and references between local dev and whats deployed to azure that causes various problems.
If the error still occurs I would suggest opening an issue on Github with the error details as they are looking for feedback in regards to any assembly binding errors that folks are still getting.
Related
I am trying to use Default Azure credential to connect to a Service Bus Queue from my Spring Boot application (Kotlin) and have trouble getting the setup to work locally with the IntelliJ plugin.
I am trying to connect to a Service Bus queue to send a message, if I use a connection string it works fine but I would like to handle access with the default credentials.
val predictionRequestsClient = ServiceBusClientBuilder()
.credential(topicModelingProperties.namespace, credential)
.sender()
.queueName(topicModelingProperties.predictionQueue.requests)
.buildClient()
I've tried using the IntellijCredentials directly:
val credential = IntelliJCredentialBuilder()
.keePassDatabasePath("<MY PATH TO PWD STORAGE>")
.build()
or the default credentials (long term goal):
val credential = DefaultAzureCredentialBuilder()
.intelliJKeePassDatabasePath("<MY PATH TO PWD STORAGE>")
.build()
I did install the Azure Toolkit plugin in IntelliJ, logged in in my IDE, the plugin tells me even so in this screenshot:
Nevertheless when I try to send something to the queue I get the following error using the IntelliJCredentials:
[2022-06-28 08:47:13.285] ERROR [task-4] --- o.s.a.i.SimpleAsyncUncaughtExceptionHandler: Unexpected exception occurred invoking async method: public void at.teamecho.topic.CommentClassifier.addToClassificationQueue(at.teamecho.comment.CommentSubmissionEvent)
com.azure.messaging.servicebus.ServiceBusException: IntelliJ Authentication not available. Please log in with Azure Tools for IntelliJ plugin in the IDE.
at com.azure.messaging.servicebus.ServiceBusSenderAsyncClient.mapError(ServiceBusSenderAsyncClient.java:820)
at reactor.core.publisher.Mono.lambda$onErrorMap$31(Mono.java:3733)
at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onError(FluxOnErrorResume.java:94)
at reactor.core.publisher.MonoFlatMap$FlatMapMain.onError(MonoFlatMap.java:172)
at reactor.core.publisher.MonoPeekTerminal$MonoTerminalPeekSubscriber.onError(MonoPeekTerminal.java:258)
at reactor.core.publisher.SerializedSubscriber.onError(SerializedSubscriber.java:124)
at reactor.core.publisher.FluxRetryWhen$RetryWhenMainSubscriber.whenError(FluxRetryWhen.java:225)
at reactor.core.publisher.FluxRetryWhen$RetryWhenOtherSubscriber.onError(FluxRetryWhen.java:274)
at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.drain(FluxConcatMap.java:415)
at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.onNext(FluxConcatMap.java:251)
at reactor.core.publisher.EmitterProcessor.drain(EmitterProcessor.java:491)
at reactor.core.publisher.EmitterProcessor.tryEmitNext(EmitterProcessor.java:299)
at reactor.core.publisher.SinkManySerialized.tryEmitNext(SinkManySerialized.java:100)
at reactor.core.publisher.InternalManySink.emitNext(InternalManySink.java:27)
at reactor.core.publisher.FluxRetryWhen$RetryWhenMainSubscriber.onError(FluxRetryWhen.java:190)
at reactor.core.publisher.SerializedSubscriber.onError(SerializedSubscriber.java:124)
at reactor.core.publisher.SerializedSubscriber.onError(SerializedSubscriber.java:124)
at reactor.core.publisher.FluxTimeout$TimeoutMainSubscriber.onError(FluxTimeout.java:219)
at reactor.core.publisher.FluxPeekFuseable$PeekFuseableSubscriber.onError(FluxPeekFuseable.java:234)
at reactor.core.publisher.MonoFlatMap$FlatMapMain.secondError(MonoFlatMap.java:192)
at reactor.core.publisher.MonoFlatMap$FlatMapInner.onError(MonoFlatMap.java:259)
at reactor.core.publisher.MonoFlatMap$FlatMapMain.secondError(MonoFlatMap.java:192)
at reactor.core.publisher.MonoFlatMap$FlatMapInner.onError(MonoFlatMap.java:259)
at reactor.core.publisher.FluxMap$MapSubscriber.onError(FluxMap.java:132)
at reactor.core.publisher.FluxMap$MapSubscriber.onError(FluxMap.java:132)
at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onError(MonoIgnoreThen.java:278)
at reactor.core.publisher.MonoWhen$WhenCoordinator.signalError(MonoWhen.java:172)
at reactor.core.publisher.MonoWhen$WhenInner.onError(MonoWhen.java:288)
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onError(FluxMapFuseable.java:140)
at reactor.core.publisher.MonoFlatMap$FlatMapMain.secondError(MonoFlatMap.java:192)
at reactor.core.publisher.MonoFlatMap$FlatMapInner.onError(MonoFlatMap.java:259)
at reactor.core.publisher.MonoFlatMap$FlatMapMain.secondError(MonoFlatMap.java:192)
at reactor.core.publisher.MonoFlatMap$FlatMapInner.onError(MonoFlatMap.java:259)
at reactor.core.publisher.MonoFlatMap$FlatMapMain.onError(MonoFlatMap.java:172)
at reactor.core.publisher.MonoPeekTerminal$MonoTerminalPeekSubscriber.onError(MonoPeekTerminal.java:258)
at reactor.core.publisher.FluxPeekFuseable$PeekConditionalSubscriber.onError(FluxPeekFuseable.java:903)
at reactor.core.publisher.FluxMap$MapConditionalSubscriber.onError(FluxMap.java:259)
at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onError(Operators.java:2063)
at reactor.core.publisher.Operators.error(Operators.java:198)
at reactor.core.publisher.MonoError.subscribe(MonoError.java:53)
at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52)
at reactor.core.publisher.Mono.subscribe(Mono.java:4400)
at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onComplete(FluxSwitchIfEmpty.java:82)
at reactor.core.publisher.Operators.complete(Operators.java:137)
at reactor.core.publisher.MonoEmpty.subscribe(MonoEmpty.java:46)
at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52)
at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64)
at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:157)
at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1816)
at com.azure.core.amqp.implementation.AmqpChannelProcessor$ChannelSubscriber.onNext(AmqpChannelProcessor.java:398)
at com.azure.core.amqp.implementation.AmqpChannelProcessor.lambda$onNext$0(AmqpChannelProcessor.java:112)
at java.base/java.util.concurrent.ConcurrentLinkedDeque.forEach(ConcurrentLinkedDeque.java:1650)
at com.azure.core.amqp.implementation.AmqpChannelProcessor.onNext(AmqpChannelProcessor.java:112)
at reactor.core.publisher.FluxRepeatPredicate$RepeatPredicateSubscriber.onNext(FluxRepeatPredicate.java:86)
at reactor.core.publisher.FluxPeekFuseable$PeekFuseableSubscriber.onNext(FluxPeekFuseable.java:210)
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:127)
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:127)
at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1816)
at reactor.core.publisher.MonoFlatMap$FlatMapInner.onNext(MonoFlatMap.java:249)
at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.complete(MonoIgnoreThen.java:292)
at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onNext(MonoIgnoreThen.java:187)
at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:236)
at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onComplete(MonoIgnoreThen.java:203)
at reactor.core.publisher.SerializedSubscriber.onComplete(SerializedSubscriber.java:146)
at reactor.core.publisher.SerializedSubscriber.onComplete(SerializedSubscriber.java:146)
at reactor.core.publisher.FluxTimeout$TimeoutMainSubscriber.onComplete(FluxTimeout.java:234)
at reactor.core.publisher.MonoNext$NextSubscriber.onComplete(MonoNext.java:102)
at reactor.core.publisher.MonoNext$NextSubscriber.onNext(MonoNext.java:83)
at reactor.core.publisher.FluxFilterFuseable$FilterFuseableSubscriber.onNext(FluxFilterFuseable.java:118)
at reactor.core.publisher.FluxReplay$SizeBoundReplayBuffer.replayNormal(FluxReplay.java:856)
at reactor.core.publisher.FluxReplay$SizeBoundReplayBuffer.replay(FluxReplay.java:944)
at reactor.core.publisher.FluxReplay$ReplaySubscriber.onNext(FluxReplay.java:1323)
at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext(FluxPeek.java:200)
at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext(FluxPeek.java:200)
at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:120)
at reactor.core.publisher.FluxDistinctUntilChanged$DistinctUntilChangedSubscriber.tryOnNext(FluxDistinctUntilChanged.java:149)
at reactor.core.publisher.FluxDistinctUntilChanged$DistinctUntilChangedSubscriber.onNext(FluxDistinctUntilChanged.java:102)
at reactor.core.publisher.FluxReplay$SizeBoundReplayBuffer.replayNormal(FluxReplay.java:856)
at reactor.core.publisher.FluxReplay$SizeBoundReplayBuffer.replay(FluxReplay.java:944)
at reactor.core.publisher.ReplayProcessor.tryEmitNext(ReplayProcessor.java:508)
at reactor.core.publisher.SinkManySerialized.tryEmitNext(SinkManySerialized.java:100)
at reactor.core.publisher.InternalManySink.emitNext(InternalManySink.java:27)
at com.azure.core.amqp.implementation.handler.Handler.onNext(Handler.java:89)
at com.azure.core.amqp.implementation.handler.SessionHandler.onSessionRemoteOpen(SessionHandler.java:87)
at org.apache.qpid.proton.engine.BaseHandler.handle(BaseHandler.java:146)
at org.apache.qpid.proton.engine.impl.EventImpl.dispatch(EventImpl.java:108)
at org.apache.qpid.proton.reactor.impl.ReactorImpl.dispatch(ReactorImpl.java:324)
at org.apache.qpid.proton.reactor.impl.ReactorImpl.process(ReactorImpl.java:291)
at com.azure.core.amqp.implementation.ReactorExecutor.run(ReactorExecutor.java:91)
at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:68)
at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:28)
at java.base/java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:264)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Suppressed: java.lang.Exception: #block terminated with an error
at reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:139)
at reactor.core.publisher.Mono.block(Mono.java:1731)
at com.azure.messaging.servicebus.ServiceBusSenderClient.sendMessage(ServiceBusSenderClient.java:178)
at at.teamecho.topic.CommentClassifier.addToClassificationQueue(CommentClassificationService.kt:41)
at at.teamecho.topic.CommentClassifier$$FastClassBySpringCGLIB$$8be0e530.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:783)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753)
at net.bull.javamelody.MonitoringSpringInterceptor.invoke(MonitoringSpringInterceptor.java:76)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753)
at org.springframework.aop.interceptor.AsyncExecutionInterceptor.lambda$invoke$0(AsyncExecutionInterceptor.java:115)
at java.base/java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:264)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java)
... 3 common frames omitted
Caused by: com.azure.identity.CredentialUnavailableException: IntelliJ Authentication not available. Please log in with Azure Tools for IntelliJ plugin in the IDE.
at com.azure.identity.implementation.IdentityClient.authenticateWithIntelliJ(IdentityClient.java:358)
at com.azure.identity.IntelliJCredential.lambda$getToken$2(IntelliJCredential.java:87)
at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:44)
... 56 common frames omitted
[2022-06-28 08:47:13.328] INFO [reactor-executor-5] --- c.a.c.a.i.h.SendLinkHandler: {"az.sdk.message":"onLinkRemoteOpen","connectionId":"MF_4ff63d_1656398832884","linkName":"cbs:sender","entityPath":"$cbs","remoteTarget":"Target{address='$cbs', durable=NONE, expiryPolicy=SESSION_END, timeout=0, dynamic=false, dynamicNodeProperties=null, capabilities=null}"}
[2022-06-28 08:47:13.328] INFO [reactor-executor-5] --- c.a.c.a.i.AmqpChannelProcessor: {"az.sdk.message":"Channel is now active.","connectionId":"MF_4ff63d_1656398832884","entityPath":"$cbs"}
[2022-06-28 08:47:13.328] INFO [reactor-executor-5] --- c.a.c.a.i.h.ReceiveLinkHandler: {"az.sdk.message":"onLinkRemoteOpen","connectionId":"MF_4ff63d_1656398832884","entityPath":"$cbs","linkName":"cbs:receiver","remoteSource":"Source{address='$cbs', durable=NONE, expiryPolicy=SESSION_END, timeout=0, dynamic=false, dynamicNodeProperties=null, distributionMode=null, filter=null, defaultOutcome=null, outcomes=null, capabilities=null}"}
Which basically tells me IntelliJ Authentication not available. Please log in with Azure Tools for IntelliJ plugin in the IDE, but in the IDE I am logged in.
After googling and debugging a bit it seems I am missing the AuthMethodDetails.json file, that should be written by the plugin - it does not exist on my machine.
I have tried to log in with OAuth 2.0 and the Device Login already but none of the options were writing the AuthMethodDetails / making the connection work.
TLDR;
Do I need the AuthMethodDetails.json for the Intellij plugin to work?
What could be a reason for it not being written for me and how can I get it written?
Versions:
com.azure:azure-identity:1.5.2
com.azure:azure-messaging-servicebus:7.9.1
IntelliJ IDEA 2022.1.3 (Ultimate Edition) - Build #IU-221.5921.22, built on June 21, 2022
I have a Flutter Web project, and when an error is thrown, I can't open the dart file where the error was thrown, because the error line points to a JS file:
Launching lib\main.dart on Chrome in debug mode...
Waiting for connection from debug service on Chrome...
This app is linked to the debug service: ws://127.0.0.1:63045/gOvW2paMrLg=/ws
Debug service listening on ws://127.0.0.1:63045/gOvW2paMrLg=/ws
Running with sound null safety
Debug service listening on ws://127.0.0.1:63045/gOvW2paMrLg=/ws
Error: Invalid argument(s): A value must be provided. Supported values: 0, 1
at Object.throw_ [as throw] (http://localhost:53846/dart_sdk.js:5061:11)
at Object._$36enumDecode [as _$enumDecode] (http://localhost:53846/packages/web_app/core/models/pessoa/pessoa.dart.lib.js:482:17)
at Object._$36PessoaFromJson [as _$PessoaFromJson] (http://localhost:53846/packages/web_app/core/models/pessoa/pessoa.dart.lib.js:473:54)
at Function.fromJson (http://localhost:53846/packages/web_app/core/models/pessoa/pessoa.dart.lib.js:375:21)
at http://localhost:53846/packages/web_app/repository/pessoa_repository.dart.lib.js:60:193
at repository.RepositoryGetter.new.getRecurso (http://localhost:53846/packages/web_app/repository/repository.dart.lib.js:33:18)
at getRecurso.next (<anonymous>)
at http://localhost:53846/dart_sdk.js:38640:33
at _RootZone.runUnary (http://localhost:53846/dart_sdk.js:38511:59)
at _FutureListener.thenAwait.handleValue (http://localhost:53846/dart_sdk.js:33713:29)
at handleValueCallback (http://localhost:53846/dart_sdk.js:34265:49)
at Function._propagateToListeners (http://localhost:53846/dart_sdk.js:34303:17)
at _Future.new.[_completeWithValue] (http://localhost:53846/dart_sdk.js:34151:23)
at async._AsyncCallbackEntry.new.callback (http://localhost:53846/dart_sdk.js:34172:35)
at Object._microtaskLoop (http://localhost:53846/dart_sdk.js:38778:13)
at _startMicrotaskLoop (http://localhost:53846/dart_sdk.js:38784:13)
at http://localhost:53846/dart_sdk.js:34519:9
How can I make it to show the dart file where the error occurred, instead of a JS file?
I'm using Flutter Channel stable 2.5.2, Android Studio version 2020.3.
I have found a workaround for this issue.
You basically have to install a third-party patch; it will translate the paths in JS and point to the right line in dart file.
Download the patch and follow the instructions here: https://github.com/obeobe/flutter-web-exception-mapper
Optionally you can see trace of dart files in the browser.
Make sure you have source maps enabled in your browser.
got the answer from this link on github
I am in the process of creating an Azure Function Apps project. I get
the following error when running the server.
Hosting environment: Production
Content root path:
/Users/dentonsavage/Projects/AzureFunctionTest/AzureFunctionTest/bin/Debug/netstandard2.0
Now listening on: http://localhost:7071 Application started. Press Ctrl+C to shut down.
[7/9/18 9:48:39 PM] Reading host configuration file '/Users/dentonsavage/Projects/AzureFunctionTest/AzureFunctionTest/bin/Debug/netstandard2.0/host.json'
[7/9/18 9:48:39 PM] Host configuration file read:{}
[7/9/18 9:48:39 PM] Starting Host (HostId=shoufu-1532713004, InstanceId=9869d715-4618-48f0-b0d1-16c4fea66dba, Version=2.0.11651.0, ProcessId=43170, AppDomainId=1, Debug=False, ConsecutiveErrors=0, StartupCount=1, FunctionsExtensionVersion=)
[7/9/18 9:48:40 PM] Unable to configure java worker. Could not find JAVA_HOME app setting.
[7/9/18 9:48:40 PM] Could not configure language worker Java.
[7/9/18 9:48:41 PM] Generating 1 job function(s)
[7/9/18 9:48:41 PM] Found the following functions:
[7/9/18 9:48:41 PM] AzureFunctionTest.HttpTrigger.Run
[7/9/18 9:48:41 PM] Host initialized (2120ms) Listening on
http://localhost:7071/ Hit CTRL-C to exit...
Http Functions:
HttpTrigger: http://localhost:7071/api/HttpTrigger
[7/9/18 9:48:43 PM] Host started (3920ms)
[7/9/18 9:48:43 PM] Job host started
[7/9/18 9:48:44 PM] Host lock lease acquired by instance ID '000000000000000000000000C475F100'.
Does anyone know how I can solve this issue? Thank you.
Actually it's not an error. It's just a tip reminding us there's no JAVA_HOME configuration in your system environment variables.
It was used for java development before but has been proved unnecessary and removed in new version Azure Function core tools. See this issue.
So you can just ignore this harmless tip or install latest version function core tools to get rid of it.
Installation Steps:
Install .NET Core for macOS.
Install Homebrew, if it's not already installed.
Install the Core Tools package using bash:
brew tap azure/functions
brew install azure-functions-core-tools
After that navigate to Content root path:
/Users/dentonsavage/Projects/AzureFunctionTest/AzureFunctionTest/bin/Debug/netstandard2.0
Then input func start in bash to debug your project.
I am having the exact same issue as this question
But none of the answers works, been googling for a long time and my versions are updated etc and still I get that same error
Code is the sample template
using System;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Host;
namespace NWMPosNGPimFeeder
{
public static class Function1
{
[FunctionName("Function1")]
public static void Run([TimerTrigger("0 */1 * * * *")]TimerInfo myTimer, TraceWriter log)
{
log.Info($"C# Timer trigger function executed at: {DateTime.Now}");
}
}
}
Versions of host etc is as follows including the actual error
[21/5/2018 2:03:29 AM] Host has been specialized
Listening on http://localhost:7071/
Hit CTRL-C to exit...
[21/5/2018 2:03:29 AM] Reading host configuration file 'C:\Users\MattDouhan\source\repos\NWMPosNGPimFeeder\NWMPosNGPimFeeder\bin\Debug\net461\host.json'
[21/5/2018 2:03:29 AM] Host configuration file read:
[21/5/2018 2:03:29 AM] {
[21/5/2018 2:03:29 AM] }
[21/5/2018 2:03:30 AM] Loaded custom extension 'BotFrameworkConfiguration'
[21/5/2018 2:03:30 AM] Loaded custom extension 'SendGridConfiguration'
[21/5/2018 2:03:30 AM] Loaded custom extension 'EventGridExtensionConfig'
[21/5/2018 2:03:31 AM] Generating 1 job function(s)
[21/5/2018 2:03:31 AM] Starting Host (HostId=desktop7cks1do-1972353084, Version=1.0.11232.0, ProcessId=2668, Debug=False, Attempt=0)
[21/5/2018 2:03:31 AM] A ScriptHost error has occurred
[21/5/2018 2:03:31 AM] Microsoft.Azure.WebJobs.Host: Error indexing method 'Function1.Run'. Microsoft.Azure.WebJobs.Host: Cannot bind parameter 'log' to type TraceWriter. Make sure the parameter Type is supported by the binding. If you're using binding extensions (e.g. ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. config.UseServiceBus(), config.UseTimers(), etc.).
[21/5/2018 2:03:31 AM] Error indexing method 'Function1.Run'
Problem locates at the old function cli VS is using.
Version=1.0.11232.0
It means the cli version is 1.0.4. This old version does cause your issue but it has already been fixed in new ones.
Check your Azure Functions and Web Jobs Tools version.
Latest extension 15.0.40502.0, will make VS use cli 1.0.4 if VS fails to download new version cli. This downloading process is in background and seems no explicit warning. See This GitHub issue.
Solution
I recommend you to delete C:\Users\UserName\AppData\Local\AzureFunctionsTools folder and restart your VS to download it again.
When we create a function app, we can see tip on the dialog that Making sure all templates are up to date...
Wait for a while, we can see the tip changes as
If it doesn't change after 3m(time to download 200M files on your side), check C:\Users\UserName\AppData\Local\AzureFunctionsTools\Releases\1.0.12.1 folder to see whether it's empty. If it's empty, which means downloading can't be done through VS. We have to do it manually.
You can find download link of cli, itemTemplates and projectTemplates in C:\Users\UserName\AppData\Local\AzureFunctionsTools\feed.json.
You can refer to 1.0.10 folder to build similar folder structure.
I'm trying to setup a HDInsight emulator on a Windows 8.1 PC following these instructions: https://azure.microsoft.com/en-us/documentation/articles/hdinsight-hadoop-emulator-get-started/
When trying to run a MapReduce job, I get a connection error.
How can I solve or further investigate this issue?
Details below.
Prerequisites:
Installed Azure Powershell and Azure SDK for VS 2015
Installed HDInsight Emulator for Azure incl. Hortonworks Data Platform
Started local hdp services (13 services running)
Connected Visual Studio to Emulator (had to follow troubleshooting point 2: replacing IP addresses in core-site.xml with '*' due to dynamic IP)
Created directories and copied text files as suggested
Problem:
When trying to run the first example, I get the following error:
16/01/11 10:36:39 INFO mapreduce.Job: Job job_1452503376359_0003 failed with state FAILED due to: Application application_1452503376359_0003 failed 2 times due to AM Container for appattempt_1452503376359_0003_000002 exited with exitCode: -1000 due to: Call From EH3HOST/192.168.56.1 to EH3HOST:8020 failed on connection exception: java.net.ConnectException: Connection refused: no further information; For more details see: http://wiki.apache.org/hadoop/ConnectionRefused
.Failing this attempt.. Failing the application.
16/01/11 10:36:39 INFO mapreduce.Job: Counters: 0
The following worked for me:
Search for XML files containing <your own host name>:8020 inside the c:\hdp\hdp-<Version Number>\etc\hadoop\ folder. (e.g. EH3HOST:8020)
You should find at least
mapred-site.xml
core-site.xml
yarn-site.xml
Replace all occurrences within these files with 127.0.0.1:8020.