-
Notifications
You must be signed in to change notification settings - Fork 107
Timer trigger function results in output TypeError #1479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@gijs-romme Can you try removing the return None or return just any string for your second function? |
I'm facing a similar issue in the last couple days, code did not change but the same error started to appear on eventgrid functions |
Hello, { Thank you for your help |
Same here on very different trigger types. |
We experience the same issue without any change in the code |
To give a bit more details: We are running around 20-30 functionapps which are python based. Some of them are written in v2 style some of them in v1 style.
Please take that issue serious! |
I encountered a similar problem with an SQL trigger after deployment yesterday with an unrelated update. It appears that returning an empty string provides a workaround. |
Same problem with Timer triggers. Started to happen when redeploying the function app (v1) without any code changes |
The 'return None' originally wasn't there, so that doesn't help. Just returning any string does fix the issue however! Thank you so much! If it still helps: I'm not sure where to get the invocation ID, but I would expect it's the ID that's visible in this line in the 'Monitor' tab? |
Hi, in the meantime i removed all the added return "" statements and fixed the host version to an old version that was used a couple of days ago and this is working as well: In Powershell: The issue sounds very related to |
Apologies for this error. We have fixed this issue and are in process of releasing a new runtime version. The fix will be in runtime version 4.33.2 |
@gavin-aguiar Thank you for fixing this. I am also facing this issue in my time trigger based azure function(without any code change). I am trying to understand if this fix( |
@abdulniyaspm You would just need to restart your functionapp to pick up the latest runtime version. |
@gavin-aguiar Thank you for your answer but despite restarting my functionapp I still have the old version of runtime 4.33.1.1 |
@benyahiaabdelmonem we have finished deploying this fix for dedicated function apps yesterday. Consumption apps are in progress. So if you have a non-consumption function app, you should be able to get the latest runtime version by restarting. |
Is your question related to a specific version? If so, please specify:
Version 2
What binding does your question apply to, if any? (e.g. Blob Trigger, Event Hub Binding, etc)
My function has a timer input trigger and a sendgrid output trigger.
Question
Yesterday I added a new function to my Azure function app. Since adding it, an already existing function (with the bindings described above) that I didn't change anything about doesn't run correctly anymore because it gives the following error:
Result: Failure Exception: TypeError: unable to encode outgoing TypedData: unsupported type "<class 'azure_functions_worker.bindings.generic.GenericBinding'>" for Python type "NoneType"
I see online that this error occurs when your function has an HTTP output binding and you don't return any HTTPResponse. However, mine doesn't have any HTTP binding. It's not supposed to return anything as you create the output by calling the 'set' method on the 'sendGridMessage' input argument.
I already restore the function app back the its previous state by deleting the function that I added yesterday, but the error keeps on happening. Could anyone help me fix this issue please? It might also just be a bug...
Here's the function.json file content:
{ "scriptFile": "__init__.py", "bindings": [ { "name": "mytimer", "type": "timerTrigger", "direction": "in", "schedule": "0 0 * * * *" }, { "type": "sendGrid", "name": "sendGridMessage", "direction": "out", "apiKey": "SendGridAPIKey", "from": "..." } ], "retry": { "strategy": "exponentialBackoff", "maxRetryCount": 5, "minimumInterval": "00:00:10", "maximumInterval": "00:15:00" } }
And the relevant parts of my init.py file:
def main(mytimer: func.TimerRequest, sendGridMessage: func.Out[str]) -> None: # noqa: F841 message = ... sendGridMessage.set(json.dumps(message)) logging.info('Function ran successfully.')
The text was updated successfully, but these errors were encountered: