Neo4j fails to start up due to trigger execution failure - neo4j

I have a triggered called create-owner-notification. It worked like a charm after creating it, but after a restart of Neo4j it blocks a successful start up of the database. The error found in debug.log is:
[a.t.Trigger] Error executing trigger create-owner-notification in phase before Unknown function 'apoc.create.uuid' (line 5, column 83 (offset: 193))
"MERGE (o)<-[:RELATES_TO]-(n:Notification:OwnerNotification{date_created: dt, uid: apoc.create.uuid()})<-[:HAS_NOTIFICATION{read: false, date_received: dt}]-(u)"
at org.neo4j.kernel.impl.query.QueryExecutionKernelException.asUserException(QueryExecutionKernelException.java:35)
[..]
As can be seen it doesn't recognise the function apoc.create.uuid.
My first idea was to simply remove the apoc.create.uuid dependency and instead call the native randomUUID() function instead. However, there is no way I can modify or remove the current trigger, for the database cannot start. If I set the config value apoc_trigger_enabled to false the database does start successfully but I cannot interact with the trigger in order to remove it.
If need be I can share further logging or config files.
How can I get the database to startup and successfully get the trigger to work again?

Related

How to expend tAssertCatcher to catch more errors than its default in talend?

I have a job which when I run it- I get this:
[ERROR] 11:47:54 org.talend.components.snowflake.runtime.SnowflakeRowStandalone- Query execution has
failed. Please validate your query.
net.snowflake.client.jdbc.SnowflakeSQLException: Execution error in store procedure
SP_GENERAL:
Numeric value '' is not recognized
but when I'm trying to catch this error- I cant.
I tried tAssertCatcher, tLogCatcher, tStatCatcher- and nothing has worked.
could anybody help please?
ok, finally I got a solution.
tAssertCatcher does not catch errors from stored procedures, so I created a joblet which contain the tAssertCatcher AND in addition, added in there:
input with schema almost identical to tAssertCatcher's schema:
moment, pid, project, job, language, origin, status, substatus, errorCode, errorMessage.
now- I connected between the tDBrow component which I want to catch error from this process- with Reject row to the joblet, and pass errorCode and errorMessage- this will be the exception and description.
in the schema I used tMap to add variables values to almost all the columns:
pid, status, jobName, projectName and the rest I passed hardcoded.
finally I got a solution... every time I'll have error in stored procedure- I'll get 2 detailed records: one that I created manually, and the another one is UNEXPECTED-EXCEPTION.
the additional part in the joblet

Spring Cloud Dataflow Task Execution Fails on subsequent runs

Name: spring-cloud-dataflow-server
Version: 2.5.0.BUILD-SNAPSHOT
I have a very simple task created. First run it always COMPLETES fine with NO ISSUES. If task is run again it FAILS with following error.
Subsequent Launch of same task fails with below exception and it's a fresh run after the previous execution completed fully. If a task is run one time can't it be run again?
(log from Task Execution Details - Execution ID: 246)
Caused by: org.springframework.batch.core.repository.JobInstanceAlreadyCompleteException: A job instance already exists and is complete for parameters={-spring.cloud.data.flow.taskappname=composed-task-runner, -spring.cloud.task.executionid=246, -graph=threetasks-t1 && threetasks-t2 && threetasks-t3, -spring.datasource.username=root, -spring.cloud.data.flow.platformname=default, -dataflow-server-uri=http://10.104.227.49:9393, -management.metrics.export.prometheus.enabled=true, -management.metrics.export.prometheus.rsocket.host=prometheus-proxy, -spring.datasource.url=jdbc:mysql://10.110.89.91:3306/mysql, -spring.datasource.driverClassName=org.mariadb.jdbc.Driver, -spring.datasource.password=manager, -management.metrics.export.prometheus.rsocket.port=7001, -management.metrics.export.prometheus.rsocket.enabled=true, -spring.cloud.task.name=threetasks}. If you want to run this job again, change the parameters.
A Job instance in a Spring Batch application requires a unique Job Parameter and this is by design.
In this case, since you are using the Composed Task, you can use the property --increment-instance-enabled=true as part of the composed task definition to handle it. This property will make sure to have the Job Instance get the unique Job parameters.
You can check the list of properties supported for Composed Task Runner here

Errors Thrown When Inserting Data After Tag or Edge is Created

I'm using nebula docker but it throws me an error when I connected first. Then I retried everything is ok. Why is that? Must I retry every time?
This is likely caused by setting the heartbeat_interval_secs value to fetch data from the meta server. Conduct the following steps to resolve:
If meta has registered, check heartbeat_interval_secs value in console with the following command.
nebula> GET CONFIGS storage:heartbeat_interval_secs
nebula> GET CONFIGS graph:heartbeat_interval_secs
If the value is large, change it to 1s with the following command.
nebula> UPDATE CONFIGS storage:heartbeat_interval_secs=1
nebula> UPDATE CONFIGS graph:heartbeat_interval_secs=1
Note the changes take effect in the next period.

Why CreateProcessAsUser fails with "Access denied" when called from service child process

I am trying to run process as other user from my service using CreateProcessAsUser function. The example of code was found here CreateProcessAsUser from c++ service creates process but no console.
OS - Windows 10
My code is working fine, when i run it in main service process. But I need run same code from child service process. And in this case CreateProcessAsUser returns 0 and GetLastError = 5 (Access Dennied).
Child service process is created by next call
CreateProcess(NULL, "d:\\child.exe", NULL, NULL, FALSE, 0u, NULL, NULL, &si.StartupInfo, &pi)
My code is working inside "child.exe" binary and should just create one more process, that starts "d:\test.exe" binary in this way
CreateProcessAsUser(hUserTokenDup,
NULL,
"d:\\test.exe",
NULL,
NULL,
FALSE,
CREATE_NEW_CONSOLE | /*CREATE_BREAKAWAY_FROM_JOB |*/ NORMAL_PRIORITY_CLASS,
NULL,
NULL,
&si,
&pi);
For test I moved code to start "test.exe" to same place where "child.exe" is starting (to service main process) and "test.exe" starts fine. For test I replaced CreateProcessAsUser on CreateProcess with same parameters (except user token) and test.exe also starts fine.
But I need start "test.exe" from service child process (from "child.exe") and start it by CreateProcessAsUser. I tryed a lot of solutions from internet (add CREATE_BREAKAWAY_FROM_JOB, use DuplicateTokenEx, use linkedToken, enable all possible privilegies and so on) but no solution helped. I do not expected any difference between service process and child process. But looks like something different and I cannot find what it is.
Can anybody advice, what is a difference between main server process and its child process?
My colleagues found the solution.
I publish it here:
Service child process could start sub-process after flags JOB_OBJECT_LIMIT_BREAKAWAY_OK|JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK has been passed to SetInformationJobObject function in server process before creating service child process. After that calls
WTSGetActiveConsoleSessionId(..
WTSQueryUserToken(...
CreateProcessAsUser(...CREATE_BREAKAWAY_FROM_JOB
work fine event without creating duplicate handle

Unable to cancel a query in DB2

I have the following stored procedure in DB2:
CREATE OR REPLACE PROCEDURE CANCEL_ACTIVITY (IN application_handle INTEGER)
LANGUAGE SQL
BEGIN
DECLARE UOW_ID INTEGER;
DECLARE ACTIVITY_ID INTEGER;
FOR v AS cur1 CURSOR FOR
SELECT UOW_ID, ACTIVITY_ID FROM TABLE(SYSPROC.MON_GET_ACTIVITY(application_handle, -1))
DO
CALL WLM_CANCEL_ACTIVITY(application_handle, v.uow_id, v.activity_id);
END FOR ;
END
Using the following query, I am able to find my connection ID:
SELECT MON_GET_APPLICATION_HANDLE() from SYSIBM.SYSDUMMY1
Which would return a value like 36547. So I call the procedure I just created like so:
CALL CANCEL_ACTIVITY(36547);
As a result, I get the following:
However, if I execute the query that gets connection IDs again, it doesn't seem like that connection ID is gone. I still get the 36547 value returned.
I am quite confused whether this query canceling is working at all. I am getting a range of different type of errors in different environments I am executing the code at.
When I am running it as a SQL query, I get the above error code / response. When my code is being executed in my webpage, I get the following error:
Cannot cancel queries: Java::ComIbmDb2JccAm::SqlDataException: DB2 SQL Error: SQLCODE=-802, SQLSTATE=22003, SQLERRMC=null, DRIVER=4.16.53
I am curious what I am doing wrong?
I would recommend to read Canceling Activies in the DB2 documentation. Canceling an activity is not closing a connection, but selectively aborting a query or other running tasks:
If an activity is consuming too many resources, or is running too
long, you can cancel it. Canceling an activity is gentler than forcing
the application that submitted the activity. A canceled activity
returns SQL4725N to the user, but does not end the connection or
affect any other user activity. Forcing the application ends both the
connection and user activities.
In your procedure you are looking for the app handle, uow and a specific activity ID. Have you looked what the activity you are going to cancel is/was doing? You could use WLM_CAPTURE_ACTIVITY_IN_PROGRESS to first dump information about that activity, so that you can debug your scenario.

Resources