Internal server error: 96a6c05bd59a

I have just received the below error:

anvil.server.InternalError: Internal server error: 96a6c05bd59a
at /downlink/anvil/_threaded_server.py, line 404
called from /downlink/anvil/server.py, line 40
called from /downlink/anvil/users/__init__.py, line 45
called from ContractsModule, line 61

line 61 is creating a dict entry 'modified_by' : anvil.users.get_user(),

Any ideas would be appreciated :slight_smile:

Just received the following error on the same get user code.

InternalError: Internal server error: e4b331992dcd
at /downlink/anvil/_threaded_server.py, line 404
called from /downlink/anvil/server.py, line 40
called from /downlink/anvil/users/__init__.py, line 45
called from ContractsModule, line 119
called from /downlink/anvil/tables/__init__.py, line 75
called from Supplier.SupplierMain.Contracts.RowTemplate1, line 73

Hi Rick,

Sorry for the unhelpful error message. That’s showing up as a transaction conflict in our internal logs - are you able to share more context of what you’re trying to do?

Thanks @brooke. That makes some sense. The server function is accessing a number of tables but the error keeps occuring on the get_user() line.

It is my first attempt at applying the @anvil.tables.in_transaction so I my be applying this incorrectly. I have followed this section of the docs.

Can you please provide best practice for applying the decorator to a server function that relies on other callable server functions also accessing the tables and how to call them (anvil.server.call('foo.bar') or from .foo import bar). At this stage I have only applied the decorator to this function.

You can’t nest transactions inside each other, but if you are only using @anvil.tables.in_transaction once, then that’s probably not the problem.

Are you able to provide a minimal clone link that demonstrates the error? Are you always getting this error or only when there are multiple concurrent sessions?

You can use anvil.server.call(ā€˜foo.bar’) or from .foo import bar, they both should work fine, but the latter option will have less performance overhead.

Thanks @brooke. Unfortunately I found a work around and would have to roll some code back to get it. I will keep an eye out to see if it repeats but nothing so far.

If foo.bar() is also wrapped in the @anvil.server.callable and @anvil.tables.in_transaction decorators and is called from within another function with the same decorators, does this create a conflict error?

I’m glad you haven’t seen the error again! But do let us know if it returns.

Nested transactions aren’t supported, so it’s best to make function calls to undecorated functions from within an @anvil.tables.in_transaction decorated server function.

1 Like

A post was merged into an existing topic: Error - can’t download folder

I’m getting the error ā€œInternal server error: fbf05bba3cccā€ while trying to do a stripe checkout. Can you please help?

from ._anvil_designer import Form1Template
from anvil import *
import anvil.server
import stripe.checkout

class Form1(Form1Template):

def init(self, **properties):
# Set Form properties and Data Bindings.
try:
c = stripe.checkout.charge(currency=ā€œINRā€, amount=100)
print(c)
except Exception as e:
alert(str(e))
return

Please create a new question.

No one will come and pay attention to this question. This has already been answered and has nothing to do with Stripe.