question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot run CosmosDB trigger function locally

See original GitHub issue

From @jdneo on July 4, 2018 9:16

Here is the logs:

[7/4/2018 9:13:33 AM] Reading host configuration file 'D:\work\Java\maven\Azure-Functions-Java-Samples\CosmosDBTrigger\project\target\azure-functions\azure-functions-name-cas-csc8\host.json'
[7/4/2018 9:13:33 AM] Host configuration file read:
[7/4/2018 9:13:33 AM] {}
[7/4/2018 9:13:33 AM] Starting Host (HostId=shechepc-1694341971, InstanceId=13ff8f45-3118-42d9-9dd8-116c7b8272c0, Version=2.0.11888.0, ProcessId=45756, AppDomainId=1, Debug=False, ConsecutiveErrors=0, StartupCount=1, FunctionsExtensionVersion=)
[7/4/2018 9:13:33 AM] 'FUNCTIONS_WORKER_RUNTIME' is specified, only 'java' will be enabled
[7/4/2018 9:13:33 AM] Loading custom extension 'CosmosDBConfiguration'
[7/4/2018 9:13:33 AM] Loaded custom extension: CosmosDBConfiguration from 'D:\work\Java\maven\Azure-Functions-Java-Samples\CosmosDBTrigger\project\target\azure-functions\azure-functions-name-cas-csc8\bin\Microsoft.Azure.WebJobs.Extensions.CosmosDB.dll'
[7/4/2018 9:13:33 AM] Start Process: C:\Program Files\Java\jdk1.8.0_172\bin\java  -jar "C:\Users\sheche\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\java\azure-functions-java-worker.jar" --host 127.0.0.1 --port 53590 --workerId 58a30f94-9465-4412-9513-3a3fe5f82ebc --requestId 954320f2-c0be-4b84-b2ff-cb5f65a0f275 --grpcMaxMessageLength 134217728
[7/4/2018 9:13:33 AM] Generating 1 job function(s)
[7/4/2018 9:13:34 AM] Microsoft Azure Functions Java Runtime [build 1.1.0-beta6]
[7/4/2018 9:13:34 AM] [INFO] {MessageHandler.handle}: Message generated by "StartStream.Builder"
[7/4/2018 9:13:35 AM] Worker initialized
[7/4/2018 9:13:35 AM] "CosmosDb" loaded (ID: bb1ac841-9668-40b9-a274-f215a91831cf, Reflection: "D:\work\Java\maven\Azure-Functions-Java-Samples\CosmosDBTrigger\project\target\azure-functions\azure-functions-name-cas-csc8\cosmos-db-sample-1.0-SNAPSHOT.jar"::"com.azure.functions.samples.CosmosDb.cosmosDBHandler")
[7/4/2018 9:13:36 AM] Found the following functions:
[7/4/2018 9:13:36 AM] Host.Functions.CosmosDb
[7/4/2018 9:13:36 AM]
[7/4/2018 9:13:36 AM] Host initialized (2642ms)
Listening on http://0.0.0.0:7071/
Hit CTRL-C to exit...
[7/4/2018 9:13:36 AM] Host lock lease acquired by instance ID '000000000000000000000000ED91E885'.
[7/4/2018 9:13:39 AM] The listener for function 'Functions.CosmosDb' was unable to start.
[7/4/2018 9:13:39 AM] The listener for function 'Functions.CosmosDb' was unable to start. System.Private.CoreLib: One or more errors occurred. (Unable to load DLL 'Microsoft.Azure.Documents.ServiceInterop.dll' or one of its dependencies: The specified module could not be found. (Exception from HRESULT: 0x8007007E)). Microsoft.Azure.DocumentDB.Core: Unable to load DLL 'Microsoft.Azure.Documents.ServiceInterop.dll' or one of its dependencies: The specified module could not be found. (Exception from HRESULT: 0x8007007E).
[7/4/2018 9:13:39 AM] The listener for function 'Functions.CosmosDb' was unable to start. System.Private.CoreLib: One or more errors occurred. (Unable to load DLL 'Microsoft.Azure.Documents.ServiceInterop.dll' or one of its dependencies: The specified module could not be found. (Exception from HRESULT: 0x8007007E)). Microsoft.Azure.DocumentDB.Core: Unable to load DLL 'Microsoft.Azure.Documents.ServiceInterop.dll' or one of its dependencies: The specified module could not be found. (Exception from HRESULT: 0x8007007E).
[7/4/2018 9:13:39 AM]
[7/4/2018 9:13:39 AM] Host started (6395ms)
[7/4/2018 9:13:39 AM] Job host started
[7/4/2018 9:13:39 AM] The following 1 functions are in error:
[7/4/2018 9:13:39 AM] CosmosDb: The listener for function 'Functions.CosmosDb' was unable to start. System.Private.CoreLib: One or more errors occurred. (Unable to load DLL 'Microsoft.Azure.Documents.ServiceInterop.dll' or one of its dependencies: The specified module could not be found. (Exception from HRESULT: 0x8007007E)). Microsoft.Azure.DocumentDB.Core: Unable to load DLL 'Microsoft.Azure.Documents.ServiceInterop.dll' or one of its dependencies: The specified module could not be found. (Exception from HRESULT: 0x8007007E).
[7/4/2018 9:13:39 AM]
[7/4/2018 9:13:39 AM]
[7/4/2018 9:13:41 AM] Retrying to start listener for function 'Functions.CosmosDb' (Attempt 1)
[7/4/2018 9:13:41 AM] The listener for function 'Functions.CosmosDb' was unable to start.
[7/4/2018 9:13:41 AM] The listener for function 'Functions.CosmosDb' was unable to start. Microsoft.Azure.Documents.ChangeFeedProcessor: Object reference not set to an instance of an object.
[7/4/2018 9:13:41 AM] The listener for function 'Functions.CosmosDb' was unable to start. Microsoft.Azure.Documents.ChangeFeedProcessor: Object reference not set to an instance of an object.
[7/4/2018 9:13:42 AM]
[7/4/2018 9:13:45 AM] Retrying to start listener for function 'Functions.CosmosDb' (Attempt 2)
[7/4/2018 9:13:45 AM] The listener for function 'Functions.CosmosDb' was unable to start.
[7/4/2018 9:13:45 AM] The listener for function 'Functions.CosmosDb' was unable to start. Microsoft.Azure.Documents.ChangeFeedProcessor: Object reference not set to an instance of an object.
[7/4/2018 9:13:45 AM] The listener for function 'Functions.CosmosDb' was unable to start. Microsoft.Azure.Documents.ChangeFeedProcessor: Object reference not set to an instance of an object.
[7/4/2018 9:13:45 AM]
[7/4/2018 9:13:52 AM] Retrying to start listener for function 'Functions.CosmosDb' (Attempt 3)
[7/4/2018 9:13:52 AM] The listener for function 'Functions.CosmosDb' was unable to start.
[7/4/2018 9:13:52 AM] The listener for function 'Functions.CosmosDb' was unable to start. Microsoft.Azure.Documents.ChangeFeedProcessor: Object reference not set to an instance of an object.
[7/4/2018 9:13:52 AM] The listener for function 'Functions.CosmosDb' was unable to start. Microsoft.Azure.Documents.ChangeFeedProcessor: Object reference not set to an instance of an object.
[7/4/2018 9:13:52 AM]
[7/4/2018 9:14:02 AM] Retrying to start listener for function 'Functions.CosmosDb' (Attempt 4)
[7/4/2018 9:14:02 AM] The listener for function 'Functions.CosmosDb' was unable to start.
[7/4/2018 9:14:02 AM] The listener for function 'Functions.CosmosDb' was unable to start. Microsoft.Azure.Documents.ChangeFeedProcessor: Object reference not set to an instance of an object.
[7/4/2018 9:14:02 AM] The listener for function 'Functions.CosmosDb' was unable to start. Microsoft.Azure.Documents.ChangeFeedProcessor: Object reference not set to an instance of an object.
[7/4/2018 9:14:02 AM]
[7/4/2018 9:14:19 AM] Retrying to start listener for function 'Functions.CosmosDb' (Attempt 5)
[7/4/2018 9:14:19 AM] The listener for function 'Functions.CosmosDb' was unable to start.
[7/4/2018 9:14:19 AM] The listener for function 'Functions.CosmosDb' was unable to start. Microsoft.Azure.Documents.ChangeFeedProcessor: Object reference not set to an instance of an object.
[7/4/2018 9:14:19 AM] The listener for function 'Functions.CosmosDb' was unable to start. Microsoft.Azure.Documents.ChangeFeedProcessor: Object reference not set to an instance of an object.
[7/4/2018 9:14:19 AM]
[7/4/2018 9:14:54 AM] Retrying to start listener for function 'Functions.CosmosDb' (Attempt 6)
[7/4/2018 9:14:54 AM] The listener for function 'Functions.CosmosDb' was unable to start.
[7/4/2018 9:14:54 AM] The listener for function 'Functions.CosmosDb' was unable to start. Microsoft.Azure.Documents.ChangeFeedProcessor: Object reference not set to an instance of an object.
[7/4/2018 9:14:54 AM] The listener for function 'Functions.CosmosDb' was unable to start. Microsoft.Azure.Documents.ChangeFeedProcessor: Object reference not set to an instance of an object.
[7/4/2018 9:14:54 AM]

Copied from original issue: Azure/azure-functions-core-tools#569

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ahmelsayedcommented, Jul 5, 2018

From @mariomeyrelles on July 5, 2018 12:52

In my case I was running node and not java.

I had to be absolutely sure that the indirect dependency, Microsoft.Azure.Documents.ServiceInterop.dll is present on the \bin folder. Adding Microsoft.Azure.DocumentDB.Core in my case:

Another important thing: I ran this sample using real CosmosDB database and collection. I’m not sure if the emulator is good enough for this kind of scenarios.

The image below shows how things are set on my sample:

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to run cosmosDB trigger locally with Azure ...
The problem is your local.settings.json and function.json lack necessary configuration of cosmosdb connection string. See cosmosdb trigger ...
Read more >
Troubleshoot issues with the Azure Functions trigger for ...
The Azure Functions trigger and bindings for Azure Cosmos DB depend ... to run the trigger, you get the error message "Value can't...
Read more >
Cannot run CosmosDB trigger function locally · Issue #569
Cannot run CosmosDB trigger function locally #569 ... 'D:\work\Java\maven\Azure-Functions-Java-Samples\CosmosDBTrigger\project\target\azure- ...
Read more >
Not able to run Cosmos DB Change Feed Trigger Azure ...
Coding example for the question Not able to run Cosmos DB Change Feed Trigger Azure Function locally.
Read more >
How to trigger an Azure Function from Azure Cosmos DB
Your browser can't play this video. Learn more. Heightened ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found