what does Starknet ErrorCode "ENTRY_POINT_NOT_FOUND_IN_CONTRACT" mean? - smartcontracts

I am new to Cairo and StarkNet. I am running a simple contract given in the following link of Cairo docs. I am following all the steps. After compilation when I am trying to declare the contract it is giving the following error.
Error
Got BadRequest while trying to access https://alpha4.starknet.io/feeder_gateway/simulate_transaction?blockNumber=pending. Status code: 500; text: {"code": "StarknetErrorCode.ENTRY_POINT_NOT_FOUND_IN_CONTRACT", "message": "Entry point 0x289da278a8dc833409cabfdad1581e8e7d40e42dcaed693fa4008dcdb4963b3 not found in contract with class hash 0x6a2c4510a0eb1bbcb75b66b23b9f3897c43644b1c86c2547cbe708f97c8f18b."}.
Traceback (most recent call last):
File "/home/chainz/.local/lib/python3.10/site-packages/services/external_api/client.py", line 117, in _send_request
raise BadRequest(status_code=response.status, text=text)
services.external_api.client.BadRequest: HTTP error ocurred. Status: 500. Text: {"code": "StarknetErrorCode.ENTRY_POINT_NOT_FOUND_IN_CONTRACT", "message": "Entry point 0x289da278a8dc833409cabfdad1581e8e7d40e42dcaed693fa4008dcdb4963b3 not found in contract with class hash 0x6a2c4510a0eb1bbcb75b66b23b9f3897c43644b1c86c2547cbe708f97c8f18b."}
Error: BadRequest: HTTP error ocurred. Status: 500. Text: {"code": "StarknetErrorCode.ENTRY_POINT_NOT_FOUND_IN_CONTRACT", "message": "Entry point 0x289da278a8dc833409cabfdad1581e8e7d40e42dcaed693fa4008dcdb4963b3 not found in contract with class hash 0x6a2c4510a0eb1bbcb75b66b23b9f3897c43644b1c86c2547cbe708f97c8f18b."}
The link of cairo docs
https://www.cairo-lang.org/docs/hello_starknet/intro.html#your-first-contract
Your help is appreciated. Thanks.

create a named account starknet deploy_account --account=blabla
and use this named account starknet declare --account blabla --contract contract_compiled.json
Hope this helps

You will need to specify the account using --account=YOUR_DEPLOYED_ACCOUNT with the transaction.

Entrypoint not found means it couldn't find the specified function selector. You probably tried to call the wrong contract. You can compute fonction selector using starknet.py from starkware.starknet.compiler.compile import get_selector_from_name

Related

Mediation of Class Mediator not happening

I am hitting my api from another service with help of endpoint in Wso2. However, I am getting the error below:
"errorCode": "0",
"errorMessage": "Error occured in the mediation of the class mediator"
Note: The error comes only for one endpoint rest all is working absolutely fine for the same service. Unable to figure out the problem.
for further detail of error I am attaching it below:
"errorDetail": "org.apache.synapse.SynapseException: Error occured in the mediation of the class mediator\n\tat
org.apache.synapse.mediators.ext.ClassMediator.mediate(ClassMediator.java:102)\n\tat
org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:109)\n\tat
org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:71)\n\tat
org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:158)\n\tat
org.apache.synapse.api.Resource.process(Resource.java:342)\n\tat
org.apache.synapse.api.API.process(API.java:463)\n\tat
org.apache.synapse.api.AbstractApiHandler.apiProcess(AbstractApiHandler.java:93)\n\tat
org.apache.synapse.api.AbstractApiHandler.dispatchToAPI(AbstractApiHandler.java:71)\n\tat
org.apache.synapse.api.rest.RestRequestHandler.dispatchToAPI(RestRequestHandler.java:84)\n\tat
org.apache.synapse.api.rest.RestRequestHandler.process(RestRequestHandler.java:70)\n\tat
org.apache.synapse.rest.RESTRequestHandler.process(RESTRequestHandler.java:54)\n\tat
org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:344)\n\tat
org.apache.synapse.core.axis2.SynapseMessageReceiver.receive(SynapseMessageReceiver.java:101)\n\tat
org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)\n\tat
org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEnclosingRESTHandler(ServerWorker.java:375)\n\tat
org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:434)\n\tat
org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:182)\n\tat
org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)\n\tat
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)\n\tat
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)\n\tat
java.base/java.lang.Thread.run(Thread.java:834)\nCaused by: org.apache.synapse.SynapseException:
org.json.simple.parser.ParseException\n\tat
org.apache.synapse.mediators.AbstractMediator.handleException(AbstractMediator.java:376)\n\tat
com.safaricom.mediator.RESTInteractRequestMediator.mediate(RESTInteractRequestMediator.java:139)\n\tat
org.apache.synapse.mediators.ext.ClassMediator.updateInstancePropertiesAndMediate(ClassMediator.java:178)\n\tat
org.apache.synapse.mediators.ext.ClassMediator.mediate(ClassMediator.java:97)\n\t... 20
more\nCaused by: Unexpected character (<) at position 0.\n\tat
org.json.simple.parser.Yylex.yylex(Yylex.java:610)\n\tat
org.json.simple.parser.JSONParser.nextToken(JSONParser.java:269)\n\tat
org.json.simple.parser.JSONParser.parse(JSONParser.java:118)\n\tat
org.json.simple.parser.JSONParser.parse(JSONParser.java:81)\n\tat
org.json.simple.parser.JSONParser.parse(JSONParser.java:75)\n\tat
com.safaricom.mediator.RESTInteractRequestMediator.mediate(RESTInteractRequestMediator.java:44)\n\
t... 22 more\n"
It seems your client is sending an XML request body to an API that expects a JSON message, or sending the wrong Content-Type header.

WSO2 API Manager returning RunTime Error

I have an API in WSO2. When I try to test it in the store with valid parameters via GET, it returns the following error message:
<am:fault xmlns:am="http://wso2.org/apimanager">
<am:code>101504</am:code>
<am:type>Status report</am:type>
<am:message>Runtime Error</am:message>
<am:description>Send timeout</am:description>
</am:fault>
I have already searched and tried a lot, but with no success, always returning the same error. Don't know if helps, but the api that I try to access is a PHP file.
Any ideas?
EDIT:
I have identical apis to this one, changing only the response, that are working properly. Even if I erase the php file that the API is pointing, the error keep coming.
EDIT:
I changed the code in Management Console, in Metadata>List>APIs:
{"production_endpoints":
{"url":"http://site/myapi.php","config":
{"format":"leave-as-is","optimize":"leave-as-
is","actionSelect":"fault","actionDuration":30000}},
"sandbox_endpoints":
{"url":"http://site/myapi.php","config":
{"format":"leave-as-is","optimize":"leave-as-
is","actionSelect":"fault","actionDuration":30000}},
"implementation_status":"managed","endpoint_type":"http"}
to this:
{"production_endpoints":
{"url":"http://10.20.40.189/ConsultaAutorizacaoCadPos.php","config":null},
"sandbox_endpoints":{"url":"http://10.20.40.189/ConsultaAutorizacaoCadPos.php","config":null},
"implementation_status":"managed","endpoint_type":"http"}
And this error message vanishes. But this new one appears:
<am:fault xmlns:am="http://wso2.org/apimanager">
<am:code>303001</am:code>
<am:type>Status report</am:type>
<am:message>Runtime Error</am:message>
<am:description>Currently , Address endpoint : [ Name : admin--myapi_APIproductionEndpoint_0 ] [ State : SUSPENDED ]</am:description>
EDIT: this error message is appearing just sometimes. Most of the time the request takes long time to run and then returns nothing( no content )
Any ideas how to solve it?

BigQuery Load Job [invalid] Too many errors encountered

I'm trying to insert data into BigQuery using the BigQuery Api C# Sdk.
I created a new Job with Json Newline Delimited data.
When I use :
100 lines for inputs : OK
250 lines for inputs : OK
500 lines for inputs : KO
2500 lines : KO
The error encountered is :
"status": {
"state": "DONE",
"errorResult": {
"reason": "invalid",
"message": "Too many errors encountered. Limit is: 0."
},
"errors": [
{
"reason": "internalError",
"location": "File: 0",
"message": "Unexpected. Please try again."
},
{
"reason": "invalid",
"message": "Too many errors encountered. Limit is: 0."
}
]
}
The file works well when I use the Bq Tools with command :
bq load --source_format=NEWLINE_DELIMITED_JSON dataset.datatable pathToJsonFile
Something seems to be wrong on server side or maybe when I transmit the file but we cannot get more log than "internal server error"
Does anyone have more informations on this ?
Thanks you
"Unexpected. Please try again." could either indicate that the contents of the files you provided had unexpected characters, or it could mean that an unexpected internal server condition occurred. There are several questions which might help shed some light on this:
does this consistently happen no matter how many times you retry?
does this directly depend on the lines in the file, or can you construct a simple upload file which doesn't trigger the error condition?
One option to potentially avoid these problems is to send the load job request with configuration.load.maxBadRecords higher than zero.
Feel free to comment with more info and I can maybe update this answer.

Yodlee executeUserSearchRequest error

I try to get information from Yodlee API.
I have a test user where I've implemented adding an account and I got refresh OK from the site:
{ siteRefreshStatus: {
siteRefreshStatusId: 8
siteRefreshStatus: "REFRESH_COMPLETED_WITH_UNCERTAIN_ACCOUNT"
}
- siteRefreshMode: {
refreshModeId: 2
refreshMode: "NORMAL"
}
- updateInitTime: 0
nextUpdate: 1391603301
code: 403
noOfRetry: 0
}
}
Now when I try to perform search and get the actual transactions I get this error:
{
errorOccured: "true"
exceptionType: "com.yodlee.core.IllegalArgumentValueException"
refrenceCode: "_57c250a9-71e8-4d4b-830d-0f51a4811516"
message: "Invalid argument value: Container type cannot be null"
}
The problem is that I have container type!
Check out the parameters I send:
cobSessionToken=08062013_2%3Ad02590d4474591e507129bf6baaa58e81cd9eaacb5753e9441cd0b1ca3b8bd00a3e6b6a943956e947458307c1bb94b505e2eb4398f890040a3db8c98606c0392&userSessionToken=08062013_0%3A8e8ef9dd4f294e0f16dedf98c1794b96bf33f2e1f2686eda2f35dfe4901dd3a871eed6d08ce52c99a74deb004c025ebf4bf94c7b17baf8ba18aacb331588f5f5&transactionSearchRequest.containerType=bank&transactionSearchRequest.higherFetchLimit=1000&transactionSearchRequest.lowerFetchLimit=1&transactionSearchRequest.resultRange.endNumber=500&transactionSearchRequest.resultRange.startNumber=1&transactionSearchRequest.searchClients.clientId=1&transactionSearchRequest.searchClients.clientName=DataSearchService&transactionSearchRequest.ignoreUserInput=true&transactionSearchRequest.searchFilter.currencyCode=USD&transactionSearchRequest.searchFilter.postDateRange.fromDate=01-01-2014&transactionSearchRequest.searchFilter.postDateRange.toDate=01-31-2014&transactionSearchRequest.searchFilter+.transactionSplitType=ALL_TRANSACTION&transactionSearchRequest.searchFilter.itemAccountId+.identifier=10008425&transactionSearchRequest.searchClients=DEFAULT_SERVICE_CLIENT
There is an error occurred while adding the account, which can be interpreted by this parameter code: 403 and hence you will not be seeing that account when you call the getItemSummary API. An account is successfully linked if the code has zero as value. E.g.code:0 . 403 is an error which is show if Yodlee's data agent has encountered an unhandled use case. Hence for any such error you should file a service request using Yodlee customer care tool.
To know more about error codes please visit -
https://developer.yodlee.com/FAQs/Error_Codes
The status is show as completedsiteRefreshStatus: "REFRESH_COMPLETED_WITH_UNCERTAIN_ACCOUNT"because addition of any account is followed by a refresh in which Yodlee's data agent logs into the websites of FIs and try scraping data. Hence completion of this activity is denoted as REFRESH_COMPLETED even when there is an error occurred.
TranasctionSearch issue -
I can see two of the parameters with a "+" sign. Since transactionSlipttype and containerType are dependent on each other the error is thrown.
&transactionSearchRequest.searchFilter+.transactionSplitType=ALL_TRANSACTION
&transactionSearchRequest.searchFilter.itemAccountId+.identifier=10008425
The right parameters are -
&transactionSearchRequest.searchFilter.transactionSplitType=ALL_TRANSACTION
&transactionSearchRequest.searchFilter.itemAccountId.identifier=10008425

Camel setHeader newbie error

I would just know where I'm wrong with this route.
I'm trying to return a messsage via a web socket route, but I'm unable to set camel connection key:
from("jms:queue:subscriptionValidationError").log("Receiving error message: ${body} ${in.headers.websocket.connectionKey}")
.setHeader(WebsocketConstants.CONNECTION_KEY, simple("${in.headers.websocket.connectionKey}"))
.log("Sending error message: ${body} ${out.headers.websocket.connectionKey}")
.to("websocket://0.0.0.0:9292/subscribeErrors?staticResources=classpath:webapp");
This gives me a log without the connection key on the second log operation:
Receiving error message: doit suivre "[-a-zA-Z0-9]+\#[-a-zA-Z0-9]+\.[a-zA-Z]+" 60f7cc44-9d9b-4bde-905a-d7d51be7661a
Sending error message: doit suivre "[-a-zA-Z0-9]+\#[-a-zA-Z0-9]+\.[a-zA-Z]+"
Can you please tell me where I'm wrong?
Thanks in advance
your log() references the out.header...but setHeader() is setting the in.header
see http://camel.apache.org/using-getin-or-getout-methods-on-exchange.html