status
stringclasses
1 value
repo_name
stringclasses
31 values
repo_url
stringclasses
31 values
issue_id
int64
1
104k
title
stringlengths
4
233
body
stringlengths
0
186k
issue_url
stringlengths
38
56
pull_url
stringlengths
37
54
before_fix_sha
stringlengths
40
40
after_fix_sha
stringlengths
40
40
report_datetime
timestamp[us, tz=UTC]
language
stringclasses
5 values
commit_datetime
timestamp[us, tz=UTC]
updated_file
stringlengths
7
188
chunk_content
stringlengths
1
1.03M
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
2,574
[Feature]Configurable registration ipaddress
**Is your feature request related to a problem? Please describe.** on macos,OSUtils.getHost() returns diffrent ip in running time. Also,the method OSUtils.getHost() didn't perform well in container situation like docker ,some error may happen **Describe the solution you'd like** provide a param like register-ip to specific the ip which will be registried on zk **Describe alternatives you've considered** provide a param like networkinterface to specific the networkinterface which will be registried on zk **Additional context** <img width="1467" alt="8C1E5A5B-CC64-40FE-9049-5FC6154E72FE" src="https://user-images.githubusercontent.com/42403258/80572245-80ab6180-8a30-11ea-9525-73b33f1bf49e.png"> <img width="1481" alt="25DECE0A-2A92-479F-A76F-7DAEB8F691FF" src="https://user-images.githubusercontent.com/42403258/80572256-8608ac00-8a30-11ea-8784-eeb88c0fb7ea.png"> 英文不好,简单的说就是可以指定注册到zk上的ip或可选的网卡配置
https://github.com/apache/dolphinscheduler/issues/2574
https://github.com/apache/dolphinscheduler/pull/3186
6c9ac84f73a20717ab1014fe8c09e98668262baa
6f9970b189d71d043e79200a70a95f2f33ad10f4
2020-04-29T07:48:39Z
java
2020-07-13T10:51:38Z
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
* */ public static final String DATA_LIST = "data"; public static final String TOTAL_LIST = "totalList"; public static final String CURRENT_PAGE = "currentPage"; public static final String TOTAL_PAGE = "totalPage"; public static final String TOTAL = "total"; /** * session user */ public static final String SESSION_USER = "session.user"; public static final String SESSION_ID = "sessionId"; public static final String PASSWORD_DEFAULT = "******"; /** * driver */ public static final String ORG_POSTGRESQL_DRIVER = "org.postgresql.Driver"; public static final String COM_MYSQL_JDBC_DRIVER = "com.mysql.jdbc.Driver"; public static final String ORG_APACHE_HIVE_JDBC_HIVE_DRIVER = "org.apache.hive.jdbc.HiveDriver"; public static final String COM_CLICKHOUSE_JDBC_DRIVER = "ru.yandex.clickhouse.ClickHouseDriver"; public static final String COM_ORACLE_JDBC_DRIVER = "oracle.jdbc.driver.OracleDriver"; public static final String COM_SQLSERVER_JDBC_DRIVER = "com.microsoft.sqlserver.jdbc.SQLServerDriver"; public static final String COM_DB2_JDBC_DRIVER = "com.ibm.db2.jcc.DB2Driver"; /** * database type */ public static final String MYSQL = "MYSQL"; public static final String POSTGRESQL = "POSTGRESQL"; public static final String HIVE = "HIVE"; public static final String SPARK = "SPARK";
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
2,574
[Feature]Configurable registration ipaddress
**Is your feature request related to a problem? Please describe.** on macos,OSUtils.getHost() returns diffrent ip in running time. Also,the method OSUtils.getHost() didn't perform well in container situation like docker ,some error may happen **Describe the solution you'd like** provide a param like register-ip to specific the ip which will be registried on zk **Describe alternatives you've considered** provide a param like networkinterface to specific the networkinterface which will be registried on zk **Additional context** <img width="1467" alt="8C1E5A5B-CC64-40FE-9049-5FC6154E72FE" src="https://user-images.githubusercontent.com/42403258/80572245-80ab6180-8a30-11ea-9525-73b33f1bf49e.png"> <img width="1481" alt="25DECE0A-2A92-479F-A76F-7DAEB8F691FF" src="https://user-images.githubusercontent.com/42403258/80572256-8608ac00-8a30-11ea-8784-eeb88c0fb7ea.png"> 英文不好,简单的说就是可以指定注册到zk上的ip或可选的网卡配置
https://github.com/apache/dolphinscheduler/issues/2574
https://github.com/apache/dolphinscheduler/pull/3186
6c9ac84f73a20717ab1014fe8c09e98668262baa
6f9970b189d71d043e79200a70a95f2f33ad10f4
2020-04-29T07:48:39Z
java
2020-07-13T10:51:38Z
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final String CLICKHOUSE = "CLICKHOUSE"; public static final String ORACLE = "ORACLE"; public static final String SQLSERVER = "SQLSERVER"; public static final String DB2 = "DB2"; /** * jdbc url */ public static final String JDBC_MYSQL = "jdbc:mysql://"; public static final String JDBC_POSTGRESQL = "jdbc:postgresql://"; public static final String JDBC_HIVE_2 = "jdbc:hive2://"; public static final String JDBC_CLICKHOUSE = "jdbc:clickhouse://"; public static final String JDBC_ORACLE_SID = "jdbc:oracle:thin:@"; public static final String JDBC_ORACLE_SERVICE_NAME = "jdbc:oracle:thin:@//"; public static final String JDBC_SQLSERVER = "jdbc:sqlserver://"; public static final String JDBC_DB2 = "jdbc:db2://"; public static final String ADDRESS = "address"; public static final String DATABASE = "database"; public static final String JDBC_URL = "jdbcUrl"; public static final String PRINCIPAL = "principal"; public static final String OTHER = "other"; public static final String ORACLE_DB_CONNECT_TYPE = "connectType"; /** * session timeout */ public static final int SESSION_TIME_OUT = 7200; public static final int MAX_FILE_SIZE = 1024 * 1024 * 1024; public static final String UDF = "UDF"; public static final String CLASS = "class"; public static final String RECEIVERS = "receivers"; public static final String RECEIVERS_CC = "receiversCc";
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
2,574
[Feature]Configurable registration ipaddress
**Is your feature request related to a problem? Please describe.** on macos,OSUtils.getHost() returns diffrent ip in running time. Also,the method OSUtils.getHost() didn't perform well in container situation like docker ,some error may happen **Describe the solution you'd like** provide a param like register-ip to specific the ip which will be registried on zk **Describe alternatives you've considered** provide a param like networkinterface to specific the networkinterface which will be registried on zk **Additional context** <img width="1467" alt="8C1E5A5B-CC64-40FE-9049-5FC6154E72FE" src="https://user-images.githubusercontent.com/42403258/80572245-80ab6180-8a30-11ea-9525-73b33f1bf49e.png"> <img width="1481" alt="25DECE0A-2A92-479F-A76F-7DAEB8F691FF" src="https://user-images.githubusercontent.com/42403258/80572256-8608ac00-8a30-11ea-8784-eeb88c0fb7ea.png"> 英文不好,简单的说就是可以指定注册到zk上的ip或可选的网卡配置
https://github.com/apache/dolphinscheduler/issues/2574
https://github.com/apache/dolphinscheduler/pull/3186
6c9ac84f73a20717ab1014fe8c09e98668262baa
6f9970b189d71d043e79200a70a95f2f33ad10f4
2020-04-29T07:48:39Z
java
2020-07-13T10:51:38Z
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
/** * dataSource sensitive param */ public static final String DATASOURCE_PASSWORD_REGEX = "(?<=(\"password\":\")).*?(?=(\"))"; /** * default worker group */ public static final String DEFAULT_WORKER_GROUP = "default"; public static final Integer TASK_INFO_LENGTH = 5; /** * new * schedule time */ public static final String PARAMETER_SHECDULE_TIME = "schedule.time"; /** * authorize writable perm */ public static final int AUTHORIZE_WRITABLE_PERM=7; /** * authorize readable perm */ public static final int AUTHORIZE_READABLE_PERM=4; /** * plugin configurations */ public static final String PLUGIN_JAR_SUFFIX = ".jar"; public static final int NORAML_NODE_STATUS = 0; public static final int ABNORMAL_NODE_STATUS = 1; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
2,574
[Feature]Configurable registration ipaddress
**Is your feature request related to a problem? Please describe.** on macos,OSUtils.getHost() returns diffrent ip in running time. Also,the method OSUtils.getHost() didn't perform well in container situation like docker ,some error may happen **Describe the solution you'd like** provide a param like register-ip to specific the ip which will be registried on zk **Describe alternatives you've considered** provide a param like networkinterface to specific the networkinterface which will be registried on zk **Additional context** <img width="1467" alt="8C1E5A5B-CC64-40FE-9049-5FC6154E72FE" src="https://user-images.githubusercontent.com/42403258/80572245-80ab6180-8a30-11ea-9525-73b33f1bf49e.png"> <img width="1481" alt="25DECE0A-2A92-479F-A76F-7DAEB8F691FF" src="https://user-images.githubusercontent.com/42403258/80572256-8608ac00-8a30-11ea-8784-eeb88c0fb7ea.png"> 英文不好,简单的说就是可以指定注册到zk上的ip或可选的网卡配置
https://github.com/apache/dolphinscheduler/issues/2574
https://github.com/apache/dolphinscheduler/pull/3186
6c9ac84f73a20717ab1014fe8c09e98668262baa
6f9970b189d71d043e79200a70a95f2f33ad10f4
2020-04-29T07:48:39Z
java
2020-07-13T10:51:38Z
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/NetUtils.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.dolphinscheduler.common.utils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.IOException; import java.net.*; import java.util.Enumeration; import java.util.LinkedList; import java.util.List; import java.util.Optional; import java.util.regex.Pattern; import static java.util.Collections.emptyList; /** * NetUtils
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
2,574
[Feature]Configurable registration ipaddress
**Is your feature request related to a problem? Please describe.** on macos,OSUtils.getHost() returns diffrent ip in running time. Also,the method OSUtils.getHost() didn't perform well in container situation like docker ,some error may happen **Describe the solution you'd like** provide a param like register-ip to specific the ip which will be registried on zk **Describe alternatives you've considered** provide a param like networkinterface to specific the networkinterface which will be registried on zk **Additional context** <img width="1467" alt="8C1E5A5B-CC64-40FE-9049-5FC6154E72FE" src="https://user-images.githubusercontent.com/42403258/80572245-80ab6180-8a30-11ea-9525-73b33f1bf49e.png"> <img width="1481" alt="25DECE0A-2A92-479F-A76F-7DAEB8F691FF" src="https://user-images.githubusercontent.com/42403258/80572256-8608ac00-8a30-11ea-8784-eeb88c0fb7ea.png"> 英文不好,简单的说就是可以指定注册到zk上的ip或可选的网卡配置
https://github.com/apache/dolphinscheduler/issues/2574
https://github.com/apache/dolphinscheduler/pull/3186
6c9ac84f73a20717ab1014fe8c09e98668262baa
6f9970b189d71d043e79200a70a95f2f33ad10f4
2020-04-29T07:48:39Z
java
2020-07-13T10:51:38Z
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/NetUtils.java
*/ public class NetUtils { private NetUtils() { throw new IllegalStateException("Utility class"); } private static Logger logger = LoggerFactory.getLogger(NetUtils.class); private static final Pattern IP_PATTERN = Pattern.compile("\\d{1,3}(\\.\\d{1,3}){3,5}$"); private static String ANY_HOST_VALUE = "0.0.0.0"; private static String LOCAL_HOST_VALUE = "127.0.0.1"; private static InetAddress LOCAL_ADDRESS = null; private static volatile String HOST_ADDRESS; public static String getHost() { if (HOST_ADDRESS != null) { return HOST_ADDRESS; } InetAddress address = getLocalAddress(); if (address != null) { HOST_ADDRESS = address.getHostAddress(); return HOST_ADDRESS; } return LOCAL_HOST_VALUE; } private static InetAddress getLocalAddress() { if (null != LOCAL_ADDRESS) { return LOCAL_ADDRESS; } return getLocalAddress0(); } /** * Find first valid IP from local network card
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
2,574
[Feature]Configurable registration ipaddress
**Is your feature request related to a problem? Please describe.** on macos,OSUtils.getHost() returns diffrent ip in running time. Also,the method OSUtils.getHost() didn't perform well in container situation like docker ,some error may happen **Describe the solution you'd like** provide a param like register-ip to specific the ip which will be registried on zk **Describe alternatives you've considered** provide a param like networkinterface to specific the networkinterface which will be registried on zk **Additional context** <img width="1467" alt="8C1E5A5B-CC64-40FE-9049-5FC6154E72FE" src="https://user-images.githubusercontent.com/42403258/80572245-80ab6180-8a30-11ea-9525-73b33f1bf49e.png"> <img width="1481" alt="25DECE0A-2A92-479F-A76F-7DAEB8F691FF" src="https://user-images.githubusercontent.com/42403258/80572256-8608ac00-8a30-11ea-8784-eeb88c0fb7ea.png"> 英文不好,简单的说就是可以指定注册到zk上的ip或可选的网卡配置
https://github.com/apache/dolphinscheduler/issues/2574
https://github.com/apache/dolphinscheduler/pull/3186
6c9ac84f73a20717ab1014fe8c09e98668262baa
6f9970b189d71d043e79200a70a95f2f33ad10f4
2020-04-29T07:48:39Z
java
2020-07-13T10:51:38Z
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/NetUtils.java
* * @return first valid local IP */ private static synchronized InetAddress getLocalAddress0() { if (null != LOCAL_ADDRESS) { return LOCAL_ADDRESS; } InetAddress localAddress = null; NetworkInterface networkInterface = findNetworkInterface(); Enumeration<InetAddress> addresses = networkInterface.getInetAddresses(); while (addresses.hasMoreElements()) { Optional<InetAddress> addressOp = toValidAddress(addresses.nextElement()); if (addressOp.isPresent()) { try { if (addressOp.get().isReachable(100)) { LOCAL_ADDRESS = addressOp.get(); return LOCAL_ADDRESS; } } catch (IOException e) { logger.warn("test address id reachable io exception", e); } } } try { localAddress = InetAddress.getLocalHost(); } catch (UnknownHostException e) { logger.warn("InetAddress get LocalHost exception", e); } Optional<InetAddress> addressOp = toValidAddress(localAddress); if (addressOp.isPresent()) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
2,574
[Feature]Configurable registration ipaddress
**Is your feature request related to a problem? Please describe.** on macos,OSUtils.getHost() returns diffrent ip in running time. Also,the method OSUtils.getHost() didn't perform well in container situation like docker ,some error may happen **Describe the solution you'd like** provide a param like register-ip to specific the ip which will be registried on zk **Describe alternatives you've considered** provide a param like networkinterface to specific the networkinterface which will be registried on zk **Additional context** <img width="1467" alt="8C1E5A5B-CC64-40FE-9049-5FC6154E72FE" src="https://user-images.githubusercontent.com/42403258/80572245-80ab6180-8a30-11ea-9525-73b33f1bf49e.png"> <img width="1481" alt="25DECE0A-2A92-479F-A76F-7DAEB8F691FF" src="https://user-images.githubusercontent.com/42403258/80572256-8608ac00-8a30-11ea-8784-eeb88c0fb7ea.png"> 英文不好,简单的说就是可以指定注册到zk上的ip或可选的网卡配置
https://github.com/apache/dolphinscheduler/issues/2574
https://github.com/apache/dolphinscheduler/pull/3186
6c9ac84f73a20717ab1014fe8c09e98668262baa
6f9970b189d71d043e79200a70a95f2f33ad10f4
2020-04-29T07:48:39Z
java
2020-07-13T10:51:38Z
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/NetUtils.java
LOCAL_ADDRESS = addressOp.get(); } return LOCAL_ADDRESS; } private static Optional<InetAddress> toValidAddress(InetAddress address) { if (address instanceof Inet6Address) { Inet6Address v6Address = (Inet6Address) address; if (isPreferIPV6Address()) { return Optional.ofNullable(normalizeV6Address(v6Address)); } } if (isValidV4Address(address)) { return Optional.of(address); } return Optional.empty(); } private static InetAddress normalizeV6Address(Inet6Address address) { String addr = address.getHostAddress(); int i = addr.lastIndexOf('%'); if (i > 0) { try { return InetAddress.getByName(addr.substring(0, i) + '%' + address.getScopeId()); } catch (UnknownHostException e) { logger.debug("Unknown IPV6 address: ", e); } } return address; } public static boolean isValidV4Address(InetAddress address) { if (address == null || address.isLoopbackAddress()) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
2,574
[Feature]Configurable registration ipaddress
**Is your feature request related to a problem? Please describe.** on macos,OSUtils.getHost() returns diffrent ip in running time. Also,the method OSUtils.getHost() didn't perform well in container situation like docker ,some error may happen **Describe the solution you'd like** provide a param like register-ip to specific the ip which will be registried on zk **Describe alternatives you've considered** provide a param like networkinterface to specific the networkinterface which will be registried on zk **Additional context** <img width="1467" alt="8C1E5A5B-CC64-40FE-9049-5FC6154E72FE" src="https://user-images.githubusercontent.com/42403258/80572245-80ab6180-8a30-11ea-9525-73b33f1bf49e.png"> <img width="1481" alt="25DECE0A-2A92-479F-A76F-7DAEB8F691FF" src="https://user-images.githubusercontent.com/42403258/80572256-8608ac00-8a30-11ea-8784-eeb88c0fb7ea.png"> 英文不好,简单的说就是可以指定注册到zk上的ip或可选的网卡配置
https://github.com/apache/dolphinscheduler/issues/2574
https://github.com/apache/dolphinscheduler/pull/3186
6c9ac84f73a20717ab1014fe8c09e98668262baa
6f9970b189d71d043e79200a70a95f2f33ad10f4
2020-04-29T07:48:39Z
java
2020-07-13T10:51:38Z
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/NetUtils.java
return false; } String name = address.getHostAddress(); return (name != null && IP_PATTERN.matcher(name).matches() && !ANY_HOST_VALUE.equals(name) && !LOCAL_HOST_VALUE.equals(name)); } /** * Check if an ipv6 address * * @return true if it is reachable */ private static boolean isPreferIPV6Address() { return Boolean.getBoolean("java.net.preferIPv6Addresses"); } /** * Get the suitable {@link NetworkInterface} * * @return If no {@link NetworkInterface} is available , return <code>null</code> */ private static NetworkInterface findNetworkInterface() { List<NetworkInterface> validNetworkInterfaces = emptyList(); try { validNetworkInterfaces = getValidNetworkInterfaces(); } catch (SocketException e) { logger.warn("ValidNetworkInterfaces exception", e); } return validNetworkInterfaces.get(0); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
2,574
[Feature]Configurable registration ipaddress
**Is your feature request related to a problem? Please describe.** on macos,OSUtils.getHost() returns diffrent ip in running time. Also,the method OSUtils.getHost() didn't perform well in container situation like docker ,some error may happen **Describe the solution you'd like** provide a param like register-ip to specific the ip which will be registried on zk **Describe alternatives you've considered** provide a param like networkinterface to specific the networkinterface which will be registried on zk **Additional context** <img width="1467" alt="8C1E5A5B-CC64-40FE-9049-5FC6154E72FE" src="https://user-images.githubusercontent.com/42403258/80572245-80ab6180-8a30-11ea-9525-73b33f1bf49e.png"> <img width="1481" alt="25DECE0A-2A92-479F-A76F-7DAEB8F691FF" src="https://user-images.githubusercontent.com/42403258/80572256-8608ac00-8a30-11ea-8784-eeb88c0fb7ea.png"> 英文不好,简单的说就是可以指定注册到zk上的ip或可选的网卡配置
https://github.com/apache/dolphinscheduler/issues/2574
https://github.com/apache/dolphinscheduler/pull/3186
6c9ac84f73a20717ab1014fe8c09e98668262baa
6f9970b189d71d043e79200a70a95f2f33ad10f4
2020-04-29T07:48:39Z
java
2020-07-13T10:51:38Z
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/NetUtils.java
/** * Get the valid {@link NetworkInterface network interfaces} * * @throws SocketException SocketException if an I/O error occurs. */ private static List<NetworkInterface> getValidNetworkInterfaces() throws SocketException { List<NetworkInterface> validNetworkInterfaces = new LinkedList<>(); Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces(); while (interfaces.hasMoreElements()) { NetworkInterface networkInterface = interfaces.nextElement(); if (ignoreNetworkInterface(networkInterface)) { continue; } validNetworkInterfaces.add(networkInterface); } return validNetworkInterfaces; } /** * @param networkInterface {@link NetworkInterface} * @return if the specified {@link NetworkInterface} should be ignored, return <code>true</code> * @throws SocketException SocketException if an I/O error occurs. */ public static boolean ignoreNetworkInterface(NetworkInterface networkInterface) throws SocketException { return networkInterface == null || networkInterface.isLoopback() || networkInterface.isVirtual() || !networkInterface.isUp(); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,140
[BUG] Embed zookeeper server 'ZKServer' has deadlock problem
*For better global communication, please give priority to using English description, thx! * **Describe the bug** look at the code snippet ```java private static synchronized void startLocalZkServer(final int port, final String dataDirPath,final int tickTime,String maxClientCnxns) { if (zkServer != null) { throw new RuntimeException("Zookeeper server is already started!"); } zkServer = new PublicZooKeeperServerMain(); logger.info("Zookeeper data path : {} ", dataDirPath); dataDir = dataDirPath; final String[] args = new String[]{Integer.toString(port), dataDirPath, Integer.toString(tickTime), maxClientCnxns}; try { logger.info("Zookeeper server started "); isStarted.compareAndSet(false, true); zkServer.initializeAndRun(args); } catch (QuorumPeerConfig.ConfigException e) { logger.warn("Caught exception while starting ZK", e); } catch (IOException e) { logger.warn("Caught exception while starting ZK", e); } } ``` The above start method will acquire the lock of the ZKServer class. But the line "zkServer.initializeAndRun(args);" will block until the application exit. So it will never release the lock. ```java private static synchronized void stopLocalZkServer(final boolean deleteDataDir) { // 省略 } ``` The above stop method try to acquire the lock of the ZKServer class, but it will never succeed. **To Reproduce** Steps to reproduce the behavior, for example: 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' 4. See error **Expected behavior** A clear and concise description of what you expected to happen. **Screenshots** If applicable, add screenshots to help explain your problem. **Which version of Dolphin Scheduler:** -[1.1.0-preview] **Additional context** Add any other context about the problem here. **Requirement or improvement - Please describe about your requirements or improvement suggestions.
https://github.com/apache/dolphinscheduler/issues/3140
https://github.com/apache/dolphinscheduler/pull/3141
6f9970b189d71d043e79200a70a95f2f33ad10f4
753ed58fb9f15f85240918fe6457cf9015ee5101
2020-07-05T15:26:02Z
java
2020-07-13T10:52:33Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/zk/ZKServer.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.dolphinscheduler.service.zk; import org.apache.zookeeper.server.ZooKeeperServer; import org.apache.zookeeper.server.ZooKeeperServerMain; import org.apache.zookeeper.server.quorum.QuorumPeerConfig; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.File; import java.io.IOException; import java.util.concurrent.atomic.AtomicBoolean; /** * just speed experience version * embedded zookeeper service */ public class ZKServer {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,140
[BUG] Embed zookeeper server 'ZKServer' has deadlock problem
*For better global communication, please give priority to using English description, thx! * **Describe the bug** look at the code snippet ```java private static synchronized void startLocalZkServer(final int port, final String dataDirPath,final int tickTime,String maxClientCnxns) { if (zkServer != null) { throw new RuntimeException("Zookeeper server is already started!"); } zkServer = new PublicZooKeeperServerMain(); logger.info("Zookeeper data path : {} ", dataDirPath); dataDir = dataDirPath; final String[] args = new String[]{Integer.toString(port), dataDirPath, Integer.toString(tickTime), maxClientCnxns}; try { logger.info("Zookeeper server started "); isStarted.compareAndSet(false, true); zkServer.initializeAndRun(args); } catch (QuorumPeerConfig.ConfigException e) { logger.warn("Caught exception while starting ZK", e); } catch (IOException e) { logger.warn("Caught exception while starting ZK", e); } } ``` The above start method will acquire the lock of the ZKServer class. But the line "zkServer.initializeAndRun(args);" will block until the application exit. So it will never release the lock. ```java private static synchronized void stopLocalZkServer(final boolean deleteDataDir) { // 省略 } ``` The above stop method try to acquire the lock of the ZKServer class, but it will never succeed. **To Reproduce** Steps to reproduce the behavior, for example: 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' 4. See error **Expected behavior** A clear and concise description of what you expected to happen. **Screenshots** If applicable, add screenshots to help explain your problem. **Which version of Dolphin Scheduler:** -[1.1.0-preview] **Additional context** Add any other context about the problem here. **Requirement or improvement - Please describe about your requirements or improvement suggestions.
https://github.com/apache/dolphinscheduler/issues/3140
https://github.com/apache/dolphinscheduler/pull/3141
6f9970b189d71d043e79200a70a95f2f33ad10f4
753ed58fb9f15f85240918fe6457cf9015ee5101
2020-07-05T15:26:02Z
java
2020-07-13T10:52:33Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/zk/ZKServer.java
private static final Logger logger = LoggerFactory.getLogger(ZKServer.class); private static volatile PublicZooKeeperServerMain zkServer = null; public static final int DEFAULT_ZK_TEST_PORT = 2181; private static String dataDir = null; private static final AtomicBoolean isStarted = new AtomicBoolean(false); public static void main(String[] args) { if(!isStarted()){ ZKServer.start(); /** * register hooks, which are called before the process exits */ Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() { @Override public void run() { stop(); } })); }else{ logger.info("zk server aleady started"); } } /** * start service
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,140
[BUG] Embed zookeeper server 'ZKServer' has deadlock problem
*For better global communication, please give priority to using English description, thx! * **Describe the bug** look at the code snippet ```java private static synchronized void startLocalZkServer(final int port, final String dataDirPath,final int tickTime,String maxClientCnxns) { if (zkServer != null) { throw new RuntimeException("Zookeeper server is already started!"); } zkServer = new PublicZooKeeperServerMain(); logger.info("Zookeeper data path : {} ", dataDirPath); dataDir = dataDirPath; final String[] args = new String[]{Integer.toString(port), dataDirPath, Integer.toString(tickTime), maxClientCnxns}; try { logger.info("Zookeeper server started "); isStarted.compareAndSet(false, true); zkServer.initializeAndRun(args); } catch (QuorumPeerConfig.ConfigException e) { logger.warn("Caught exception while starting ZK", e); } catch (IOException e) { logger.warn("Caught exception while starting ZK", e); } } ``` The above start method will acquire the lock of the ZKServer class. But the line "zkServer.initializeAndRun(args);" will block until the application exit. So it will never release the lock. ```java private static synchronized void stopLocalZkServer(final boolean deleteDataDir) { // 省略 } ``` The above stop method try to acquire the lock of the ZKServer class, but it will never succeed. **To Reproduce** Steps to reproduce the behavior, for example: 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' 4. See error **Expected behavior** A clear and concise description of what you expected to happen. **Screenshots** If applicable, add screenshots to help explain your problem. **Which version of Dolphin Scheduler:** -[1.1.0-preview] **Additional context** Add any other context about the problem here. **Requirement or improvement - Please describe about your requirements or improvement suggestions.
https://github.com/apache/dolphinscheduler/issues/3140
https://github.com/apache/dolphinscheduler/pull/3141
6f9970b189d71d043e79200a70a95f2f33ad10f4
753ed58fb9f15f85240918fe6457cf9015ee5101
2020-07-05T15:26:02Z
java
2020-07-13T10:52:33Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/zk/ZKServer.java
*/ public static void start() { try { startLocalZkServer(DEFAULT_ZK_TEST_PORT); } catch (Exception e) { logger.error("Failed to start ZK: " + e); } } public static boolean isStarted(){ return isStarted.get(); } static class PublicZooKeeperServerMain extends ZooKeeperServerMain { @Override public void initializeAndRun(String[] args) throws QuorumPeerConfig.ConfigException, IOException { super.initializeAndRun(args); } @Override public void shutdown() { super.shutdown(); } } /** * Starts a local Zk instance with a generated empty data directory * * @param port The port to listen on */ public static void startLocalZkServer(final int port) { String zkDataDir = System.getProperty("user.dir") +"/zookeeper_data"; logger.info("zk server starting, data dir path:{}" , zkDataDir);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,140
[BUG] Embed zookeeper server 'ZKServer' has deadlock problem
*For better global communication, please give priority to using English description, thx! * **Describe the bug** look at the code snippet ```java private static synchronized void startLocalZkServer(final int port, final String dataDirPath,final int tickTime,String maxClientCnxns) { if (zkServer != null) { throw new RuntimeException("Zookeeper server is already started!"); } zkServer = new PublicZooKeeperServerMain(); logger.info("Zookeeper data path : {} ", dataDirPath); dataDir = dataDirPath; final String[] args = new String[]{Integer.toString(port), dataDirPath, Integer.toString(tickTime), maxClientCnxns}; try { logger.info("Zookeeper server started "); isStarted.compareAndSet(false, true); zkServer.initializeAndRun(args); } catch (QuorumPeerConfig.ConfigException e) { logger.warn("Caught exception while starting ZK", e); } catch (IOException e) { logger.warn("Caught exception while starting ZK", e); } } ``` The above start method will acquire the lock of the ZKServer class. But the line "zkServer.initializeAndRun(args);" will block until the application exit. So it will never release the lock. ```java private static synchronized void stopLocalZkServer(final boolean deleteDataDir) { // 省略 } ``` The above stop method try to acquire the lock of the ZKServer class, but it will never succeed. **To Reproduce** Steps to reproduce the behavior, for example: 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' 4. See error **Expected behavior** A clear and concise description of what you expected to happen. **Screenshots** If applicable, add screenshots to help explain your problem. **Which version of Dolphin Scheduler:** -[1.1.0-preview] **Additional context** Add any other context about the problem here. **Requirement or improvement - Please describe about your requirements or improvement suggestions.
https://github.com/apache/dolphinscheduler/issues/3140
https://github.com/apache/dolphinscheduler/pull/3141
6f9970b189d71d043e79200a70a95f2f33ad10f4
753ed58fb9f15f85240918fe6457cf9015ee5101
2020-07-05T15:26:02Z
java
2020-07-13T10:52:33Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/zk/ZKServer.java
startLocalZkServer(port, zkDataDir, ZooKeeperServer.DEFAULT_TICK_TIME,"60"); } /** * Starts a local Zk instance * * @param port The port to listen on * @param dataDirPath The path for the Zk data directory * @param tickTime zk tick time * @param maxClientCnxns zk max client connections */ private static synchronized void startLocalZkServer(final int port, final String dataDirPath,final int tickTime,String maxClientCnxns) { if (zkServer != null) { throw new RuntimeException("Zookeeper server is already started!"); } zkServer = new PublicZooKeeperServerMain(); logger.info("Zookeeper data path : {} ", dataDirPath); dataDir = dataDirPath; final String[] args = new String[]{Integer.toString(port), dataDirPath, Integer.toString(tickTime), maxClientCnxns}; try { logger.info("Zookeeper server started "); isStarted.compareAndSet(false, true); zkServer.initializeAndRun(args); } catch (QuorumPeerConfig.ConfigException e) { logger.warn("Caught exception while starting ZK", e); } catch (IOException e) { logger.warn("Caught exception while starting ZK", e); } } /** * Stops a local Zk instance, deleting its data directory
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,140
[BUG] Embed zookeeper server 'ZKServer' has deadlock problem
*For better global communication, please give priority to using English description, thx! * **Describe the bug** look at the code snippet ```java private static synchronized void startLocalZkServer(final int port, final String dataDirPath,final int tickTime,String maxClientCnxns) { if (zkServer != null) { throw new RuntimeException("Zookeeper server is already started!"); } zkServer = new PublicZooKeeperServerMain(); logger.info("Zookeeper data path : {} ", dataDirPath); dataDir = dataDirPath; final String[] args = new String[]{Integer.toString(port), dataDirPath, Integer.toString(tickTime), maxClientCnxns}; try { logger.info("Zookeeper server started "); isStarted.compareAndSet(false, true); zkServer.initializeAndRun(args); } catch (QuorumPeerConfig.ConfigException e) { logger.warn("Caught exception while starting ZK", e); } catch (IOException e) { logger.warn("Caught exception while starting ZK", e); } } ``` The above start method will acquire the lock of the ZKServer class. But the line "zkServer.initializeAndRun(args);" will block until the application exit. So it will never release the lock. ```java private static synchronized void stopLocalZkServer(final boolean deleteDataDir) { // 省略 } ``` The above stop method try to acquire the lock of the ZKServer class, but it will never succeed. **To Reproduce** Steps to reproduce the behavior, for example: 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' 4. See error **Expected behavior** A clear and concise description of what you expected to happen. **Screenshots** If applicable, add screenshots to help explain your problem. **Which version of Dolphin Scheduler:** -[1.1.0-preview] **Additional context** Add any other context about the problem here. **Requirement or improvement - Please describe about your requirements or improvement suggestions.
https://github.com/apache/dolphinscheduler/issues/3140
https://github.com/apache/dolphinscheduler/pull/3141
6f9970b189d71d043e79200a70a95f2f33ad10f4
753ed58fb9f15f85240918fe6457cf9015ee5101
2020-07-05T15:26:02Z
java
2020-07-13T10:52:33Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/zk/ZKServer.java
*/ public static void stop() { try { stopLocalZkServer(true); logger.info("zk server stopped"); } catch (Exception e) { logger.error("Failed to stop ZK ",e); } } /** * Stops a local Zk instance. * * @param deleteDataDir Whether or not to delete the data directory */ private static synchronized void stopLocalZkServer(final boolean deleteDataDir) { if (zkServer != null) { try { zkServer.shutdown(); zkServer = null; if (deleteDataDir) { org.apache.commons.io.FileUtils.deleteDirectory(new File(dataDir)); } isStarted.compareAndSet(true, false); } catch (Exception e) { logger.warn("Caught exception while stopping ZK server", e); throw new RuntimeException(e); } } } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,140
[BUG] Embed zookeeper server 'ZKServer' has deadlock problem
*For better global communication, please give priority to using English description, thx! * **Describe the bug** look at the code snippet ```java private static synchronized void startLocalZkServer(final int port, final String dataDirPath,final int tickTime,String maxClientCnxns) { if (zkServer != null) { throw new RuntimeException("Zookeeper server is already started!"); } zkServer = new PublicZooKeeperServerMain(); logger.info("Zookeeper data path : {} ", dataDirPath); dataDir = dataDirPath; final String[] args = new String[]{Integer.toString(port), dataDirPath, Integer.toString(tickTime), maxClientCnxns}; try { logger.info("Zookeeper server started "); isStarted.compareAndSet(false, true); zkServer.initializeAndRun(args); } catch (QuorumPeerConfig.ConfigException e) { logger.warn("Caught exception while starting ZK", e); } catch (IOException e) { logger.warn("Caught exception while starting ZK", e); } } ``` The above start method will acquire the lock of the ZKServer class. But the line "zkServer.initializeAndRun(args);" will block until the application exit. So it will never release the lock. ```java private static synchronized void stopLocalZkServer(final boolean deleteDataDir) { // 省略 } ``` The above stop method try to acquire the lock of the ZKServer class, but it will never succeed. **To Reproduce** Steps to reproduce the behavior, for example: 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' 4. See error **Expected behavior** A clear and concise description of what you expected to happen. **Screenshots** If applicable, add screenshots to help explain your problem. **Which version of Dolphin Scheduler:** -[1.1.0-preview] **Additional context** Add any other context about the problem here. **Requirement or improvement - Please describe about your requirements or improvement suggestions.
https://github.com/apache/dolphinscheduler/issues/3140
https://github.com/apache/dolphinscheduler/pull/3141
6f9970b189d71d043e79200a70a95f2f33ad10f4
753ed58fb9f15f85240918fe6457cf9015ee5101
2020-07-05T15:26:02Z
java
2020-07-13T10:52:33Z
dolphinscheduler-service/src/test/java/org/apache/dolphinscheduler/service/zk/ZKServerTest.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.dolphinscheduler.service.zk; import org.junit.Assert; import org.junit.Test; public class ZKServerTest { @Test public void isStarted() { Assert.assertEquals(false, ZKServer.isStarted()); } @Test public void stop() { ZKServer.stop(); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,240
[Bug][worker] Cannot find a (Map) Key deserializer for type
When I execute SQL query task, JSON parsing error error info : ```` com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot find a (Map) Key deserializer for type [simple type, class org.apache.dolphinscheduler.dao.entity.UdfFunc] ````` ![image](https://user-images.githubusercontent.com/39816903/87851699-ecb1ad80-c92d-11ea-8c3d-820f38f5d68d.png) show code : TaskExecutionContext taskExecutionContext = JSONUtils.parseObject(contextJson, TaskExecutionContext.class); ![image](https://user-images.githubusercontent.com/39816903/87851753-69448c00-c92e-11ea-94e0-36b45135e533.png) contextJson: ``` { "taskInstanceId":2, "taskName":"SQL-QUERY", "startTime":"2020-07-18 19:18:58", "taskType":"SQL", "host":null, "executePath":"/tmp/dolphinscheduler/exec/process/2/17/2/2", "logPath":null, "taskJson":"{"id":"tasks-5736","name":"SQL-QUERY","desc":null,"type":"SQL","runFlag":"NORMAL","loc":null,"maxRetryTimes":0,"retryInterval":1,"params":{"type":"MYSQL","datasource":3,"sql":"SELECT * FROM person","udfs":"","sqlType":"0","title":"SQL-QUERY","receivers":"[email protected]","receiversCc":"","showType":"TABLE","localParams":[],"connParams":"","preStatements":[],"postStatements":[]},"preTasks":[],"extras":null,"depList":[],"dependence":{},"conditionResult":{"successNode":[""],"failedNode":[""]},"taskInstancePriority":"MEDIUM","workerGroup":"default","workerGroupId":null,"timeout":{"strategy":"","interval":null,"enable":false},"conditionsTask":false,"forbidden":false,"taskTimeoutParameter":{"enable":false,"strategy":null,"interval":0}}", "processId":0, "appIds":null, "processInstanceId":2, "scheduleTime":null, "globalParams":null, "executorId":2, "cmdTypeIfComplement":0, "tenantCode":"sysadmin", "queue":"default", "processDefineId":17, "projectId":2, "taskParams":null, "envFile":null, "definedParams":null, "taskAppId":null, "taskTimeoutStrategy":0, "taskTimeout":0, "workerGroup":"default", "resources":{ }, "sqlTaskExecutionContext":{ "warningGroupId":0, "connectionParams":"{"type":null,"address":"jdbc:mysql://127.0.0.1:3306","database":"test","jdbcUrl":"jdbc:mysql://127.0.0.1:3306/test","user":"root","password":"IUAjJCVeJipyb290"}", "udfFuncTenantCodeMap":null }, "dataxTaskExecutionContext":{ "dataSourceId":0, "sourcetype":0, "sourceConnectionParams":null, "dataTargetId":0, "targetType":0, "targetConnectionParams":null }, "dependenceTaskExecutionContext":null, "sqoopTaskExecutionContext":{ "dataSourceId":0, "sourcetype":0, "sourceConnectionParams":null, "dataTargetId":0, "targetType":0, "targetConnectionParams":null }, "procedureTaskExecutionContext":{ "connectionParams":null } } ``` test unit : ``` public class TaskExecuteProcessorTest { @Test public void testJson(){ String contextJson = "{\n" + " \"taskInstanceId\":2,\n" + " \"taskName\":\"SQL-QUERY\",\n" + " \"startTime\":\"2020-07-18 19:18:58\",\n" + " \"taskType\":\"SQL\",\n" + " \"host\":null,\n" + " \"executePath\":\"/tmp/dolphinscheduler/exec/process/2/17/2/2\",\n" + " \"logPath\":null,\n" + " \"taskJson\":\"{\"id\":\"tasks-5736\",\"name\":\"SQL-QUERY\",\"desc\":null,\"type\":\"SQL\",\"runFlag\":\"NORMAL\",\"loc\":null,\"maxRetryTimes\":0,\"retryInterval\":1,\"params\":{\"type\":\"MYSQL\",\"datasource\":3,\"sql\":\"SELECT * FROM person\",\"udfs\":\"\",\"sqlType\":\"0\",\"title\":\"SQL-QUERY\",\"receivers\":\"[email protected]\",\"receiversCc\":\"\",\"showType\":\"TABLE\",\"localParams\":[],\"connParams\":\"\",\"preStatements\":[],\"postStatements\":[]},\"preTasks\":[],\"extras\":null,\"depList\":[],\"dependence\":{},\"conditionResult\":{\"successNode\":[\"\"],\"failedNode\":[\"\"]},\"taskInstancePriority\":\"MEDIUM\",\"workerGroup\":\"default\",\"workerGroupId\":null,\"timeout\":{\"strategy\":\"\",\"interval\":null,\"enable\":false},\"conditionsTask\":false,\"forbidden\":false,\"taskTimeoutParameter\":{\"enable\":false,\"strategy\":null,\"interval\":0}}\",\n" + " \"processId\":0,\n" + " \"appIds\":null,\n" + " \"processInstanceId\":2,\n" + " \"scheduleTime\":null,\n" + " \"globalParams\":null,\n" + " \"executorId\":2,\n" + " \"cmdTypeIfComplement\":0,\n" + " \"tenantCode\":\"sysadmin\",\n" + " \"queue\":\"default\",\n" + " \"processDefineId\":17,\n" + " \"projectId\":2,\n" + " \"taskParams\":null,\n" + " \"envFile\":null,\n" + " \"definedParams\":null,\n" + " \"taskAppId\":null,\n" + " \"taskTimeoutStrategy\":0,\n" + " \"taskTimeout\":0,\n" + " \"workerGroup\":\"default\",\n" + " \"resources\":{\n" + "\n" + " },\n" + " \"sqlTaskExecutionContext\":{\n" + " \"warningGroupId\":0,\n" + " \"connectionParams\":\"{\"type\":null,\"address\":\"jdbc:mysql://127.0.0.1:3306\",\"database\":\"test\",\"jdbcUrl\":\"jdbc:mysql://127.0.0.1:3306/test\",\"user\":\"root\",\"password\":\"IUAjJCVeJipyb290\"}\",\n" + " \"udfFuncTenantCodeMap\":null\n" + " },\n" + " \"dataxTaskExecutionContext\":{\n" + " \"dataSourceId\":0,\n" + " \"sourcetype\":0,\n" + " \"sourceConnectionParams\":null,\n" + " \"dataTargetId\":0,\n" + " \"targetType\":0,\n" + " \"targetConnectionParams\":null\n" + " },\n" + " \"dependenceTaskExecutionContext\":null,\n" + " \"sqoopTaskExecutionContext\":{\n" + " \"dataSourceId\":0,\n" + " \"sourcetype\":0,\n" + " \"sourceConnectionParams\":null,\n" + " \"dataTargetId\":0,\n" + " \"targetType\":0,\n" + " \"targetConnectionParams\":null\n" + " },\n" + " \"procedureTaskExecutionContext\":{\n" + " \"connectionParams\":null\n" + " }\n" + "}" ; TaskExecutionContext taskExecutionContext = JSONUtils.parseObject(contextJson, TaskExecutionContext.class); assertTrue(taskExecutionContext != null); } } ``` error info : ``` Connected to the target VM, address: '127.0.0.1:53429', transport: 'socket' 19:43:31.405 [main] ERROR org.apache.dolphinscheduler.common.utils.JSONUtils - parse object exception! com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot find a (Map) Key deserializer for type [simple type, class org.apache.dolphinscheduler.dao.entity.UdfFunc] at [Source: (String)"{ "taskInstanceId":2, "taskName":"SQL-QUERY", "startTime":"2020-07-18 19:18:58", "taskType":"SQL", "host":null, "executePath":"/tmp/dolphinscheduler/exec/process/2/17/2/2", "logPath":null, "taskJson":"{"id":"tasks-5736","name":"SQL-QUERY","desc":null,"type":"SQL","runFlag":"NORMAL","loc":null,"maxRetryTimes":0,"retryInterval":1,"params":{"type":"MYSQL","datasource":3,"sql":"SELECT * FROM person","udfs":"","sqlType":"0","title":"SQL-QUERY","receivers":"zhangboyi_mx"[truncated 1787 chars]; line: 1, column: 1] at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:67) at com.fasterxml.jackson.databind.DeserializationContext.reportBadDefinition(DeserializationContext.java:1452) at com.fasterxml.jackson.databind.deser.DeserializerCache._handleUnknownKeyDeserializer(DeserializerCache.java:599) at com.fasterxml.jackson.databind.deser.DeserializerCache.findKeyDeserializer(DeserializerCache.java:168) at com.fasterxml.jackson.databind.DeserializationContext.findKeyDeserializer(DeserializationContext.java:500) at com.fasterxml.jackson.databind.deser.std.MapDeserializer.createContextual(MapDeserializer.java:248) at com.fasterxml.jackson.databind.DeserializationContext.handlePrimaryContextualization(DeserializationContext.java:651) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.resolve(BeanDeserializerBase.java:484) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:293) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:244) at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:142) at com.fasterxml.jackson.databind.DeserializationContext.findNonContextualValueDeserializer(DeserializationContext.java:467) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.resolve(BeanDeserializerBase.java:473) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:293) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:244) at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:142) at com.fasterxml.jackson.databind.DeserializationContext.findRootValueDeserializer(DeserializationContext.java:477) at com.fasterxml.jackson.databind.ObjectMapper._findRootDeserializer(ObjectMapper.java:4190) at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4009) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3004) at org.apache.dolphinscheduler.common.utils.JSONUtils.parseObject(JSONUtils.java:108) at org.apache.dolphinscheduler.server.worker.processor.TaskExecuteProcessorTest.testJson(TaskExecuteProcessorTest.java:71) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230) at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58) Disconnected from the target VM, address: '127.0.0.1:53429', transport: 'socket' java.lang.AssertionError at org.junit.Assert.fail(Assert.java:86) at org.junit.Assert.assertTrue(Assert.java:41) at org.junit.Assert.assertTrue(Assert.java:52) at org.apache.dolphinscheduler.server.worker.processor.TaskExecuteProcessorTest.testJson(TaskExecuteProcessorTest.java:73) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230) at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58) ```
https://github.com/apache/dolphinscheduler/issues/3240
https://github.com/apache/dolphinscheduler/pull/3245
252abbdaed4a120b0bc5c23da3e956e3d429a7a1
6f2667bf1aab2715cfd734a5a694d2b2fd0adcc9
2020-07-18T11:39:43Z
java
2020-07-21T10:54:07Z
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/UdfFunc.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.dolphinscheduler.dao.entity; import com.fasterxml.jackson.annotation.JsonFormat; import org.apache.dolphinscheduler.common.enums.UdfType; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import java.util.Date; /** * udf function */ @TableName("t_ds_udfs")
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,240
[Bug][worker] Cannot find a (Map) Key deserializer for type
When I execute SQL query task, JSON parsing error error info : ```` com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot find a (Map) Key deserializer for type [simple type, class org.apache.dolphinscheduler.dao.entity.UdfFunc] ````` ![image](https://user-images.githubusercontent.com/39816903/87851699-ecb1ad80-c92d-11ea-8c3d-820f38f5d68d.png) show code : TaskExecutionContext taskExecutionContext = JSONUtils.parseObject(contextJson, TaskExecutionContext.class); ![image](https://user-images.githubusercontent.com/39816903/87851753-69448c00-c92e-11ea-94e0-36b45135e533.png) contextJson: ``` { "taskInstanceId":2, "taskName":"SQL-QUERY", "startTime":"2020-07-18 19:18:58", "taskType":"SQL", "host":null, "executePath":"/tmp/dolphinscheduler/exec/process/2/17/2/2", "logPath":null, "taskJson":"{"id":"tasks-5736","name":"SQL-QUERY","desc":null,"type":"SQL","runFlag":"NORMAL","loc":null,"maxRetryTimes":0,"retryInterval":1,"params":{"type":"MYSQL","datasource":3,"sql":"SELECT * FROM person","udfs":"","sqlType":"0","title":"SQL-QUERY","receivers":"[email protected]","receiversCc":"","showType":"TABLE","localParams":[],"connParams":"","preStatements":[],"postStatements":[]},"preTasks":[],"extras":null,"depList":[],"dependence":{},"conditionResult":{"successNode":[""],"failedNode":[""]},"taskInstancePriority":"MEDIUM","workerGroup":"default","workerGroupId":null,"timeout":{"strategy":"","interval":null,"enable":false},"conditionsTask":false,"forbidden":false,"taskTimeoutParameter":{"enable":false,"strategy":null,"interval":0}}", "processId":0, "appIds":null, "processInstanceId":2, "scheduleTime":null, "globalParams":null, "executorId":2, "cmdTypeIfComplement":0, "tenantCode":"sysadmin", "queue":"default", "processDefineId":17, "projectId":2, "taskParams":null, "envFile":null, "definedParams":null, "taskAppId":null, "taskTimeoutStrategy":0, "taskTimeout":0, "workerGroup":"default", "resources":{ }, "sqlTaskExecutionContext":{ "warningGroupId":0, "connectionParams":"{"type":null,"address":"jdbc:mysql://127.0.0.1:3306","database":"test","jdbcUrl":"jdbc:mysql://127.0.0.1:3306/test","user":"root","password":"IUAjJCVeJipyb290"}", "udfFuncTenantCodeMap":null }, "dataxTaskExecutionContext":{ "dataSourceId":0, "sourcetype":0, "sourceConnectionParams":null, "dataTargetId":0, "targetType":0, "targetConnectionParams":null }, "dependenceTaskExecutionContext":null, "sqoopTaskExecutionContext":{ "dataSourceId":0, "sourcetype":0, "sourceConnectionParams":null, "dataTargetId":0, "targetType":0, "targetConnectionParams":null }, "procedureTaskExecutionContext":{ "connectionParams":null } } ``` test unit : ``` public class TaskExecuteProcessorTest { @Test public void testJson(){ String contextJson = "{\n" + " \"taskInstanceId\":2,\n" + " \"taskName\":\"SQL-QUERY\",\n" + " \"startTime\":\"2020-07-18 19:18:58\",\n" + " \"taskType\":\"SQL\",\n" + " \"host\":null,\n" + " \"executePath\":\"/tmp/dolphinscheduler/exec/process/2/17/2/2\",\n" + " \"logPath\":null,\n" + " \"taskJson\":\"{\"id\":\"tasks-5736\",\"name\":\"SQL-QUERY\",\"desc\":null,\"type\":\"SQL\",\"runFlag\":\"NORMAL\",\"loc\":null,\"maxRetryTimes\":0,\"retryInterval\":1,\"params\":{\"type\":\"MYSQL\",\"datasource\":3,\"sql\":\"SELECT * FROM person\",\"udfs\":\"\",\"sqlType\":\"0\",\"title\":\"SQL-QUERY\",\"receivers\":\"[email protected]\",\"receiversCc\":\"\",\"showType\":\"TABLE\",\"localParams\":[],\"connParams\":\"\",\"preStatements\":[],\"postStatements\":[]},\"preTasks\":[],\"extras\":null,\"depList\":[],\"dependence\":{},\"conditionResult\":{\"successNode\":[\"\"],\"failedNode\":[\"\"]},\"taskInstancePriority\":\"MEDIUM\",\"workerGroup\":\"default\",\"workerGroupId\":null,\"timeout\":{\"strategy\":\"\",\"interval\":null,\"enable\":false},\"conditionsTask\":false,\"forbidden\":false,\"taskTimeoutParameter\":{\"enable\":false,\"strategy\":null,\"interval\":0}}\",\n" + " \"processId\":0,\n" + " \"appIds\":null,\n" + " \"processInstanceId\":2,\n" + " \"scheduleTime\":null,\n" + " \"globalParams\":null,\n" + " \"executorId\":2,\n" + " \"cmdTypeIfComplement\":0,\n" + " \"tenantCode\":\"sysadmin\",\n" + " \"queue\":\"default\",\n" + " \"processDefineId\":17,\n" + " \"projectId\":2,\n" + " \"taskParams\":null,\n" + " \"envFile\":null,\n" + " \"definedParams\":null,\n" + " \"taskAppId\":null,\n" + " \"taskTimeoutStrategy\":0,\n" + " \"taskTimeout\":0,\n" + " \"workerGroup\":\"default\",\n" + " \"resources\":{\n" + "\n" + " },\n" + " \"sqlTaskExecutionContext\":{\n" + " \"warningGroupId\":0,\n" + " \"connectionParams\":\"{\"type\":null,\"address\":\"jdbc:mysql://127.0.0.1:3306\",\"database\":\"test\",\"jdbcUrl\":\"jdbc:mysql://127.0.0.1:3306/test\",\"user\":\"root\",\"password\":\"IUAjJCVeJipyb290\"}\",\n" + " \"udfFuncTenantCodeMap\":null\n" + " },\n" + " \"dataxTaskExecutionContext\":{\n" + " \"dataSourceId\":0,\n" + " \"sourcetype\":0,\n" + " \"sourceConnectionParams\":null,\n" + " \"dataTargetId\":0,\n" + " \"targetType\":0,\n" + " \"targetConnectionParams\":null\n" + " },\n" + " \"dependenceTaskExecutionContext\":null,\n" + " \"sqoopTaskExecutionContext\":{\n" + " \"dataSourceId\":0,\n" + " \"sourcetype\":0,\n" + " \"sourceConnectionParams\":null,\n" + " \"dataTargetId\":0,\n" + " \"targetType\":0,\n" + " \"targetConnectionParams\":null\n" + " },\n" + " \"procedureTaskExecutionContext\":{\n" + " \"connectionParams\":null\n" + " }\n" + "}" ; TaskExecutionContext taskExecutionContext = JSONUtils.parseObject(contextJson, TaskExecutionContext.class); assertTrue(taskExecutionContext != null); } } ``` error info : ``` Connected to the target VM, address: '127.0.0.1:53429', transport: 'socket' 19:43:31.405 [main] ERROR org.apache.dolphinscheduler.common.utils.JSONUtils - parse object exception! com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot find a (Map) Key deserializer for type [simple type, class org.apache.dolphinscheduler.dao.entity.UdfFunc] at [Source: (String)"{ "taskInstanceId":2, "taskName":"SQL-QUERY", "startTime":"2020-07-18 19:18:58", "taskType":"SQL", "host":null, "executePath":"/tmp/dolphinscheduler/exec/process/2/17/2/2", "logPath":null, "taskJson":"{"id":"tasks-5736","name":"SQL-QUERY","desc":null,"type":"SQL","runFlag":"NORMAL","loc":null,"maxRetryTimes":0,"retryInterval":1,"params":{"type":"MYSQL","datasource":3,"sql":"SELECT * FROM person","udfs":"","sqlType":"0","title":"SQL-QUERY","receivers":"zhangboyi_mx"[truncated 1787 chars]; line: 1, column: 1] at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:67) at com.fasterxml.jackson.databind.DeserializationContext.reportBadDefinition(DeserializationContext.java:1452) at com.fasterxml.jackson.databind.deser.DeserializerCache._handleUnknownKeyDeserializer(DeserializerCache.java:599) at com.fasterxml.jackson.databind.deser.DeserializerCache.findKeyDeserializer(DeserializerCache.java:168) at com.fasterxml.jackson.databind.DeserializationContext.findKeyDeserializer(DeserializationContext.java:500) at com.fasterxml.jackson.databind.deser.std.MapDeserializer.createContextual(MapDeserializer.java:248) at com.fasterxml.jackson.databind.DeserializationContext.handlePrimaryContextualization(DeserializationContext.java:651) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.resolve(BeanDeserializerBase.java:484) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:293) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:244) at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:142) at com.fasterxml.jackson.databind.DeserializationContext.findNonContextualValueDeserializer(DeserializationContext.java:467) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.resolve(BeanDeserializerBase.java:473) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:293) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:244) at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:142) at com.fasterxml.jackson.databind.DeserializationContext.findRootValueDeserializer(DeserializationContext.java:477) at com.fasterxml.jackson.databind.ObjectMapper._findRootDeserializer(ObjectMapper.java:4190) at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4009) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3004) at org.apache.dolphinscheduler.common.utils.JSONUtils.parseObject(JSONUtils.java:108) at org.apache.dolphinscheduler.server.worker.processor.TaskExecuteProcessorTest.testJson(TaskExecuteProcessorTest.java:71) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230) at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58) Disconnected from the target VM, address: '127.0.0.1:53429', transport: 'socket' java.lang.AssertionError at org.junit.Assert.fail(Assert.java:86) at org.junit.Assert.assertTrue(Assert.java:41) at org.junit.Assert.assertTrue(Assert.java:52) at org.apache.dolphinscheduler.server.worker.processor.TaskExecuteProcessorTest.testJson(TaskExecuteProcessorTest.java:73) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230) at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58) ```
https://github.com/apache/dolphinscheduler/issues/3240
https://github.com/apache/dolphinscheduler/pull/3245
252abbdaed4a120b0bc5c23da3e956e3d429a7a1
6f2667bf1aab2715cfd734a5a694d2b2fd0adcc9
2020-07-18T11:39:43Z
java
2020-07-21T10:54:07Z
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/UdfFunc.java
public class UdfFunc { /** * id */ @TableId(value="id", type=IdType.AUTO) private int id; /** * user id */ private int userId; /** * udf function name */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,240
[Bug][worker] Cannot find a (Map) Key deserializer for type
When I execute SQL query task, JSON parsing error error info : ```` com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot find a (Map) Key deserializer for type [simple type, class org.apache.dolphinscheduler.dao.entity.UdfFunc] ````` ![image](https://user-images.githubusercontent.com/39816903/87851699-ecb1ad80-c92d-11ea-8c3d-820f38f5d68d.png) show code : TaskExecutionContext taskExecutionContext = JSONUtils.parseObject(contextJson, TaskExecutionContext.class); ![image](https://user-images.githubusercontent.com/39816903/87851753-69448c00-c92e-11ea-94e0-36b45135e533.png) contextJson: ``` { "taskInstanceId":2, "taskName":"SQL-QUERY", "startTime":"2020-07-18 19:18:58", "taskType":"SQL", "host":null, "executePath":"/tmp/dolphinscheduler/exec/process/2/17/2/2", "logPath":null, "taskJson":"{"id":"tasks-5736","name":"SQL-QUERY","desc":null,"type":"SQL","runFlag":"NORMAL","loc":null,"maxRetryTimes":0,"retryInterval":1,"params":{"type":"MYSQL","datasource":3,"sql":"SELECT * FROM person","udfs":"","sqlType":"0","title":"SQL-QUERY","receivers":"[email protected]","receiversCc":"","showType":"TABLE","localParams":[],"connParams":"","preStatements":[],"postStatements":[]},"preTasks":[],"extras":null,"depList":[],"dependence":{},"conditionResult":{"successNode":[""],"failedNode":[""]},"taskInstancePriority":"MEDIUM","workerGroup":"default","workerGroupId":null,"timeout":{"strategy":"","interval":null,"enable":false},"conditionsTask":false,"forbidden":false,"taskTimeoutParameter":{"enable":false,"strategy":null,"interval":0}}", "processId":0, "appIds":null, "processInstanceId":2, "scheduleTime":null, "globalParams":null, "executorId":2, "cmdTypeIfComplement":0, "tenantCode":"sysadmin", "queue":"default", "processDefineId":17, "projectId":2, "taskParams":null, "envFile":null, "definedParams":null, "taskAppId":null, "taskTimeoutStrategy":0, "taskTimeout":0, "workerGroup":"default", "resources":{ }, "sqlTaskExecutionContext":{ "warningGroupId":0, "connectionParams":"{"type":null,"address":"jdbc:mysql://127.0.0.1:3306","database":"test","jdbcUrl":"jdbc:mysql://127.0.0.1:3306/test","user":"root","password":"IUAjJCVeJipyb290"}", "udfFuncTenantCodeMap":null }, "dataxTaskExecutionContext":{ "dataSourceId":0, "sourcetype":0, "sourceConnectionParams":null, "dataTargetId":0, "targetType":0, "targetConnectionParams":null }, "dependenceTaskExecutionContext":null, "sqoopTaskExecutionContext":{ "dataSourceId":0, "sourcetype":0, "sourceConnectionParams":null, "dataTargetId":0, "targetType":0, "targetConnectionParams":null }, "procedureTaskExecutionContext":{ "connectionParams":null } } ``` test unit : ``` public class TaskExecuteProcessorTest { @Test public void testJson(){ String contextJson = "{\n" + " \"taskInstanceId\":2,\n" + " \"taskName\":\"SQL-QUERY\",\n" + " \"startTime\":\"2020-07-18 19:18:58\",\n" + " \"taskType\":\"SQL\",\n" + " \"host\":null,\n" + " \"executePath\":\"/tmp/dolphinscheduler/exec/process/2/17/2/2\",\n" + " \"logPath\":null,\n" + " \"taskJson\":\"{\"id\":\"tasks-5736\",\"name\":\"SQL-QUERY\",\"desc\":null,\"type\":\"SQL\",\"runFlag\":\"NORMAL\",\"loc\":null,\"maxRetryTimes\":0,\"retryInterval\":1,\"params\":{\"type\":\"MYSQL\",\"datasource\":3,\"sql\":\"SELECT * FROM person\",\"udfs\":\"\",\"sqlType\":\"0\",\"title\":\"SQL-QUERY\",\"receivers\":\"[email protected]\",\"receiversCc\":\"\",\"showType\":\"TABLE\",\"localParams\":[],\"connParams\":\"\",\"preStatements\":[],\"postStatements\":[]},\"preTasks\":[],\"extras\":null,\"depList\":[],\"dependence\":{},\"conditionResult\":{\"successNode\":[\"\"],\"failedNode\":[\"\"]},\"taskInstancePriority\":\"MEDIUM\",\"workerGroup\":\"default\",\"workerGroupId\":null,\"timeout\":{\"strategy\":\"\",\"interval\":null,\"enable\":false},\"conditionsTask\":false,\"forbidden\":false,\"taskTimeoutParameter\":{\"enable\":false,\"strategy\":null,\"interval\":0}}\",\n" + " \"processId\":0,\n" + " \"appIds\":null,\n" + " \"processInstanceId\":2,\n" + " \"scheduleTime\":null,\n" + " \"globalParams\":null,\n" + " \"executorId\":2,\n" + " \"cmdTypeIfComplement\":0,\n" + " \"tenantCode\":\"sysadmin\",\n" + " \"queue\":\"default\",\n" + " \"processDefineId\":17,\n" + " \"projectId\":2,\n" + " \"taskParams\":null,\n" + " \"envFile\":null,\n" + " \"definedParams\":null,\n" + " \"taskAppId\":null,\n" + " \"taskTimeoutStrategy\":0,\n" + " \"taskTimeout\":0,\n" + " \"workerGroup\":\"default\",\n" + " \"resources\":{\n" + "\n" + " },\n" + " \"sqlTaskExecutionContext\":{\n" + " \"warningGroupId\":0,\n" + " \"connectionParams\":\"{\"type\":null,\"address\":\"jdbc:mysql://127.0.0.1:3306\",\"database\":\"test\",\"jdbcUrl\":\"jdbc:mysql://127.0.0.1:3306/test\",\"user\":\"root\",\"password\":\"IUAjJCVeJipyb290\"}\",\n" + " \"udfFuncTenantCodeMap\":null\n" + " },\n" + " \"dataxTaskExecutionContext\":{\n" + " \"dataSourceId\":0,\n" + " \"sourcetype\":0,\n" + " \"sourceConnectionParams\":null,\n" + " \"dataTargetId\":0,\n" + " \"targetType\":0,\n" + " \"targetConnectionParams\":null\n" + " },\n" + " \"dependenceTaskExecutionContext\":null,\n" + " \"sqoopTaskExecutionContext\":{\n" + " \"dataSourceId\":0,\n" + " \"sourcetype\":0,\n" + " \"sourceConnectionParams\":null,\n" + " \"dataTargetId\":0,\n" + " \"targetType\":0,\n" + " \"targetConnectionParams\":null\n" + " },\n" + " \"procedureTaskExecutionContext\":{\n" + " \"connectionParams\":null\n" + " }\n" + "}" ; TaskExecutionContext taskExecutionContext = JSONUtils.parseObject(contextJson, TaskExecutionContext.class); assertTrue(taskExecutionContext != null); } } ``` error info : ``` Connected to the target VM, address: '127.0.0.1:53429', transport: 'socket' 19:43:31.405 [main] ERROR org.apache.dolphinscheduler.common.utils.JSONUtils - parse object exception! com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot find a (Map) Key deserializer for type [simple type, class org.apache.dolphinscheduler.dao.entity.UdfFunc] at [Source: (String)"{ "taskInstanceId":2, "taskName":"SQL-QUERY", "startTime":"2020-07-18 19:18:58", "taskType":"SQL", "host":null, "executePath":"/tmp/dolphinscheduler/exec/process/2/17/2/2", "logPath":null, "taskJson":"{"id":"tasks-5736","name":"SQL-QUERY","desc":null,"type":"SQL","runFlag":"NORMAL","loc":null,"maxRetryTimes":0,"retryInterval":1,"params":{"type":"MYSQL","datasource":3,"sql":"SELECT * FROM person","udfs":"","sqlType":"0","title":"SQL-QUERY","receivers":"zhangboyi_mx"[truncated 1787 chars]; line: 1, column: 1] at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:67) at com.fasterxml.jackson.databind.DeserializationContext.reportBadDefinition(DeserializationContext.java:1452) at com.fasterxml.jackson.databind.deser.DeserializerCache._handleUnknownKeyDeserializer(DeserializerCache.java:599) at com.fasterxml.jackson.databind.deser.DeserializerCache.findKeyDeserializer(DeserializerCache.java:168) at com.fasterxml.jackson.databind.DeserializationContext.findKeyDeserializer(DeserializationContext.java:500) at com.fasterxml.jackson.databind.deser.std.MapDeserializer.createContextual(MapDeserializer.java:248) at com.fasterxml.jackson.databind.DeserializationContext.handlePrimaryContextualization(DeserializationContext.java:651) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.resolve(BeanDeserializerBase.java:484) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:293) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:244) at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:142) at com.fasterxml.jackson.databind.DeserializationContext.findNonContextualValueDeserializer(DeserializationContext.java:467) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.resolve(BeanDeserializerBase.java:473) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:293) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:244) at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:142) at com.fasterxml.jackson.databind.DeserializationContext.findRootValueDeserializer(DeserializationContext.java:477) at com.fasterxml.jackson.databind.ObjectMapper._findRootDeserializer(ObjectMapper.java:4190) at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4009) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3004) at org.apache.dolphinscheduler.common.utils.JSONUtils.parseObject(JSONUtils.java:108) at org.apache.dolphinscheduler.server.worker.processor.TaskExecuteProcessorTest.testJson(TaskExecuteProcessorTest.java:71) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230) at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58) Disconnected from the target VM, address: '127.0.0.1:53429', transport: 'socket' java.lang.AssertionError at org.junit.Assert.fail(Assert.java:86) at org.junit.Assert.assertTrue(Assert.java:41) at org.junit.Assert.assertTrue(Assert.java:52) at org.apache.dolphinscheduler.server.worker.processor.TaskExecuteProcessorTest.testJson(TaskExecuteProcessorTest.java:73) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230) at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58) ```
https://github.com/apache/dolphinscheduler/issues/3240
https://github.com/apache/dolphinscheduler/pull/3245
252abbdaed4a120b0bc5c23da3e956e3d429a7a1
6f2667bf1aab2715cfd734a5a694d2b2fd0adcc9
2020-07-18T11:39:43Z
java
2020-07-21T10:54:07Z
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/UdfFunc.java
private String funcName; /** * udf class name */ private String className; /** * udf argument types */ private String argTypes; /** * udf data base */ private String database; /** * udf description */ private String description; /** * resource id */ private int resourceId; /** * resource name */ private String resourceName; /** * udf function type: hive / spark */ private UdfType type; /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,240
[Bug][worker] Cannot find a (Map) Key deserializer for type
When I execute SQL query task, JSON parsing error error info : ```` com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot find a (Map) Key deserializer for type [simple type, class org.apache.dolphinscheduler.dao.entity.UdfFunc] ````` ![image](https://user-images.githubusercontent.com/39816903/87851699-ecb1ad80-c92d-11ea-8c3d-820f38f5d68d.png) show code : TaskExecutionContext taskExecutionContext = JSONUtils.parseObject(contextJson, TaskExecutionContext.class); ![image](https://user-images.githubusercontent.com/39816903/87851753-69448c00-c92e-11ea-94e0-36b45135e533.png) contextJson: ``` { "taskInstanceId":2, "taskName":"SQL-QUERY", "startTime":"2020-07-18 19:18:58", "taskType":"SQL", "host":null, "executePath":"/tmp/dolphinscheduler/exec/process/2/17/2/2", "logPath":null, "taskJson":"{"id":"tasks-5736","name":"SQL-QUERY","desc":null,"type":"SQL","runFlag":"NORMAL","loc":null,"maxRetryTimes":0,"retryInterval":1,"params":{"type":"MYSQL","datasource":3,"sql":"SELECT * FROM person","udfs":"","sqlType":"0","title":"SQL-QUERY","receivers":"[email protected]","receiversCc":"","showType":"TABLE","localParams":[],"connParams":"","preStatements":[],"postStatements":[]},"preTasks":[],"extras":null,"depList":[],"dependence":{},"conditionResult":{"successNode":[""],"failedNode":[""]},"taskInstancePriority":"MEDIUM","workerGroup":"default","workerGroupId":null,"timeout":{"strategy":"","interval":null,"enable":false},"conditionsTask":false,"forbidden":false,"taskTimeoutParameter":{"enable":false,"strategy":null,"interval":0}}", "processId":0, "appIds":null, "processInstanceId":2, "scheduleTime":null, "globalParams":null, "executorId":2, "cmdTypeIfComplement":0, "tenantCode":"sysadmin", "queue":"default", "processDefineId":17, "projectId":2, "taskParams":null, "envFile":null, "definedParams":null, "taskAppId":null, "taskTimeoutStrategy":0, "taskTimeout":0, "workerGroup":"default", "resources":{ }, "sqlTaskExecutionContext":{ "warningGroupId":0, "connectionParams":"{"type":null,"address":"jdbc:mysql://127.0.0.1:3306","database":"test","jdbcUrl":"jdbc:mysql://127.0.0.1:3306/test","user":"root","password":"IUAjJCVeJipyb290"}", "udfFuncTenantCodeMap":null }, "dataxTaskExecutionContext":{ "dataSourceId":0, "sourcetype":0, "sourceConnectionParams":null, "dataTargetId":0, "targetType":0, "targetConnectionParams":null }, "dependenceTaskExecutionContext":null, "sqoopTaskExecutionContext":{ "dataSourceId":0, "sourcetype":0, "sourceConnectionParams":null, "dataTargetId":0, "targetType":0, "targetConnectionParams":null }, "procedureTaskExecutionContext":{ "connectionParams":null } } ``` test unit : ``` public class TaskExecuteProcessorTest { @Test public void testJson(){ String contextJson = "{\n" + " \"taskInstanceId\":2,\n" + " \"taskName\":\"SQL-QUERY\",\n" + " \"startTime\":\"2020-07-18 19:18:58\",\n" + " \"taskType\":\"SQL\",\n" + " \"host\":null,\n" + " \"executePath\":\"/tmp/dolphinscheduler/exec/process/2/17/2/2\",\n" + " \"logPath\":null,\n" + " \"taskJson\":\"{\"id\":\"tasks-5736\",\"name\":\"SQL-QUERY\",\"desc\":null,\"type\":\"SQL\",\"runFlag\":\"NORMAL\",\"loc\":null,\"maxRetryTimes\":0,\"retryInterval\":1,\"params\":{\"type\":\"MYSQL\",\"datasource\":3,\"sql\":\"SELECT * FROM person\",\"udfs\":\"\",\"sqlType\":\"0\",\"title\":\"SQL-QUERY\",\"receivers\":\"[email protected]\",\"receiversCc\":\"\",\"showType\":\"TABLE\",\"localParams\":[],\"connParams\":\"\",\"preStatements\":[],\"postStatements\":[]},\"preTasks\":[],\"extras\":null,\"depList\":[],\"dependence\":{},\"conditionResult\":{\"successNode\":[\"\"],\"failedNode\":[\"\"]},\"taskInstancePriority\":\"MEDIUM\",\"workerGroup\":\"default\",\"workerGroupId\":null,\"timeout\":{\"strategy\":\"\",\"interval\":null,\"enable\":false},\"conditionsTask\":false,\"forbidden\":false,\"taskTimeoutParameter\":{\"enable\":false,\"strategy\":null,\"interval\":0}}\",\n" + " \"processId\":0,\n" + " \"appIds\":null,\n" + " \"processInstanceId\":2,\n" + " \"scheduleTime\":null,\n" + " \"globalParams\":null,\n" + " \"executorId\":2,\n" + " \"cmdTypeIfComplement\":0,\n" + " \"tenantCode\":\"sysadmin\",\n" + " \"queue\":\"default\",\n" + " \"processDefineId\":17,\n" + " \"projectId\":2,\n" + " \"taskParams\":null,\n" + " \"envFile\":null,\n" + " \"definedParams\":null,\n" + " \"taskAppId\":null,\n" + " \"taskTimeoutStrategy\":0,\n" + " \"taskTimeout\":0,\n" + " \"workerGroup\":\"default\",\n" + " \"resources\":{\n" + "\n" + " },\n" + " \"sqlTaskExecutionContext\":{\n" + " \"warningGroupId\":0,\n" + " \"connectionParams\":\"{\"type\":null,\"address\":\"jdbc:mysql://127.0.0.1:3306\",\"database\":\"test\",\"jdbcUrl\":\"jdbc:mysql://127.0.0.1:3306/test\",\"user\":\"root\",\"password\":\"IUAjJCVeJipyb290\"}\",\n" + " \"udfFuncTenantCodeMap\":null\n" + " },\n" + " \"dataxTaskExecutionContext\":{\n" + " \"dataSourceId\":0,\n" + " \"sourcetype\":0,\n" + " \"sourceConnectionParams\":null,\n" + " \"dataTargetId\":0,\n" + " \"targetType\":0,\n" + " \"targetConnectionParams\":null\n" + " },\n" + " \"dependenceTaskExecutionContext\":null,\n" + " \"sqoopTaskExecutionContext\":{\n" + " \"dataSourceId\":0,\n" + " \"sourcetype\":0,\n" + " \"sourceConnectionParams\":null,\n" + " \"dataTargetId\":0,\n" + " \"targetType\":0,\n" + " \"targetConnectionParams\":null\n" + " },\n" + " \"procedureTaskExecutionContext\":{\n" + " \"connectionParams\":null\n" + " }\n" + "}" ; TaskExecutionContext taskExecutionContext = JSONUtils.parseObject(contextJson, TaskExecutionContext.class); assertTrue(taskExecutionContext != null); } } ``` error info : ``` Connected to the target VM, address: '127.0.0.1:53429', transport: 'socket' 19:43:31.405 [main] ERROR org.apache.dolphinscheduler.common.utils.JSONUtils - parse object exception! com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot find a (Map) Key deserializer for type [simple type, class org.apache.dolphinscheduler.dao.entity.UdfFunc] at [Source: (String)"{ "taskInstanceId":2, "taskName":"SQL-QUERY", "startTime":"2020-07-18 19:18:58", "taskType":"SQL", "host":null, "executePath":"/tmp/dolphinscheduler/exec/process/2/17/2/2", "logPath":null, "taskJson":"{"id":"tasks-5736","name":"SQL-QUERY","desc":null,"type":"SQL","runFlag":"NORMAL","loc":null,"maxRetryTimes":0,"retryInterval":1,"params":{"type":"MYSQL","datasource":3,"sql":"SELECT * FROM person","udfs":"","sqlType":"0","title":"SQL-QUERY","receivers":"zhangboyi_mx"[truncated 1787 chars]; line: 1, column: 1] at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:67) at com.fasterxml.jackson.databind.DeserializationContext.reportBadDefinition(DeserializationContext.java:1452) at com.fasterxml.jackson.databind.deser.DeserializerCache._handleUnknownKeyDeserializer(DeserializerCache.java:599) at com.fasterxml.jackson.databind.deser.DeserializerCache.findKeyDeserializer(DeserializerCache.java:168) at com.fasterxml.jackson.databind.DeserializationContext.findKeyDeserializer(DeserializationContext.java:500) at com.fasterxml.jackson.databind.deser.std.MapDeserializer.createContextual(MapDeserializer.java:248) at com.fasterxml.jackson.databind.DeserializationContext.handlePrimaryContextualization(DeserializationContext.java:651) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.resolve(BeanDeserializerBase.java:484) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:293) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:244) at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:142) at com.fasterxml.jackson.databind.DeserializationContext.findNonContextualValueDeserializer(DeserializationContext.java:467) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.resolve(BeanDeserializerBase.java:473) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:293) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:244) at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:142) at com.fasterxml.jackson.databind.DeserializationContext.findRootValueDeserializer(DeserializationContext.java:477) at com.fasterxml.jackson.databind.ObjectMapper._findRootDeserializer(ObjectMapper.java:4190) at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4009) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3004) at org.apache.dolphinscheduler.common.utils.JSONUtils.parseObject(JSONUtils.java:108) at org.apache.dolphinscheduler.server.worker.processor.TaskExecuteProcessorTest.testJson(TaskExecuteProcessorTest.java:71) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230) at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58) Disconnected from the target VM, address: '127.0.0.1:53429', transport: 'socket' java.lang.AssertionError at org.junit.Assert.fail(Assert.java:86) at org.junit.Assert.assertTrue(Assert.java:41) at org.junit.Assert.assertTrue(Assert.java:52) at org.apache.dolphinscheduler.server.worker.processor.TaskExecuteProcessorTest.testJson(TaskExecuteProcessorTest.java:73) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230) at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58) ```
https://github.com/apache/dolphinscheduler/issues/3240
https://github.com/apache/dolphinscheduler/pull/3245
252abbdaed4a120b0bc5c23da3e956e3d429a7a1
6f2667bf1aab2715cfd734a5a694d2b2fd0adcc9
2020-07-18T11:39:43Z
java
2020-07-21T10:54:07Z
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/UdfFunc.java
* create time */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") private Date createTime; /** * update time */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") private Date updateTime; public int getId() { return id; } public void setId(int id) { this.id = id; } public int getUserId() { return userId; } public void setUserId(int userId) { this.userId = userId; } public String getFuncName() { return funcName; } public void setFuncName(String funcName) { this.funcName = funcName; } public String getClassName() { return className; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,240
[Bug][worker] Cannot find a (Map) Key deserializer for type
When I execute SQL query task, JSON parsing error error info : ```` com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot find a (Map) Key deserializer for type [simple type, class org.apache.dolphinscheduler.dao.entity.UdfFunc] ````` ![image](https://user-images.githubusercontent.com/39816903/87851699-ecb1ad80-c92d-11ea-8c3d-820f38f5d68d.png) show code : TaskExecutionContext taskExecutionContext = JSONUtils.parseObject(contextJson, TaskExecutionContext.class); ![image](https://user-images.githubusercontent.com/39816903/87851753-69448c00-c92e-11ea-94e0-36b45135e533.png) contextJson: ``` { "taskInstanceId":2, "taskName":"SQL-QUERY", "startTime":"2020-07-18 19:18:58", "taskType":"SQL", "host":null, "executePath":"/tmp/dolphinscheduler/exec/process/2/17/2/2", "logPath":null, "taskJson":"{"id":"tasks-5736","name":"SQL-QUERY","desc":null,"type":"SQL","runFlag":"NORMAL","loc":null,"maxRetryTimes":0,"retryInterval":1,"params":{"type":"MYSQL","datasource":3,"sql":"SELECT * FROM person","udfs":"","sqlType":"0","title":"SQL-QUERY","receivers":"[email protected]","receiversCc":"","showType":"TABLE","localParams":[],"connParams":"","preStatements":[],"postStatements":[]},"preTasks":[],"extras":null,"depList":[],"dependence":{},"conditionResult":{"successNode":[""],"failedNode":[""]},"taskInstancePriority":"MEDIUM","workerGroup":"default","workerGroupId":null,"timeout":{"strategy":"","interval":null,"enable":false},"conditionsTask":false,"forbidden":false,"taskTimeoutParameter":{"enable":false,"strategy":null,"interval":0}}", "processId":0, "appIds":null, "processInstanceId":2, "scheduleTime":null, "globalParams":null, "executorId":2, "cmdTypeIfComplement":0, "tenantCode":"sysadmin", "queue":"default", "processDefineId":17, "projectId":2, "taskParams":null, "envFile":null, "definedParams":null, "taskAppId":null, "taskTimeoutStrategy":0, "taskTimeout":0, "workerGroup":"default", "resources":{ }, "sqlTaskExecutionContext":{ "warningGroupId":0, "connectionParams":"{"type":null,"address":"jdbc:mysql://127.0.0.1:3306","database":"test","jdbcUrl":"jdbc:mysql://127.0.0.1:3306/test","user":"root","password":"IUAjJCVeJipyb290"}", "udfFuncTenantCodeMap":null }, "dataxTaskExecutionContext":{ "dataSourceId":0, "sourcetype":0, "sourceConnectionParams":null, "dataTargetId":0, "targetType":0, "targetConnectionParams":null }, "dependenceTaskExecutionContext":null, "sqoopTaskExecutionContext":{ "dataSourceId":0, "sourcetype":0, "sourceConnectionParams":null, "dataTargetId":0, "targetType":0, "targetConnectionParams":null }, "procedureTaskExecutionContext":{ "connectionParams":null } } ``` test unit : ``` public class TaskExecuteProcessorTest { @Test public void testJson(){ String contextJson = "{\n" + " \"taskInstanceId\":2,\n" + " \"taskName\":\"SQL-QUERY\",\n" + " \"startTime\":\"2020-07-18 19:18:58\",\n" + " \"taskType\":\"SQL\",\n" + " \"host\":null,\n" + " \"executePath\":\"/tmp/dolphinscheduler/exec/process/2/17/2/2\",\n" + " \"logPath\":null,\n" + " \"taskJson\":\"{\"id\":\"tasks-5736\",\"name\":\"SQL-QUERY\",\"desc\":null,\"type\":\"SQL\",\"runFlag\":\"NORMAL\",\"loc\":null,\"maxRetryTimes\":0,\"retryInterval\":1,\"params\":{\"type\":\"MYSQL\",\"datasource\":3,\"sql\":\"SELECT * FROM person\",\"udfs\":\"\",\"sqlType\":\"0\",\"title\":\"SQL-QUERY\",\"receivers\":\"[email protected]\",\"receiversCc\":\"\",\"showType\":\"TABLE\",\"localParams\":[],\"connParams\":\"\",\"preStatements\":[],\"postStatements\":[]},\"preTasks\":[],\"extras\":null,\"depList\":[],\"dependence\":{},\"conditionResult\":{\"successNode\":[\"\"],\"failedNode\":[\"\"]},\"taskInstancePriority\":\"MEDIUM\",\"workerGroup\":\"default\",\"workerGroupId\":null,\"timeout\":{\"strategy\":\"\",\"interval\":null,\"enable\":false},\"conditionsTask\":false,\"forbidden\":false,\"taskTimeoutParameter\":{\"enable\":false,\"strategy\":null,\"interval\":0}}\",\n" + " \"processId\":0,\n" + " \"appIds\":null,\n" + " \"processInstanceId\":2,\n" + " \"scheduleTime\":null,\n" + " \"globalParams\":null,\n" + " \"executorId\":2,\n" + " \"cmdTypeIfComplement\":0,\n" + " \"tenantCode\":\"sysadmin\",\n" + " \"queue\":\"default\",\n" + " \"processDefineId\":17,\n" + " \"projectId\":2,\n" + " \"taskParams\":null,\n" + " \"envFile\":null,\n" + " \"definedParams\":null,\n" + " \"taskAppId\":null,\n" + " \"taskTimeoutStrategy\":0,\n" + " \"taskTimeout\":0,\n" + " \"workerGroup\":\"default\",\n" + " \"resources\":{\n" + "\n" + " },\n" + " \"sqlTaskExecutionContext\":{\n" + " \"warningGroupId\":0,\n" + " \"connectionParams\":\"{\"type\":null,\"address\":\"jdbc:mysql://127.0.0.1:3306\",\"database\":\"test\",\"jdbcUrl\":\"jdbc:mysql://127.0.0.1:3306/test\",\"user\":\"root\",\"password\":\"IUAjJCVeJipyb290\"}\",\n" + " \"udfFuncTenantCodeMap\":null\n" + " },\n" + " \"dataxTaskExecutionContext\":{\n" + " \"dataSourceId\":0,\n" + " \"sourcetype\":0,\n" + " \"sourceConnectionParams\":null,\n" + " \"dataTargetId\":0,\n" + " \"targetType\":0,\n" + " \"targetConnectionParams\":null\n" + " },\n" + " \"dependenceTaskExecutionContext\":null,\n" + " \"sqoopTaskExecutionContext\":{\n" + " \"dataSourceId\":0,\n" + " \"sourcetype\":0,\n" + " \"sourceConnectionParams\":null,\n" + " \"dataTargetId\":0,\n" + " \"targetType\":0,\n" + " \"targetConnectionParams\":null\n" + " },\n" + " \"procedureTaskExecutionContext\":{\n" + " \"connectionParams\":null\n" + " }\n" + "}" ; TaskExecutionContext taskExecutionContext = JSONUtils.parseObject(contextJson, TaskExecutionContext.class); assertTrue(taskExecutionContext != null); } } ``` error info : ``` Connected to the target VM, address: '127.0.0.1:53429', transport: 'socket' 19:43:31.405 [main] ERROR org.apache.dolphinscheduler.common.utils.JSONUtils - parse object exception! com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot find a (Map) Key deserializer for type [simple type, class org.apache.dolphinscheduler.dao.entity.UdfFunc] at [Source: (String)"{ "taskInstanceId":2, "taskName":"SQL-QUERY", "startTime":"2020-07-18 19:18:58", "taskType":"SQL", "host":null, "executePath":"/tmp/dolphinscheduler/exec/process/2/17/2/2", "logPath":null, "taskJson":"{"id":"tasks-5736","name":"SQL-QUERY","desc":null,"type":"SQL","runFlag":"NORMAL","loc":null,"maxRetryTimes":0,"retryInterval":1,"params":{"type":"MYSQL","datasource":3,"sql":"SELECT * FROM person","udfs":"","sqlType":"0","title":"SQL-QUERY","receivers":"zhangboyi_mx"[truncated 1787 chars]; line: 1, column: 1] at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:67) at com.fasterxml.jackson.databind.DeserializationContext.reportBadDefinition(DeserializationContext.java:1452) at com.fasterxml.jackson.databind.deser.DeserializerCache._handleUnknownKeyDeserializer(DeserializerCache.java:599) at com.fasterxml.jackson.databind.deser.DeserializerCache.findKeyDeserializer(DeserializerCache.java:168) at com.fasterxml.jackson.databind.DeserializationContext.findKeyDeserializer(DeserializationContext.java:500) at com.fasterxml.jackson.databind.deser.std.MapDeserializer.createContextual(MapDeserializer.java:248) at com.fasterxml.jackson.databind.DeserializationContext.handlePrimaryContextualization(DeserializationContext.java:651) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.resolve(BeanDeserializerBase.java:484) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:293) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:244) at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:142) at com.fasterxml.jackson.databind.DeserializationContext.findNonContextualValueDeserializer(DeserializationContext.java:467) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.resolve(BeanDeserializerBase.java:473) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:293) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:244) at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:142) at com.fasterxml.jackson.databind.DeserializationContext.findRootValueDeserializer(DeserializationContext.java:477) at com.fasterxml.jackson.databind.ObjectMapper._findRootDeserializer(ObjectMapper.java:4190) at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4009) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3004) at org.apache.dolphinscheduler.common.utils.JSONUtils.parseObject(JSONUtils.java:108) at org.apache.dolphinscheduler.server.worker.processor.TaskExecuteProcessorTest.testJson(TaskExecuteProcessorTest.java:71) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230) at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58) Disconnected from the target VM, address: '127.0.0.1:53429', transport: 'socket' java.lang.AssertionError at org.junit.Assert.fail(Assert.java:86) at org.junit.Assert.assertTrue(Assert.java:41) at org.junit.Assert.assertTrue(Assert.java:52) at org.apache.dolphinscheduler.server.worker.processor.TaskExecuteProcessorTest.testJson(TaskExecuteProcessorTest.java:73) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230) at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58) ```
https://github.com/apache/dolphinscheduler/issues/3240
https://github.com/apache/dolphinscheduler/pull/3245
252abbdaed4a120b0bc5c23da3e956e3d429a7a1
6f2667bf1aab2715cfd734a5a694d2b2fd0adcc9
2020-07-18T11:39:43Z
java
2020-07-21T10:54:07Z
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/UdfFunc.java
public void setClassName(String className) { this.className = className; } public String getArgTypes() { return argTypes; } public void setArgTypes(String argTypes) { this.argTypes = argTypes; } public String getDatabase() { return database; } public void setDatabase(String database) { this.database = database; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public int getResourceId() { return resourceId; } public void setResourceId(int resourceId) { this.resourceId = resourceId; } public String getResourceName() { return resourceName; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,240
[Bug][worker] Cannot find a (Map) Key deserializer for type
When I execute SQL query task, JSON parsing error error info : ```` com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot find a (Map) Key deserializer for type [simple type, class org.apache.dolphinscheduler.dao.entity.UdfFunc] ````` ![image](https://user-images.githubusercontent.com/39816903/87851699-ecb1ad80-c92d-11ea-8c3d-820f38f5d68d.png) show code : TaskExecutionContext taskExecutionContext = JSONUtils.parseObject(contextJson, TaskExecutionContext.class); ![image](https://user-images.githubusercontent.com/39816903/87851753-69448c00-c92e-11ea-94e0-36b45135e533.png) contextJson: ``` { "taskInstanceId":2, "taskName":"SQL-QUERY", "startTime":"2020-07-18 19:18:58", "taskType":"SQL", "host":null, "executePath":"/tmp/dolphinscheduler/exec/process/2/17/2/2", "logPath":null, "taskJson":"{"id":"tasks-5736","name":"SQL-QUERY","desc":null,"type":"SQL","runFlag":"NORMAL","loc":null,"maxRetryTimes":0,"retryInterval":1,"params":{"type":"MYSQL","datasource":3,"sql":"SELECT * FROM person","udfs":"","sqlType":"0","title":"SQL-QUERY","receivers":"[email protected]","receiversCc":"","showType":"TABLE","localParams":[],"connParams":"","preStatements":[],"postStatements":[]},"preTasks":[],"extras":null,"depList":[],"dependence":{},"conditionResult":{"successNode":[""],"failedNode":[""]},"taskInstancePriority":"MEDIUM","workerGroup":"default","workerGroupId":null,"timeout":{"strategy":"","interval":null,"enable":false},"conditionsTask":false,"forbidden":false,"taskTimeoutParameter":{"enable":false,"strategy":null,"interval":0}}", "processId":0, "appIds":null, "processInstanceId":2, "scheduleTime":null, "globalParams":null, "executorId":2, "cmdTypeIfComplement":0, "tenantCode":"sysadmin", "queue":"default", "processDefineId":17, "projectId":2, "taskParams":null, "envFile":null, "definedParams":null, "taskAppId":null, "taskTimeoutStrategy":0, "taskTimeout":0, "workerGroup":"default", "resources":{ }, "sqlTaskExecutionContext":{ "warningGroupId":0, "connectionParams":"{"type":null,"address":"jdbc:mysql://127.0.0.1:3306","database":"test","jdbcUrl":"jdbc:mysql://127.0.0.1:3306/test","user":"root","password":"IUAjJCVeJipyb290"}", "udfFuncTenantCodeMap":null }, "dataxTaskExecutionContext":{ "dataSourceId":0, "sourcetype":0, "sourceConnectionParams":null, "dataTargetId":0, "targetType":0, "targetConnectionParams":null }, "dependenceTaskExecutionContext":null, "sqoopTaskExecutionContext":{ "dataSourceId":0, "sourcetype":0, "sourceConnectionParams":null, "dataTargetId":0, "targetType":0, "targetConnectionParams":null }, "procedureTaskExecutionContext":{ "connectionParams":null } } ``` test unit : ``` public class TaskExecuteProcessorTest { @Test public void testJson(){ String contextJson = "{\n" + " \"taskInstanceId\":2,\n" + " \"taskName\":\"SQL-QUERY\",\n" + " \"startTime\":\"2020-07-18 19:18:58\",\n" + " \"taskType\":\"SQL\",\n" + " \"host\":null,\n" + " \"executePath\":\"/tmp/dolphinscheduler/exec/process/2/17/2/2\",\n" + " \"logPath\":null,\n" + " \"taskJson\":\"{\"id\":\"tasks-5736\",\"name\":\"SQL-QUERY\",\"desc\":null,\"type\":\"SQL\",\"runFlag\":\"NORMAL\",\"loc\":null,\"maxRetryTimes\":0,\"retryInterval\":1,\"params\":{\"type\":\"MYSQL\",\"datasource\":3,\"sql\":\"SELECT * FROM person\",\"udfs\":\"\",\"sqlType\":\"0\",\"title\":\"SQL-QUERY\",\"receivers\":\"[email protected]\",\"receiversCc\":\"\",\"showType\":\"TABLE\",\"localParams\":[],\"connParams\":\"\",\"preStatements\":[],\"postStatements\":[]},\"preTasks\":[],\"extras\":null,\"depList\":[],\"dependence\":{},\"conditionResult\":{\"successNode\":[\"\"],\"failedNode\":[\"\"]},\"taskInstancePriority\":\"MEDIUM\",\"workerGroup\":\"default\",\"workerGroupId\":null,\"timeout\":{\"strategy\":\"\",\"interval\":null,\"enable\":false},\"conditionsTask\":false,\"forbidden\":false,\"taskTimeoutParameter\":{\"enable\":false,\"strategy\":null,\"interval\":0}}\",\n" + " \"processId\":0,\n" + " \"appIds\":null,\n" + " \"processInstanceId\":2,\n" + " \"scheduleTime\":null,\n" + " \"globalParams\":null,\n" + " \"executorId\":2,\n" + " \"cmdTypeIfComplement\":0,\n" + " \"tenantCode\":\"sysadmin\",\n" + " \"queue\":\"default\",\n" + " \"processDefineId\":17,\n" + " \"projectId\":2,\n" + " \"taskParams\":null,\n" + " \"envFile\":null,\n" + " \"definedParams\":null,\n" + " \"taskAppId\":null,\n" + " \"taskTimeoutStrategy\":0,\n" + " \"taskTimeout\":0,\n" + " \"workerGroup\":\"default\",\n" + " \"resources\":{\n" + "\n" + " },\n" + " \"sqlTaskExecutionContext\":{\n" + " \"warningGroupId\":0,\n" + " \"connectionParams\":\"{\"type\":null,\"address\":\"jdbc:mysql://127.0.0.1:3306\",\"database\":\"test\",\"jdbcUrl\":\"jdbc:mysql://127.0.0.1:3306/test\",\"user\":\"root\",\"password\":\"IUAjJCVeJipyb290\"}\",\n" + " \"udfFuncTenantCodeMap\":null\n" + " },\n" + " \"dataxTaskExecutionContext\":{\n" + " \"dataSourceId\":0,\n" + " \"sourcetype\":0,\n" + " \"sourceConnectionParams\":null,\n" + " \"dataTargetId\":0,\n" + " \"targetType\":0,\n" + " \"targetConnectionParams\":null\n" + " },\n" + " \"dependenceTaskExecutionContext\":null,\n" + " \"sqoopTaskExecutionContext\":{\n" + " \"dataSourceId\":0,\n" + " \"sourcetype\":0,\n" + " \"sourceConnectionParams\":null,\n" + " \"dataTargetId\":0,\n" + " \"targetType\":0,\n" + " \"targetConnectionParams\":null\n" + " },\n" + " \"procedureTaskExecutionContext\":{\n" + " \"connectionParams\":null\n" + " }\n" + "}" ; TaskExecutionContext taskExecutionContext = JSONUtils.parseObject(contextJson, TaskExecutionContext.class); assertTrue(taskExecutionContext != null); } } ``` error info : ``` Connected to the target VM, address: '127.0.0.1:53429', transport: 'socket' 19:43:31.405 [main] ERROR org.apache.dolphinscheduler.common.utils.JSONUtils - parse object exception! com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot find a (Map) Key deserializer for type [simple type, class org.apache.dolphinscheduler.dao.entity.UdfFunc] at [Source: (String)"{ "taskInstanceId":2, "taskName":"SQL-QUERY", "startTime":"2020-07-18 19:18:58", "taskType":"SQL", "host":null, "executePath":"/tmp/dolphinscheduler/exec/process/2/17/2/2", "logPath":null, "taskJson":"{"id":"tasks-5736","name":"SQL-QUERY","desc":null,"type":"SQL","runFlag":"NORMAL","loc":null,"maxRetryTimes":0,"retryInterval":1,"params":{"type":"MYSQL","datasource":3,"sql":"SELECT * FROM person","udfs":"","sqlType":"0","title":"SQL-QUERY","receivers":"zhangboyi_mx"[truncated 1787 chars]; line: 1, column: 1] at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:67) at com.fasterxml.jackson.databind.DeserializationContext.reportBadDefinition(DeserializationContext.java:1452) at com.fasterxml.jackson.databind.deser.DeserializerCache._handleUnknownKeyDeserializer(DeserializerCache.java:599) at com.fasterxml.jackson.databind.deser.DeserializerCache.findKeyDeserializer(DeserializerCache.java:168) at com.fasterxml.jackson.databind.DeserializationContext.findKeyDeserializer(DeserializationContext.java:500) at com.fasterxml.jackson.databind.deser.std.MapDeserializer.createContextual(MapDeserializer.java:248) at com.fasterxml.jackson.databind.DeserializationContext.handlePrimaryContextualization(DeserializationContext.java:651) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.resolve(BeanDeserializerBase.java:484) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:293) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:244) at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:142) at com.fasterxml.jackson.databind.DeserializationContext.findNonContextualValueDeserializer(DeserializationContext.java:467) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.resolve(BeanDeserializerBase.java:473) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:293) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:244) at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:142) at com.fasterxml.jackson.databind.DeserializationContext.findRootValueDeserializer(DeserializationContext.java:477) at com.fasterxml.jackson.databind.ObjectMapper._findRootDeserializer(ObjectMapper.java:4190) at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4009) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3004) at org.apache.dolphinscheduler.common.utils.JSONUtils.parseObject(JSONUtils.java:108) at org.apache.dolphinscheduler.server.worker.processor.TaskExecuteProcessorTest.testJson(TaskExecuteProcessorTest.java:71) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230) at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58) Disconnected from the target VM, address: '127.0.0.1:53429', transport: 'socket' java.lang.AssertionError at org.junit.Assert.fail(Assert.java:86) at org.junit.Assert.assertTrue(Assert.java:41) at org.junit.Assert.assertTrue(Assert.java:52) at org.apache.dolphinscheduler.server.worker.processor.TaskExecuteProcessorTest.testJson(TaskExecuteProcessorTest.java:73) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230) at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58) ```
https://github.com/apache/dolphinscheduler/issues/3240
https://github.com/apache/dolphinscheduler/pull/3245
252abbdaed4a120b0bc5c23da3e956e3d429a7a1
6f2667bf1aab2715cfd734a5a694d2b2fd0adcc9
2020-07-18T11:39:43Z
java
2020-07-21T10:54:07Z
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/UdfFunc.java
public void setResourceName(String resourceName) { this.resourceName = resourceName; } public UdfType getType() { return type; } public void setType(UdfType type) { this.type = type; } public Date getCreateTime() { return createTime; } public void setCreateTime(Date createTime) { this.createTime = createTime; } public Date getUpdateTime() { return updateTime; } public void setUpdateTime(Date updateTime) { this.updateTime = updateTime; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } UdfFunc udfFunc = (UdfFunc) o;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,240
[Bug][worker] Cannot find a (Map) Key deserializer for type
When I execute SQL query task, JSON parsing error error info : ```` com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot find a (Map) Key deserializer for type [simple type, class org.apache.dolphinscheduler.dao.entity.UdfFunc] ````` ![image](https://user-images.githubusercontent.com/39816903/87851699-ecb1ad80-c92d-11ea-8c3d-820f38f5d68d.png) show code : TaskExecutionContext taskExecutionContext = JSONUtils.parseObject(contextJson, TaskExecutionContext.class); ![image](https://user-images.githubusercontent.com/39816903/87851753-69448c00-c92e-11ea-94e0-36b45135e533.png) contextJson: ``` { "taskInstanceId":2, "taskName":"SQL-QUERY", "startTime":"2020-07-18 19:18:58", "taskType":"SQL", "host":null, "executePath":"/tmp/dolphinscheduler/exec/process/2/17/2/2", "logPath":null, "taskJson":"{"id":"tasks-5736","name":"SQL-QUERY","desc":null,"type":"SQL","runFlag":"NORMAL","loc":null,"maxRetryTimes":0,"retryInterval":1,"params":{"type":"MYSQL","datasource":3,"sql":"SELECT * FROM person","udfs":"","sqlType":"0","title":"SQL-QUERY","receivers":"[email protected]","receiversCc":"","showType":"TABLE","localParams":[],"connParams":"","preStatements":[],"postStatements":[]},"preTasks":[],"extras":null,"depList":[],"dependence":{},"conditionResult":{"successNode":[""],"failedNode":[""]},"taskInstancePriority":"MEDIUM","workerGroup":"default","workerGroupId":null,"timeout":{"strategy":"","interval":null,"enable":false},"conditionsTask":false,"forbidden":false,"taskTimeoutParameter":{"enable":false,"strategy":null,"interval":0}}", "processId":0, "appIds":null, "processInstanceId":2, "scheduleTime":null, "globalParams":null, "executorId":2, "cmdTypeIfComplement":0, "tenantCode":"sysadmin", "queue":"default", "processDefineId":17, "projectId":2, "taskParams":null, "envFile":null, "definedParams":null, "taskAppId":null, "taskTimeoutStrategy":0, "taskTimeout":0, "workerGroup":"default", "resources":{ }, "sqlTaskExecutionContext":{ "warningGroupId":0, "connectionParams":"{"type":null,"address":"jdbc:mysql://127.0.0.1:3306","database":"test","jdbcUrl":"jdbc:mysql://127.0.0.1:3306/test","user":"root","password":"IUAjJCVeJipyb290"}", "udfFuncTenantCodeMap":null }, "dataxTaskExecutionContext":{ "dataSourceId":0, "sourcetype":0, "sourceConnectionParams":null, "dataTargetId":0, "targetType":0, "targetConnectionParams":null }, "dependenceTaskExecutionContext":null, "sqoopTaskExecutionContext":{ "dataSourceId":0, "sourcetype":0, "sourceConnectionParams":null, "dataTargetId":0, "targetType":0, "targetConnectionParams":null }, "procedureTaskExecutionContext":{ "connectionParams":null } } ``` test unit : ``` public class TaskExecuteProcessorTest { @Test public void testJson(){ String contextJson = "{\n" + " \"taskInstanceId\":2,\n" + " \"taskName\":\"SQL-QUERY\",\n" + " \"startTime\":\"2020-07-18 19:18:58\",\n" + " \"taskType\":\"SQL\",\n" + " \"host\":null,\n" + " \"executePath\":\"/tmp/dolphinscheduler/exec/process/2/17/2/2\",\n" + " \"logPath\":null,\n" + " \"taskJson\":\"{\"id\":\"tasks-5736\",\"name\":\"SQL-QUERY\",\"desc\":null,\"type\":\"SQL\",\"runFlag\":\"NORMAL\",\"loc\":null,\"maxRetryTimes\":0,\"retryInterval\":1,\"params\":{\"type\":\"MYSQL\",\"datasource\":3,\"sql\":\"SELECT * FROM person\",\"udfs\":\"\",\"sqlType\":\"0\",\"title\":\"SQL-QUERY\",\"receivers\":\"[email protected]\",\"receiversCc\":\"\",\"showType\":\"TABLE\",\"localParams\":[],\"connParams\":\"\",\"preStatements\":[],\"postStatements\":[]},\"preTasks\":[],\"extras\":null,\"depList\":[],\"dependence\":{},\"conditionResult\":{\"successNode\":[\"\"],\"failedNode\":[\"\"]},\"taskInstancePriority\":\"MEDIUM\",\"workerGroup\":\"default\",\"workerGroupId\":null,\"timeout\":{\"strategy\":\"\",\"interval\":null,\"enable\":false},\"conditionsTask\":false,\"forbidden\":false,\"taskTimeoutParameter\":{\"enable\":false,\"strategy\":null,\"interval\":0}}\",\n" + " \"processId\":0,\n" + " \"appIds\":null,\n" + " \"processInstanceId\":2,\n" + " \"scheduleTime\":null,\n" + " \"globalParams\":null,\n" + " \"executorId\":2,\n" + " \"cmdTypeIfComplement\":0,\n" + " \"tenantCode\":\"sysadmin\",\n" + " \"queue\":\"default\",\n" + " \"processDefineId\":17,\n" + " \"projectId\":2,\n" + " \"taskParams\":null,\n" + " \"envFile\":null,\n" + " \"definedParams\":null,\n" + " \"taskAppId\":null,\n" + " \"taskTimeoutStrategy\":0,\n" + " \"taskTimeout\":0,\n" + " \"workerGroup\":\"default\",\n" + " \"resources\":{\n" + "\n" + " },\n" + " \"sqlTaskExecutionContext\":{\n" + " \"warningGroupId\":0,\n" + " \"connectionParams\":\"{\"type\":null,\"address\":\"jdbc:mysql://127.0.0.1:3306\",\"database\":\"test\",\"jdbcUrl\":\"jdbc:mysql://127.0.0.1:3306/test\",\"user\":\"root\",\"password\":\"IUAjJCVeJipyb290\"}\",\n" + " \"udfFuncTenantCodeMap\":null\n" + " },\n" + " \"dataxTaskExecutionContext\":{\n" + " \"dataSourceId\":0,\n" + " \"sourcetype\":0,\n" + " \"sourceConnectionParams\":null,\n" + " \"dataTargetId\":0,\n" + " \"targetType\":0,\n" + " \"targetConnectionParams\":null\n" + " },\n" + " \"dependenceTaskExecutionContext\":null,\n" + " \"sqoopTaskExecutionContext\":{\n" + " \"dataSourceId\":0,\n" + " \"sourcetype\":0,\n" + " \"sourceConnectionParams\":null,\n" + " \"dataTargetId\":0,\n" + " \"targetType\":0,\n" + " \"targetConnectionParams\":null\n" + " },\n" + " \"procedureTaskExecutionContext\":{\n" + " \"connectionParams\":null\n" + " }\n" + "}" ; TaskExecutionContext taskExecutionContext = JSONUtils.parseObject(contextJson, TaskExecutionContext.class); assertTrue(taskExecutionContext != null); } } ``` error info : ``` Connected to the target VM, address: '127.0.0.1:53429', transport: 'socket' 19:43:31.405 [main] ERROR org.apache.dolphinscheduler.common.utils.JSONUtils - parse object exception! com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot find a (Map) Key deserializer for type [simple type, class org.apache.dolphinscheduler.dao.entity.UdfFunc] at [Source: (String)"{ "taskInstanceId":2, "taskName":"SQL-QUERY", "startTime":"2020-07-18 19:18:58", "taskType":"SQL", "host":null, "executePath":"/tmp/dolphinscheduler/exec/process/2/17/2/2", "logPath":null, "taskJson":"{"id":"tasks-5736","name":"SQL-QUERY","desc":null,"type":"SQL","runFlag":"NORMAL","loc":null,"maxRetryTimes":0,"retryInterval":1,"params":{"type":"MYSQL","datasource":3,"sql":"SELECT * FROM person","udfs":"","sqlType":"0","title":"SQL-QUERY","receivers":"zhangboyi_mx"[truncated 1787 chars]; line: 1, column: 1] at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:67) at com.fasterxml.jackson.databind.DeserializationContext.reportBadDefinition(DeserializationContext.java:1452) at com.fasterxml.jackson.databind.deser.DeserializerCache._handleUnknownKeyDeserializer(DeserializerCache.java:599) at com.fasterxml.jackson.databind.deser.DeserializerCache.findKeyDeserializer(DeserializerCache.java:168) at com.fasterxml.jackson.databind.DeserializationContext.findKeyDeserializer(DeserializationContext.java:500) at com.fasterxml.jackson.databind.deser.std.MapDeserializer.createContextual(MapDeserializer.java:248) at com.fasterxml.jackson.databind.DeserializationContext.handlePrimaryContextualization(DeserializationContext.java:651) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.resolve(BeanDeserializerBase.java:484) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:293) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:244) at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:142) at com.fasterxml.jackson.databind.DeserializationContext.findNonContextualValueDeserializer(DeserializationContext.java:467) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.resolve(BeanDeserializerBase.java:473) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:293) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:244) at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:142) at com.fasterxml.jackson.databind.DeserializationContext.findRootValueDeserializer(DeserializationContext.java:477) at com.fasterxml.jackson.databind.ObjectMapper._findRootDeserializer(ObjectMapper.java:4190) at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4009) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3004) at org.apache.dolphinscheduler.common.utils.JSONUtils.parseObject(JSONUtils.java:108) at org.apache.dolphinscheduler.server.worker.processor.TaskExecuteProcessorTest.testJson(TaskExecuteProcessorTest.java:71) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230) at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58) Disconnected from the target VM, address: '127.0.0.1:53429', transport: 'socket' java.lang.AssertionError at org.junit.Assert.fail(Assert.java:86) at org.junit.Assert.assertTrue(Assert.java:41) at org.junit.Assert.assertTrue(Assert.java:52) at org.apache.dolphinscheduler.server.worker.processor.TaskExecuteProcessorTest.testJson(TaskExecuteProcessorTest.java:73) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230) at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58) ```
https://github.com/apache/dolphinscheduler/issues/3240
https://github.com/apache/dolphinscheduler/pull/3245
252abbdaed4a120b0bc5c23da3e956e3d429a7a1
6f2667bf1aab2715cfd734a5a694d2b2fd0adcc9
2020-07-18T11:39:43Z
java
2020-07-21T10:54:07Z
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/UdfFunc.java
if (id != udfFunc.id) { return false; } return !(funcName != null ? !funcName.equals(udfFunc.funcName) : udfFunc.funcName != null); } @Override public int hashCode() { int result = id; result = 31 * result + (funcName != null ? funcName.hashCode() : 0); return result; } @Override public String toString() { return "UdfFunc{" + "id=" + id + ", userId=" + userId + ", funcName='" + funcName + '\'' + ", className='" + className + '\'' + ", argTypes='" + argTypes + '\'' + ", database='" + database + '\'' + ", description='" + description + '\'' + ", resourceId=" + resourceId + ", resourceName='" + resourceName + '\'' + ", type=" + type + ", createTime=" + createTime + ", updateTime=" + updateTime + '}'; } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,240
[Bug][worker] Cannot find a (Map) Key deserializer for type
When I execute SQL query task, JSON parsing error error info : ```` com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot find a (Map) Key deserializer for type [simple type, class org.apache.dolphinscheduler.dao.entity.UdfFunc] ````` ![image](https://user-images.githubusercontent.com/39816903/87851699-ecb1ad80-c92d-11ea-8c3d-820f38f5d68d.png) show code : TaskExecutionContext taskExecutionContext = JSONUtils.parseObject(contextJson, TaskExecutionContext.class); ![image](https://user-images.githubusercontent.com/39816903/87851753-69448c00-c92e-11ea-94e0-36b45135e533.png) contextJson: ``` { "taskInstanceId":2, "taskName":"SQL-QUERY", "startTime":"2020-07-18 19:18:58", "taskType":"SQL", "host":null, "executePath":"/tmp/dolphinscheduler/exec/process/2/17/2/2", "logPath":null, "taskJson":"{"id":"tasks-5736","name":"SQL-QUERY","desc":null,"type":"SQL","runFlag":"NORMAL","loc":null,"maxRetryTimes":0,"retryInterval":1,"params":{"type":"MYSQL","datasource":3,"sql":"SELECT * FROM person","udfs":"","sqlType":"0","title":"SQL-QUERY","receivers":"[email protected]","receiversCc":"","showType":"TABLE","localParams":[],"connParams":"","preStatements":[],"postStatements":[]},"preTasks":[],"extras":null,"depList":[],"dependence":{},"conditionResult":{"successNode":[""],"failedNode":[""]},"taskInstancePriority":"MEDIUM","workerGroup":"default","workerGroupId":null,"timeout":{"strategy":"","interval":null,"enable":false},"conditionsTask":false,"forbidden":false,"taskTimeoutParameter":{"enable":false,"strategy":null,"interval":0}}", "processId":0, "appIds":null, "processInstanceId":2, "scheduleTime":null, "globalParams":null, "executorId":2, "cmdTypeIfComplement":0, "tenantCode":"sysadmin", "queue":"default", "processDefineId":17, "projectId":2, "taskParams":null, "envFile":null, "definedParams":null, "taskAppId":null, "taskTimeoutStrategy":0, "taskTimeout":0, "workerGroup":"default", "resources":{ }, "sqlTaskExecutionContext":{ "warningGroupId":0, "connectionParams":"{"type":null,"address":"jdbc:mysql://127.0.0.1:3306","database":"test","jdbcUrl":"jdbc:mysql://127.0.0.1:3306/test","user":"root","password":"IUAjJCVeJipyb290"}", "udfFuncTenantCodeMap":null }, "dataxTaskExecutionContext":{ "dataSourceId":0, "sourcetype":0, "sourceConnectionParams":null, "dataTargetId":0, "targetType":0, "targetConnectionParams":null }, "dependenceTaskExecutionContext":null, "sqoopTaskExecutionContext":{ "dataSourceId":0, "sourcetype":0, "sourceConnectionParams":null, "dataTargetId":0, "targetType":0, "targetConnectionParams":null }, "procedureTaskExecutionContext":{ "connectionParams":null } } ``` test unit : ``` public class TaskExecuteProcessorTest { @Test public void testJson(){ String contextJson = "{\n" + " \"taskInstanceId\":2,\n" + " \"taskName\":\"SQL-QUERY\",\n" + " \"startTime\":\"2020-07-18 19:18:58\",\n" + " \"taskType\":\"SQL\",\n" + " \"host\":null,\n" + " \"executePath\":\"/tmp/dolphinscheduler/exec/process/2/17/2/2\",\n" + " \"logPath\":null,\n" + " \"taskJson\":\"{\"id\":\"tasks-5736\",\"name\":\"SQL-QUERY\",\"desc\":null,\"type\":\"SQL\",\"runFlag\":\"NORMAL\",\"loc\":null,\"maxRetryTimes\":0,\"retryInterval\":1,\"params\":{\"type\":\"MYSQL\",\"datasource\":3,\"sql\":\"SELECT * FROM person\",\"udfs\":\"\",\"sqlType\":\"0\",\"title\":\"SQL-QUERY\",\"receivers\":\"[email protected]\",\"receiversCc\":\"\",\"showType\":\"TABLE\",\"localParams\":[],\"connParams\":\"\",\"preStatements\":[],\"postStatements\":[]},\"preTasks\":[],\"extras\":null,\"depList\":[],\"dependence\":{},\"conditionResult\":{\"successNode\":[\"\"],\"failedNode\":[\"\"]},\"taskInstancePriority\":\"MEDIUM\",\"workerGroup\":\"default\",\"workerGroupId\":null,\"timeout\":{\"strategy\":\"\",\"interval\":null,\"enable\":false},\"conditionsTask\":false,\"forbidden\":false,\"taskTimeoutParameter\":{\"enable\":false,\"strategy\":null,\"interval\":0}}\",\n" + " \"processId\":0,\n" + " \"appIds\":null,\n" + " \"processInstanceId\":2,\n" + " \"scheduleTime\":null,\n" + " \"globalParams\":null,\n" + " \"executorId\":2,\n" + " \"cmdTypeIfComplement\":0,\n" + " \"tenantCode\":\"sysadmin\",\n" + " \"queue\":\"default\",\n" + " \"processDefineId\":17,\n" + " \"projectId\":2,\n" + " \"taskParams\":null,\n" + " \"envFile\":null,\n" + " \"definedParams\":null,\n" + " \"taskAppId\":null,\n" + " \"taskTimeoutStrategy\":0,\n" + " \"taskTimeout\":0,\n" + " \"workerGroup\":\"default\",\n" + " \"resources\":{\n" + "\n" + " },\n" + " \"sqlTaskExecutionContext\":{\n" + " \"warningGroupId\":0,\n" + " \"connectionParams\":\"{\"type\":null,\"address\":\"jdbc:mysql://127.0.0.1:3306\",\"database\":\"test\",\"jdbcUrl\":\"jdbc:mysql://127.0.0.1:3306/test\",\"user\":\"root\",\"password\":\"IUAjJCVeJipyb290\"}\",\n" + " \"udfFuncTenantCodeMap\":null\n" + " },\n" + " \"dataxTaskExecutionContext\":{\n" + " \"dataSourceId\":0,\n" + " \"sourcetype\":0,\n" + " \"sourceConnectionParams\":null,\n" + " \"dataTargetId\":0,\n" + " \"targetType\":0,\n" + " \"targetConnectionParams\":null\n" + " },\n" + " \"dependenceTaskExecutionContext\":null,\n" + " \"sqoopTaskExecutionContext\":{\n" + " \"dataSourceId\":0,\n" + " \"sourcetype\":0,\n" + " \"sourceConnectionParams\":null,\n" + " \"dataTargetId\":0,\n" + " \"targetType\":0,\n" + " \"targetConnectionParams\":null\n" + " },\n" + " \"procedureTaskExecutionContext\":{\n" + " \"connectionParams\":null\n" + " }\n" + "}" ; TaskExecutionContext taskExecutionContext = JSONUtils.parseObject(contextJson, TaskExecutionContext.class); assertTrue(taskExecutionContext != null); } } ``` error info : ``` Connected to the target VM, address: '127.0.0.1:53429', transport: 'socket' 19:43:31.405 [main] ERROR org.apache.dolphinscheduler.common.utils.JSONUtils - parse object exception! com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot find a (Map) Key deserializer for type [simple type, class org.apache.dolphinscheduler.dao.entity.UdfFunc] at [Source: (String)"{ "taskInstanceId":2, "taskName":"SQL-QUERY", "startTime":"2020-07-18 19:18:58", "taskType":"SQL", "host":null, "executePath":"/tmp/dolphinscheduler/exec/process/2/17/2/2", "logPath":null, "taskJson":"{"id":"tasks-5736","name":"SQL-QUERY","desc":null,"type":"SQL","runFlag":"NORMAL","loc":null,"maxRetryTimes":0,"retryInterval":1,"params":{"type":"MYSQL","datasource":3,"sql":"SELECT * FROM person","udfs":"","sqlType":"0","title":"SQL-QUERY","receivers":"zhangboyi_mx"[truncated 1787 chars]; line: 1, column: 1] at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:67) at com.fasterxml.jackson.databind.DeserializationContext.reportBadDefinition(DeserializationContext.java:1452) at com.fasterxml.jackson.databind.deser.DeserializerCache._handleUnknownKeyDeserializer(DeserializerCache.java:599) at com.fasterxml.jackson.databind.deser.DeserializerCache.findKeyDeserializer(DeserializerCache.java:168) at com.fasterxml.jackson.databind.DeserializationContext.findKeyDeserializer(DeserializationContext.java:500) at com.fasterxml.jackson.databind.deser.std.MapDeserializer.createContextual(MapDeserializer.java:248) at com.fasterxml.jackson.databind.DeserializationContext.handlePrimaryContextualization(DeserializationContext.java:651) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.resolve(BeanDeserializerBase.java:484) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:293) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:244) at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:142) at com.fasterxml.jackson.databind.DeserializationContext.findNonContextualValueDeserializer(DeserializationContext.java:467) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.resolve(BeanDeserializerBase.java:473) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:293) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:244) at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:142) at com.fasterxml.jackson.databind.DeserializationContext.findRootValueDeserializer(DeserializationContext.java:477) at com.fasterxml.jackson.databind.ObjectMapper._findRootDeserializer(ObjectMapper.java:4190) at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4009) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3004) at org.apache.dolphinscheduler.common.utils.JSONUtils.parseObject(JSONUtils.java:108) at org.apache.dolphinscheduler.server.worker.processor.TaskExecuteProcessorTest.testJson(TaskExecuteProcessorTest.java:71) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230) at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58) Disconnected from the target VM, address: '127.0.0.1:53429', transport: 'socket' java.lang.AssertionError at org.junit.Assert.fail(Assert.java:86) at org.junit.Assert.assertTrue(Assert.java:41) at org.junit.Assert.assertTrue(Assert.java:52) at org.apache.dolphinscheduler.server.worker.processor.TaskExecuteProcessorTest.testJson(TaskExecuteProcessorTest.java:73) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230) at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58) ```
https://github.com/apache/dolphinscheduler/issues/3240
https://github.com/apache/dolphinscheduler/pull/3245
252abbdaed4a120b0bc5c23da3e956e3d429a7a1
6f2667bf1aab2715cfd734a5a694d2b2fd0adcc9
2020-07-18T11:39:43Z
java
2020-07-21T10:54:07Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/entity/SQLTaskExecutionContext.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.dolphinscheduler.server.entity; import org.apache.dolphinscheduler.dao.entity.UdfFunc; import java.io.Serializable; import java.util.Map; /** * SQL Task ExecutionContext */ public class SQLTaskExecutionContext implements Serializable {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,240
[Bug][worker] Cannot find a (Map) Key deserializer for type
When I execute SQL query task, JSON parsing error error info : ```` com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot find a (Map) Key deserializer for type [simple type, class org.apache.dolphinscheduler.dao.entity.UdfFunc] ````` ![image](https://user-images.githubusercontent.com/39816903/87851699-ecb1ad80-c92d-11ea-8c3d-820f38f5d68d.png) show code : TaskExecutionContext taskExecutionContext = JSONUtils.parseObject(contextJson, TaskExecutionContext.class); ![image](https://user-images.githubusercontent.com/39816903/87851753-69448c00-c92e-11ea-94e0-36b45135e533.png) contextJson: ``` { "taskInstanceId":2, "taskName":"SQL-QUERY", "startTime":"2020-07-18 19:18:58", "taskType":"SQL", "host":null, "executePath":"/tmp/dolphinscheduler/exec/process/2/17/2/2", "logPath":null, "taskJson":"{"id":"tasks-5736","name":"SQL-QUERY","desc":null,"type":"SQL","runFlag":"NORMAL","loc":null,"maxRetryTimes":0,"retryInterval":1,"params":{"type":"MYSQL","datasource":3,"sql":"SELECT * FROM person","udfs":"","sqlType":"0","title":"SQL-QUERY","receivers":"[email protected]","receiversCc":"","showType":"TABLE","localParams":[],"connParams":"","preStatements":[],"postStatements":[]},"preTasks":[],"extras":null,"depList":[],"dependence":{},"conditionResult":{"successNode":[""],"failedNode":[""]},"taskInstancePriority":"MEDIUM","workerGroup":"default","workerGroupId":null,"timeout":{"strategy":"","interval":null,"enable":false},"conditionsTask":false,"forbidden":false,"taskTimeoutParameter":{"enable":false,"strategy":null,"interval":0}}", "processId":0, "appIds":null, "processInstanceId":2, "scheduleTime":null, "globalParams":null, "executorId":2, "cmdTypeIfComplement":0, "tenantCode":"sysadmin", "queue":"default", "processDefineId":17, "projectId":2, "taskParams":null, "envFile":null, "definedParams":null, "taskAppId":null, "taskTimeoutStrategy":0, "taskTimeout":0, "workerGroup":"default", "resources":{ }, "sqlTaskExecutionContext":{ "warningGroupId":0, "connectionParams":"{"type":null,"address":"jdbc:mysql://127.0.0.1:3306","database":"test","jdbcUrl":"jdbc:mysql://127.0.0.1:3306/test","user":"root","password":"IUAjJCVeJipyb290"}", "udfFuncTenantCodeMap":null }, "dataxTaskExecutionContext":{ "dataSourceId":0, "sourcetype":0, "sourceConnectionParams":null, "dataTargetId":0, "targetType":0, "targetConnectionParams":null }, "dependenceTaskExecutionContext":null, "sqoopTaskExecutionContext":{ "dataSourceId":0, "sourcetype":0, "sourceConnectionParams":null, "dataTargetId":0, "targetType":0, "targetConnectionParams":null }, "procedureTaskExecutionContext":{ "connectionParams":null } } ``` test unit : ``` public class TaskExecuteProcessorTest { @Test public void testJson(){ String contextJson = "{\n" + " \"taskInstanceId\":2,\n" + " \"taskName\":\"SQL-QUERY\",\n" + " \"startTime\":\"2020-07-18 19:18:58\",\n" + " \"taskType\":\"SQL\",\n" + " \"host\":null,\n" + " \"executePath\":\"/tmp/dolphinscheduler/exec/process/2/17/2/2\",\n" + " \"logPath\":null,\n" + " \"taskJson\":\"{\"id\":\"tasks-5736\",\"name\":\"SQL-QUERY\",\"desc\":null,\"type\":\"SQL\",\"runFlag\":\"NORMAL\",\"loc\":null,\"maxRetryTimes\":0,\"retryInterval\":1,\"params\":{\"type\":\"MYSQL\",\"datasource\":3,\"sql\":\"SELECT * FROM person\",\"udfs\":\"\",\"sqlType\":\"0\",\"title\":\"SQL-QUERY\",\"receivers\":\"[email protected]\",\"receiversCc\":\"\",\"showType\":\"TABLE\",\"localParams\":[],\"connParams\":\"\",\"preStatements\":[],\"postStatements\":[]},\"preTasks\":[],\"extras\":null,\"depList\":[],\"dependence\":{},\"conditionResult\":{\"successNode\":[\"\"],\"failedNode\":[\"\"]},\"taskInstancePriority\":\"MEDIUM\",\"workerGroup\":\"default\",\"workerGroupId\":null,\"timeout\":{\"strategy\":\"\",\"interval\":null,\"enable\":false},\"conditionsTask\":false,\"forbidden\":false,\"taskTimeoutParameter\":{\"enable\":false,\"strategy\":null,\"interval\":0}}\",\n" + " \"processId\":0,\n" + " \"appIds\":null,\n" + " \"processInstanceId\":2,\n" + " \"scheduleTime\":null,\n" + " \"globalParams\":null,\n" + " \"executorId\":2,\n" + " \"cmdTypeIfComplement\":0,\n" + " \"tenantCode\":\"sysadmin\",\n" + " \"queue\":\"default\",\n" + " \"processDefineId\":17,\n" + " \"projectId\":2,\n" + " \"taskParams\":null,\n" + " \"envFile\":null,\n" + " \"definedParams\":null,\n" + " \"taskAppId\":null,\n" + " \"taskTimeoutStrategy\":0,\n" + " \"taskTimeout\":0,\n" + " \"workerGroup\":\"default\",\n" + " \"resources\":{\n" + "\n" + " },\n" + " \"sqlTaskExecutionContext\":{\n" + " \"warningGroupId\":0,\n" + " \"connectionParams\":\"{\"type\":null,\"address\":\"jdbc:mysql://127.0.0.1:3306\",\"database\":\"test\",\"jdbcUrl\":\"jdbc:mysql://127.0.0.1:3306/test\",\"user\":\"root\",\"password\":\"IUAjJCVeJipyb290\"}\",\n" + " \"udfFuncTenantCodeMap\":null\n" + " },\n" + " \"dataxTaskExecutionContext\":{\n" + " \"dataSourceId\":0,\n" + " \"sourcetype\":0,\n" + " \"sourceConnectionParams\":null,\n" + " \"dataTargetId\":0,\n" + " \"targetType\":0,\n" + " \"targetConnectionParams\":null\n" + " },\n" + " \"dependenceTaskExecutionContext\":null,\n" + " \"sqoopTaskExecutionContext\":{\n" + " \"dataSourceId\":0,\n" + " \"sourcetype\":0,\n" + " \"sourceConnectionParams\":null,\n" + " \"dataTargetId\":0,\n" + " \"targetType\":0,\n" + " \"targetConnectionParams\":null\n" + " },\n" + " \"procedureTaskExecutionContext\":{\n" + " \"connectionParams\":null\n" + " }\n" + "}" ; TaskExecutionContext taskExecutionContext = JSONUtils.parseObject(contextJson, TaskExecutionContext.class); assertTrue(taskExecutionContext != null); } } ``` error info : ``` Connected to the target VM, address: '127.0.0.1:53429', transport: 'socket' 19:43:31.405 [main] ERROR org.apache.dolphinscheduler.common.utils.JSONUtils - parse object exception! com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot find a (Map) Key deserializer for type [simple type, class org.apache.dolphinscheduler.dao.entity.UdfFunc] at [Source: (String)"{ "taskInstanceId":2, "taskName":"SQL-QUERY", "startTime":"2020-07-18 19:18:58", "taskType":"SQL", "host":null, "executePath":"/tmp/dolphinscheduler/exec/process/2/17/2/2", "logPath":null, "taskJson":"{"id":"tasks-5736","name":"SQL-QUERY","desc":null,"type":"SQL","runFlag":"NORMAL","loc":null,"maxRetryTimes":0,"retryInterval":1,"params":{"type":"MYSQL","datasource":3,"sql":"SELECT * FROM person","udfs":"","sqlType":"0","title":"SQL-QUERY","receivers":"zhangboyi_mx"[truncated 1787 chars]; line: 1, column: 1] at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:67) at com.fasterxml.jackson.databind.DeserializationContext.reportBadDefinition(DeserializationContext.java:1452) at com.fasterxml.jackson.databind.deser.DeserializerCache._handleUnknownKeyDeserializer(DeserializerCache.java:599) at com.fasterxml.jackson.databind.deser.DeserializerCache.findKeyDeserializer(DeserializerCache.java:168) at com.fasterxml.jackson.databind.DeserializationContext.findKeyDeserializer(DeserializationContext.java:500) at com.fasterxml.jackson.databind.deser.std.MapDeserializer.createContextual(MapDeserializer.java:248) at com.fasterxml.jackson.databind.DeserializationContext.handlePrimaryContextualization(DeserializationContext.java:651) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.resolve(BeanDeserializerBase.java:484) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:293) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:244) at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:142) at com.fasterxml.jackson.databind.DeserializationContext.findNonContextualValueDeserializer(DeserializationContext.java:467) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.resolve(BeanDeserializerBase.java:473) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:293) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:244) at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:142) at com.fasterxml.jackson.databind.DeserializationContext.findRootValueDeserializer(DeserializationContext.java:477) at com.fasterxml.jackson.databind.ObjectMapper._findRootDeserializer(ObjectMapper.java:4190) at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4009) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3004) at org.apache.dolphinscheduler.common.utils.JSONUtils.parseObject(JSONUtils.java:108) at org.apache.dolphinscheduler.server.worker.processor.TaskExecuteProcessorTest.testJson(TaskExecuteProcessorTest.java:71) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230) at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58) Disconnected from the target VM, address: '127.0.0.1:53429', transport: 'socket' java.lang.AssertionError at org.junit.Assert.fail(Assert.java:86) at org.junit.Assert.assertTrue(Assert.java:41) at org.junit.Assert.assertTrue(Assert.java:52) at org.apache.dolphinscheduler.server.worker.processor.TaskExecuteProcessorTest.testJson(TaskExecuteProcessorTest.java:73) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230) at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58) ```
https://github.com/apache/dolphinscheduler/issues/3240
https://github.com/apache/dolphinscheduler/pull/3245
252abbdaed4a120b0bc5c23da3e956e3d429a7a1
6f2667bf1aab2715cfd734a5a694d2b2fd0adcc9
2020-07-18T11:39:43Z
java
2020-07-21T10:54:07Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/entity/SQLTaskExecutionContext.java
/** * warningGroupId */ private int warningGroupId; /** * connectionParams */ private String connectionParams; /** * udf function tenant code map
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,240
[Bug][worker] Cannot find a (Map) Key deserializer for type
When I execute SQL query task, JSON parsing error error info : ```` com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot find a (Map) Key deserializer for type [simple type, class org.apache.dolphinscheduler.dao.entity.UdfFunc] ````` ![image](https://user-images.githubusercontent.com/39816903/87851699-ecb1ad80-c92d-11ea-8c3d-820f38f5d68d.png) show code : TaskExecutionContext taskExecutionContext = JSONUtils.parseObject(contextJson, TaskExecutionContext.class); ![image](https://user-images.githubusercontent.com/39816903/87851753-69448c00-c92e-11ea-94e0-36b45135e533.png) contextJson: ``` { "taskInstanceId":2, "taskName":"SQL-QUERY", "startTime":"2020-07-18 19:18:58", "taskType":"SQL", "host":null, "executePath":"/tmp/dolphinscheduler/exec/process/2/17/2/2", "logPath":null, "taskJson":"{"id":"tasks-5736","name":"SQL-QUERY","desc":null,"type":"SQL","runFlag":"NORMAL","loc":null,"maxRetryTimes":0,"retryInterval":1,"params":{"type":"MYSQL","datasource":3,"sql":"SELECT * FROM person","udfs":"","sqlType":"0","title":"SQL-QUERY","receivers":"[email protected]","receiversCc":"","showType":"TABLE","localParams":[],"connParams":"","preStatements":[],"postStatements":[]},"preTasks":[],"extras":null,"depList":[],"dependence":{},"conditionResult":{"successNode":[""],"failedNode":[""]},"taskInstancePriority":"MEDIUM","workerGroup":"default","workerGroupId":null,"timeout":{"strategy":"","interval":null,"enable":false},"conditionsTask":false,"forbidden":false,"taskTimeoutParameter":{"enable":false,"strategy":null,"interval":0}}", "processId":0, "appIds":null, "processInstanceId":2, "scheduleTime":null, "globalParams":null, "executorId":2, "cmdTypeIfComplement":0, "tenantCode":"sysadmin", "queue":"default", "processDefineId":17, "projectId":2, "taskParams":null, "envFile":null, "definedParams":null, "taskAppId":null, "taskTimeoutStrategy":0, "taskTimeout":0, "workerGroup":"default", "resources":{ }, "sqlTaskExecutionContext":{ "warningGroupId":0, "connectionParams":"{"type":null,"address":"jdbc:mysql://127.0.0.1:3306","database":"test","jdbcUrl":"jdbc:mysql://127.0.0.1:3306/test","user":"root","password":"IUAjJCVeJipyb290"}", "udfFuncTenantCodeMap":null }, "dataxTaskExecutionContext":{ "dataSourceId":0, "sourcetype":0, "sourceConnectionParams":null, "dataTargetId":0, "targetType":0, "targetConnectionParams":null }, "dependenceTaskExecutionContext":null, "sqoopTaskExecutionContext":{ "dataSourceId":0, "sourcetype":0, "sourceConnectionParams":null, "dataTargetId":0, "targetType":0, "targetConnectionParams":null }, "procedureTaskExecutionContext":{ "connectionParams":null } } ``` test unit : ``` public class TaskExecuteProcessorTest { @Test public void testJson(){ String contextJson = "{\n" + " \"taskInstanceId\":2,\n" + " \"taskName\":\"SQL-QUERY\",\n" + " \"startTime\":\"2020-07-18 19:18:58\",\n" + " \"taskType\":\"SQL\",\n" + " \"host\":null,\n" + " \"executePath\":\"/tmp/dolphinscheduler/exec/process/2/17/2/2\",\n" + " \"logPath\":null,\n" + " \"taskJson\":\"{\"id\":\"tasks-5736\",\"name\":\"SQL-QUERY\",\"desc\":null,\"type\":\"SQL\",\"runFlag\":\"NORMAL\",\"loc\":null,\"maxRetryTimes\":0,\"retryInterval\":1,\"params\":{\"type\":\"MYSQL\",\"datasource\":3,\"sql\":\"SELECT * FROM person\",\"udfs\":\"\",\"sqlType\":\"0\",\"title\":\"SQL-QUERY\",\"receivers\":\"[email protected]\",\"receiversCc\":\"\",\"showType\":\"TABLE\",\"localParams\":[],\"connParams\":\"\",\"preStatements\":[],\"postStatements\":[]},\"preTasks\":[],\"extras\":null,\"depList\":[],\"dependence\":{},\"conditionResult\":{\"successNode\":[\"\"],\"failedNode\":[\"\"]},\"taskInstancePriority\":\"MEDIUM\",\"workerGroup\":\"default\",\"workerGroupId\":null,\"timeout\":{\"strategy\":\"\",\"interval\":null,\"enable\":false},\"conditionsTask\":false,\"forbidden\":false,\"taskTimeoutParameter\":{\"enable\":false,\"strategy\":null,\"interval\":0}}\",\n" + " \"processId\":0,\n" + " \"appIds\":null,\n" + " \"processInstanceId\":2,\n" + " \"scheduleTime\":null,\n" + " \"globalParams\":null,\n" + " \"executorId\":2,\n" + " \"cmdTypeIfComplement\":0,\n" + " \"tenantCode\":\"sysadmin\",\n" + " \"queue\":\"default\",\n" + " \"processDefineId\":17,\n" + " \"projectId\":2,\n" + " \"taskParams\":null,\n" + " \"envFile\":null,\n" + " \"definedParams\":null,\n" + " \"taskAppId\":null,\n" + " \"taskTimeoutStrategy\":0,\n" + " \"taskTimeout\":0,\n" + " \"workerGroup\":\"default\",\n" + " \"resources\":{\n" + "\n" + " },\n" + " \"sqlTaskExecutionContext\":{\n" + " \"warningGroupId\":0,\n" + " \"connectionParams\":\"{\"type\":null,\"address\":\"jdbc:mysql://127.0.0.1:3306\",\"database\":\"test\",\"jdbcUrl\":\"jdbc:mysql://127.0.0.1:3306/test\",\"user\":\"root\",\"password\":\"IUAjJCVeJipyb290\"}\",\n" + " \"udfFuncTenantCodeMap\":null\n" + " },\n" + " \"dataxTaskExecutionContext\":{\n" + " \"dataSourceId\":0,\n" + " \"sourcetype\":0,\n" + " \"sourceConnectionParams\":null,\n" + " \"dataTargetId\":0,\n" + " \"targetType\":0,\n" + " \"targetConnectionParams\":null\n" + " },\n" + " \"dependenceTaskExecutionContext\":null,\n" + " \"sqoopTaskExecutionContext\":{\n" + " \"dataSourceId\":0,\n" + " \"sourcetype\":0,\n" + " \"sourceConnectionParams\":null,\n" + " \"dataTargetId\":0,\n" + " \"targetType\":0,\n" + " \"targetConnectionParams\":null\n" + " },\n" + " \"procedureTaskExecutionContext\":{\n" + " \"connectionParams\":null\n" + " }\n" + "}" ; TaskExecutionContext taskExecutionContext = JSONUtils.parseObject(contextJson, TaskExecutionContext.class); assertTrue(taskExecutionContext != null); } } ``` error info : ``` Connected to the target VM, address: '127.0.0.1:53429', transport: 'socket' 19:43:31.405 [main] ERROR org.apache.dolphinscheduler.common.utils.JSONUtils - parse object exception! com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot find a (Map) Key deserializer for type [simple type, class org.apache.dolphinscheduler.dao.entity.UdfFunc] at [Source: (String)"{ "taskInstanceId":2, "taskName":"SQL-QUERY", "startTime":"2020-07-18 19:18:58", "taskType":"SQL", "host":null, "executePath":"/tmp/dolphinscheduler/exec/process/2/17/2/2", "logPath":null, "taskJson":"{"id":"tasks-5736","name":"SQL-QUERY","desc":null,"type":"SQL","runFlag":"NORMAL","loc":null,"maxRetryTimes":0,"retryInterval":1,"params":{"type":"MYSQL","datasource":3,"sql":"SELECT * FROM person","udfs":"","sqlType":"0","title":"SQL-QUERY","receivers":"zhangboyi_mx"[truncated 1787 chars]; line: 1, column: 1] at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:67) at com.fasterxml.jackson.databind.DeserializationContext.reportBadDefinition(DeserializationContext.java:1452) at com.fasterxml.jackson.databind.deser.DeserializerCache._handleUnknownKeyDeserializer(DeserializerCache.java:599) at com.fasterxml.jackson.databind.deser.DeserializerCache.findKeyDeserializer(DeserializerCache.java:168) at com.fasterxml.jackson.databind.DeserializationContext.findKeyDeserializer(DeserializationContext.java:500) at com.fasterxml.jackson.databind.deser.std.MapDeserializer.createContextual(MapDeserializer.java:248) at com.fasterxml.jackson.databind.DeserializationContext.handlePrimaryContextualization(DeserializationContext.java:651) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.resolve(BeanDeserializerBase.java:484) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:293) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:244) at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:142) at com.fasterxml.jackson.databind.DeserializationContext.findNonContextualValueDeserializer(DeserializationContext.java:467) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.resolve(BeanDeserializerBase.java:473) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:293) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:244) at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:142) at com.fasterxml.jackson.databind.DeserializationContext.findRootValueDeserializer(DeserializationContext.java:477) at com.fasterxml.jackson.databind.ObjectMapper._findRootDeserializer(ObjectMapper.java:4190) at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4009) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3004) at org.apache.dolphinscheduler.common.utils.JSONUtils.parseObject(JSONUtils.java:108) at org.apache.dolphinscheduler.server.worker.processor.TaskExecuteProcessorTest.testJson(TaskExecuteProcessorTest.java:71) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230) at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58) Disconnected from the target VM, address: '127.0.0.1:53429', transport: 'socket' java.lang.AssertionError at org.junit.Assert.fail(Assert.java:86) at org.junit.Assert.assertTrue(Assert.java:41) at org.junit.Assert.assertTrue(Assert.java:52) at org.apache.dolphinscheduler.server.worker.processor.TaskExecuteProcessorTest.testJson(TaskExecuteProcessorTest.java:73) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230) at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58) ```
https://github.com/apache/dolphinscheduler/issues/3240
https://github.com/apache/dolphinscheduler/pull/3245
252abbdaed4a120b0bc5c23da3e956e3d429a7a1
6f2667bf1aab2715cfd734a5a694d2b2fd0adcc9
2020-07-18T11:39:43Z
java
2020-07-21T10:54:07Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/entity/SQLTaskExecutionContext.java
*/ private Map<UdfFunc,String> udfFuncTenantCodeMap; public int getWarningGroupId() { return warningGroupId; } public void setWarningGroupId(int warningGroupId) { this.warningGroupId = warningGroupId; } public Map<UdfFunc, String> getUdfFuncTenantCodeMap() { return udfFuncTenantCodeMap; } public void setUdfFuncTenantCodeMap(Map<UdfFunc, String> udfFuncTenantCodeMap) { this.udfFuncTenantCodeMap = udfFuncTenantCodeMap; } public String getConnectionParams() { return connectionParams; } public void setConnectionParams(String connectionParams) { this.connectionParams = connectionParams; } @Override public String toString() { return "SQLTaskExecutionContext{" + "warningGroupId=" + warningGroupId + ", connectionParams='" + connectionParams + '\'' + ", udfFuncTenantCodeMap=" + udfFuncTenantCodeMap + '}'; } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
1,336
[BUG] [api]Dependent execution fails after task performs serial complement
**To Reproduce** 1. A task depends on B task, the deviation range is the first 3 days 2. The serial complement of 3 days before the B task execution 3. Run workflow, dependent execution fails ![image](https://user-images.githubusercontent.com/55787491/69607569-74297400-1060-11ea-9d15-8175e79056ff.png) **Which version of Dolphin Scheduler:** -[1.2.0]
https://github.com/apache/dolphinscheduler/issues/1336
https://github.com/apache/dolphinscheduler/pull/3331
624f0aeab9621abbbc9584c4a3167cb1bd2dcf00
5f725aa28b2edbd246480a554ac7822bf07fbbfd
2019-11-26T07:23:55Z
java
2020-07-29T07:37:49Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
/* * Licnsd o h Apach Sofwar Foundaion (ASF) undr on or mor * conribuor licns agrmns. S h NOTICE fil disribud wih * his work for addiional informaion rgarding copyrigh ownrship. * Th ASF licnss his fil o You undr h Apach Licns, Vrsion 2.0 * (h "Licns"); you may no us his fil xcp in complianc wih * h Licns. You may obain a copy of h Licns a * * hp://www.apach.org/licnss/LICENSE-2.0 * * Unlss rquird by applicabl law or agrd o in wriing, sofwar * disribud undr h Licns is disribud on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, ihr xprss or implid. * S h Licns for h spcific languag govrning prmissions and * limiaions undr h Licns. */ packag org.apach.dolphinschdulr.srvr.masr.runnr; impor com.googl.common.collc.Liss; impor org.apach.commons.io.FilUils; impor org.apach.dolphinschdulr.common.Consans; impor org.apach.dolphinschdulr.common.nums.*;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
1,336
[BUG] [api]Dependent execution fails after task performs serial complement
**To Reproduce** 1. A task depends on B task, the deviation range is the first 3 days 2. The serial complement of 3 days before the B task execution 3. Run workflow, dependent execution fails ![image](https://user-images.githubusercontent.com/55787491/69607569-74297400-1060-11ea-9d15-8175e79056ff.png) **Which version of Dolphin Scheduler:** -[1.2.0]
https://github.com/apache/dolphinscheduler/issues/1336
https://github.com/apache/dolphinscheduler/pull/3331
624f0aeab9621abbbc9584c4a3167cb1bd2dcf00
5f725aa28b2edbd246480a554ac7822bf07fbbfd
2019-11-26T07:23:55Z
java
2020-07-29T07:37:49Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
impor org.apach.dolphinschdulr.common.graph.DAG; impor org.apach.dolphinschdulr.common.modl.TaskNod; impor org.apach.dolphinschdulr.common.modl.TaskNodRlaion; impor org.apach.dolphinschdulr.common.procss.ProcssDag; impor org.apach.dolphinschdulr.common.ask.condiions.CondiionsParamrs; impor org.apach.dolphinschdulr.common.hrad.Soppr; impor org.apach.dolphinschdulr.common.hrad.ThradUils; impor org.apach.dolphinschdulr.common.uils.*; impor org.apach.dolphinschdulr.dao.niy.ProcssInsanc; impor org.apach.dolphinschdulr.dao.niy.Schdul; impor org.apach.dolphinschdulr.dao.niy.TaskInsanc; impor org.apach.dolphinschdulr.dao.uils.DagHlpr; impor org.apach.dolphinschdulr.rmo.NyRmoingClin; impor org.apach.dolphinschdulr.srvr.masr.config.MasrConfig; impor org.apach.dolphinschdulr.srvr.uils.AlrManagr; impor org.apach.dolphinschdulr.srvic.procss.ProcssSrvic; impor org.apach.dolphinschdulr.srvic.quarz.cron.CronUils; impor org.slf4j.Loggr; impor org.slf4j.LoggrFacory; impor java.io.Fil; impor java.io.IOExcpion; impor java.uil.*; impor java.uil.concurrn.ConcurrnHashMap; impor java.uil.concurrn.ExcuorSrvic; impor java.uil.concurrn.Fuur; impor saic org.apach.dolphinschdulr.common.Consans.*; /** * masr xc hrad,spli dag */ public class MasrExcThrad implmns Runnabl {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
1,336
[BUG] [api]Dependent execution fails after task performs serial complement
**To Reproduce** 1. A task depends on B task, the deviation range is the first 3 days 2. The serial complement of 3 days before the B task execution 3. Run workflow, dependent execution fails ![image](https://user-images.githubusercontent.com/55787491/69607569-74297400-1060-11ea-9d15-8175e79056ff.png) **Which version of Dolphin Scheduler:** -[1.2.0]
https://github.com/apache/dolphinscheduler/issues/1336
https://github.com/apache/dolphinscheduler/pull/3331
624f0aeab9621abbbc9584c4a3167cb1bd2dcf00
5f725aa28b2edbd246480a554ac7822bf07fbbfd
2019-11-26T07:23:55Z
java
2020-07-29T07:37:49Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
/** * loggr of MasrExcThrad */ priva saic final Loggr loggr = LoggrFacory.gLoggr(MasrExcThrad.class); /** * procss insanc */ priva ProcssInsanc procssInsanc; /** * runing TaskNod */ priva final Map<MasrBasTaskExcThrad,Fuur<Boolan>> acivTaskNod = nw ConcurrnHashMap<>(); /** * ask xc srvic */ priva final ExcuorSrvic askExcSrvic; /** * submi failur nods */ priva boolan askFaildSubmi = fals; /** * rcovr nod id lis
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
1,336
[BUG] [api]Dependent execution fails after task performs serial complement
**To Reproduce** 1. A task depends on B task, the deviation range is the first 3 days 2. The serial complement of 3 days before the B task execution 3. Run workflow, dependent execution fails ![image](https://user-images.githubusercontent.com/55787491/69607569-74297400-1060-11ea-9d15-8175e79056ff.png) **Which version of Dolphin Scheduler:** -[1.2.0]
https://github.com/apache/dolphinscheduler/issues/1336
https://github.com/apache/dolphinscheduler/pull/3331
624f0aeab9621abbbc9584c4a3167cb1bd2dcf00
5f725aa28b2edbd246480a554ac7822bf07fbbfd
2019-11-26T07:23:55Z
java
2020-07-29T07:37:49Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
*/ priva Lis<TaskInsanc> rcovrNodIdLis = nw ArrayLis<>(); /** * rror ask lis */ priva Map<Sring,TaskInsanc> rrorTaskLis = nw ConcurrnHashMap<>(); /** * compl ask lis */ priva Map<Sring, TaskInsanc> complTaskLis = nw ConcurrnHashMap<>(); /** * rady o submi ask lis */ priva Map<Sring, TaskInsanc> radyToSubmiTaskLis = nw ConcurrnHashMap<>(); /** * dpnd faild ask map */ priva Map<Sring, TaskInsanc> dpndFaildTask = nw ConcurrnHashMap<>(); /** * forbiddn ask map */ priva Map<Sring, TaskNod> forbiddnTaskLis = nw ConcurrnHashMap<>(); /** * skip ask map */ priva Map<Sring, TaskNod> skipTaskNodLis = nw ConcurrnHashMap<>(); /** * rcovr olranc faul ask lis */ priva Lis<TaskInsanc> rcovrTolrancFaulTaskLis = nw ArrayLis<>();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
1,336
[BUG] [api]Dependent execution fails after task performs serial complement
**To Reproduce** 1. A task depends on B task, the deviation range is the first 3 days 2. The serial complement of 3 days before the B task execution 3. Run workflow, dependent execution fails ![image](https://user-images.githubusercontent.com/55787491/69607569-74297400-1060-11ea-9d15-8175e79056ff.png) **Which version of Dolphin Scheduler:** -[1.2.0]
https://github.com/apache/dolphinscheduler/issues/1336
https://github.com/apache/dolphinscheduler/pull/3331
624f0aeab9621abbbc9584c4a3167cb1bd2dcf00
5f725aa28b2edbd246480a554ac7822bf07fbbfd
2019-11-26T07:23:55Z
java
2020-07-29T07:37:49Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
/** * alr managr */ priva AlrManagr alrManagr; /** * h objc of DAG */ priva DAG<Sring, TaskNod, TaskNodRlaion> dag; /** * procss srvic */ priva ProcssSrvic procssSrvic; /** * masr config */ priva MasrConfig masrConfig; /** * */ priva NyRmoingClin nyRmoingClin; /** * consrucor of MasrExcThrad * @param procssInsanc procssInsanc * @param procssSrvic procssSrvic * @param nyRmoingClin nyRmoingClin */ public MasrExcThrad(ProcssInsanc procssInsanc , ProcssSrvic procssSrvic , NyRmoingClin nyRmoingClin , AlrManagr alrManagr
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
1,336
[BUG] [api]Dependent execution fails after task performs serial complement
**To Reproduce** 1. A task depends on B task, the deviation range is the first 3 days 2. The serial complement of 3 days before the B task execution 3. Run workflow, dependent execution fails ![image](https://user-images.githubusercontent.com/55787491/69607569-74297400-1060-11ea-9d15-8175e79056ff.png) **Which version of Dolphin Scheduler:** -[1.2.0]
https://github.com/apache/dolphinscheduler/issues/1336
https://github.com/apache/dolphinscheduler/pull/3331
624f0aeab9621abbbc9584c4a3167cb1bd2dcf00
5f725aa28b2edbd246480a554ac7822bf07fbbfd
2019-11-26T07:23:55Z
java
2020-07-29T07:37:49Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
, MasrConfig masrConfig) { his.procssSrvic = procssSrvic; his.procssInsanc = procssInsanc; his.masrConfig = masrConfig; in masrTaskExcNum = masrConfig.gMasrExcTaskNum(); his.askExcSrvic = ThradUils.nwDamonFixdThradExcuor("Masr-Task-Exc-Thrad", masrTaskExcNum); his.nyRmoingClin = nyRmoingClin; his.alrManagr = alrManagr; } @Ovrrid public void run() { if (procssInsanc == null){ loggr.info("procss insanc is no xiss"); rurn; } if (procssInsanc.gSa().ypIsFinishd()){ loggr.info("procss insanc is don : {}",procssInsanc.gId()); rurn; } ry { if (procssInsanc.isComplmnDaa() && Flag.NO == procssInsanc.gIsSubProcss()){ xcuComplmnProcss(); }ls{ xcuProcss(); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
1,336
[BUG] [api]Dependent execution fails after task performs serial complement
**To Reproduce** 1. A task depends on B task, the deviation range is the first 3 days 2. The serial complement of 3 days before the B task execution 3. Run workflow, dependent execution fails ![image](https://user-images.githubusercontent.com/55787491/69607569-74297400-1060-11ea-9d15-8175e79056ff.png) **Which version of Dolphin Scheduler:** -[1.2.0]
https://github.com/apache/dolphinscheduler/issues/1336
https://github.com/apache/dolphinscheduler/pull/3331
624f0aeab9621abbbc9584c4a3167cb1bd2dcf00
5f725aa28b2edbd246480a554ac7822bf07fbbfd
2019-11-26T07:23:55Z
java
2020-07-29T07:37:49Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
}cach (Excpion ){ loggr.rror("masr xc hrad xcpion", ); loggr.rror("procss xcu faild, procss id:{}", procssInsanc.gId()); procssInsanc.sSa(ExcuionSaus.FAILURE); procssInsanc.sEndTim(nw Da()); procssSrvic.updaProcssInsanc(procssInsanc); }finally { askExcSrvic.shudown(); posHandl(); } } /** * xcu procss * @hrows Excpion xcpion */ priva void xcuProcss() hrows Excpion { prparProcss(); runProcss(); ndProcss(); } /** * xcu complmn procss * @hrows Excpion xcpion */ priva void xcuComplmnProcss() hrows Excpion { Map<Sring, Sring> cmdParam = JSONUils.oMap(procssInsanc.gCommandParam()); Da sarDa = DaUils.gSchdulDa(cmdParam.g(CMDPARAM_COMPLEMENT_DATA_START_DATE)); Da ndDa = DaUils.gSchdulDa(cmdParam.g(CMDPARAM_COMPLEMENT_DATA_END_DATE)); procssSrvic.savProcssInsanc(procssInsanc);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
1,336
[BUG] [api]Dependent execution fails after task performs serial complement
**To Reproduce** 1. A task depends on B task, the deviation range is the first 3 days 2. The serial complement of 3 days before the B task execution 3. Run workflow, dependent execution fails ![image](https://user-images.githubusercontent.com/55787491/69607569-74297400-1060-11ea-9d15-8175e79056ff.png) **Which version of Dolphin Scheduler:** -[1.2.0]
https://github.com/apache/dolphinscheduler/issues/1336
https://github.com/apache/dolphinscheduler/pull/3331
624f0aeab9621abbbc9584c4a3167cb1bd2dcf00
5f725aa28b2edbd246480a554ac7822bf07fbbfd
2019-11-26T07:23:55Z
java
2020-07-29T07:37:49Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
in procssDfiniionId = procssInsanc.gProcssDfiniionId(); Lis<Schdul> schduls = procssSrvic.quryRlasSchdulrLisByProcssDfiniionId(procssDfiniionId); Lis<Da> lisDa = Liss.nwLinkdLis(); !CollcionUils.isEmpy(schduls)){ for (Schdul schdul : schduls) { lisDa.addAll(CronUils.gSlfFirDaLis(sarDa, ndDa, schdul.gCronab())); } } Iraor<Da> iraor = null; Da schdulDa = null; !CollcionUils.isEmpy(lisDa)) { iraor = lisDa.iraor(); schdulDa = iraor.nx(); procssInsanc.sSchdulTim(schdulDa); procssSrvic.updaProcssInsanc(procssInsanc); }ls{ schdulDa = procssInsanc.gSchdulTim(); schdulDa == null){ schdulDa = sarDa; } } whil(Soppr.isRunning()){ loggr.info("procss {} sar o complmn {} daa", procssInsanc.gId(), DaUils.daToSring(schdulDa)); prparProcss(); dag == null){ loggr.rror("procss {} dag is null, plas chck ou paramrs",
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
1,336
[BUG] [api]Dependent execution fails after task performs serial complement
**To Reproduce** 1. A task depends on B task, the deviation range is the first 3 days 2. The serial complement of 3 days before the B task execution 3. Run workflow, dependent execution fails ![image](https://user-images.githubusercontent.com/55787491/69607569-74297400-1060-11ea-9d15-8175e79056ff.png) **Which version of Dolphin Scheduler:** -[1.2.0]
https://github.com/apache/dolphinscheduler/issues/1336
https://github.com/apache/dolphinscheduler/pull/3331
624f0aeab9621abbbc9584c4a3167cb1bd2dcf00
5f725aa28b2edbd246480a554ac7822bf07fbbfd
2019-11-26T07:23:55Z
java
2020-07-29T07:37:49Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
procssInsanc.gId()); procssInsanc.sSa(ExcuionSaus.SUCCESS); procssSrvic.updaProcssInsanc(procssInsanc); rurn; } runProcss(); ndProcss(); !procssInsanc.gSa().ypIsSuccss()){ loggr.info("procss {} sa {}, complmn no complly!", procssInsanc.gId(), procssInsanc.gSa()); brak; } // null == iraor){ // schdulDa = DaUils.gSomDay(schdulDa, 1); schdulDa.afr(ndDa)){ // loggr.info("procss {} complmn complly!", procssInsanc.gId()); brak; } }ls{ // !iraor.hasNx()){ // loggr.info("procss {} complmn complly!", procssInsanc.gId()); brak; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
1,336
[BUG] [api]Dependent execution fails after task performs serial complement
**To Reproduce** 1. A task depends on B task, the deviation range is the first 3 days 2. The serial complement of 3 days before the B task execution 3. Run workflow, dependent execution fails ![image](https://user-images.githubusercontent.com/55787491/69607569-74297400-1060-11ea-9d15-8175e79056ff.png) **Which version of Dolphin Scheduler:** -[1.2.0]
https://github.com/apache/dolphinscheduler/issues/1336
https://github.com/apache/dolphinscheduler/pull/3331
624f0aeab9621abbbc9584c4a3167cb1bd2dcf00
5f725aa28b2edbd246480a554ac7822bf07fbbfd
2019-11-26T07:23:55Z
java
2020-07-29T07:37:49Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
schdulDa = iraor.nx(); } // flow nd // procssInsanc.sSchdulTim(schdulDa); cmdParam.conainsKy(Consans.CMDPARAM_RECOVERY_START_NODE_STRING)){ cmdParam.rmov(Consans.CMDPARAM_RECOVERY_START_NODE_STRING); procssInsanc.sCommandParam(JSONUils.oJsonSring(cmdParam)); } procssInsanc.sSa(ExcuionSaus.RUNNING_EXEUTION); procssInsanc.sGlobalParams(ParamrUils.curingGlobalParams( procssInsanc.gProcssDfiniion().gGlobalParamMap(), procssInsanc.gProcssDfiniion().gGlobalParamLis(), CommandTyp.COMPLEMENT_DATA, procssInsanc.gSchdulTim())); procssInsanc.sId(0); procssSrvic.savProcssInsanc(procssInsanc); } } /** * prpar procss paramr * @hrows Excpion xcpion */ priva void prparProcss() hrows Excpion { // iniTaskQuu(); // buildFlowDag(); loggr.info("prpar procss :{} nd", procssInsanc.gId()); } /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
1,336
[BUG] [api]Dependent execution fails after task performs serial complement
**To Reproduce** 1. A task depends on B task, the deviation range is the first 3 days 2. The serial complement of 3 days before the B task execution 3. Run workflow, dependent execution fails ![image](https://user-images.githubusercontent.com/55787491/69607569-74297400-1060-11ea-9d15-8175e79056ff.png) **Which version of Dolphin Scheduler:** -[1.2.0]
https://github.com/apache/dolphinscheduler/issues/1336
https://github.com/apache/dolphinscheduler/pull/3331
624f0aeab9621abbbc9584c4a3167cb1bd2dcf00
5f725aa28b2edbd246480a554ac7822bf07fbbfd
2019-11-26T07:23:55Z
java
2020-07-29T07:37:49Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
* procss nd handl */ priva void ndProcss() { procssInsanc.sEndTim(nw Da()); procssSrvic.updaProcssInsanc(procssInsanc); procssInsanc.gSa().ypIsWaiingThrad()){ procssSrvic.craRcovryWaiingThradCommand(null, procssInsanc); } Lis<TaskInsanc> askInsancs = procssSrvic.findValidTaskLisByProcssId(procssInsanc.gId()); alrManagr.sndAlrProcssInsanc(procssInsanc, askInsancs); } /** * * @hrows Excpion xcpion */ priva void buildFlowDag() hrows Excpion { rcovrNodIdLis = gSarTaskInsancLis(procssInsanc.gCommandParam()); forbiddnTaskLis = DagHlpr.gForbiddnTaskNodMaps(procssInsanc.gProcssInsancJson()); // Lis<Sring> rcovryNamLis = gRcovryNodNamLis(); Lis<Sring> sarNodNamLis = parsSarNodNam(procssInsanc.gCommandParam()); ProcssDag procssDag = gnraFlowDag(procssInsanc.gProcssInsancJson(), sarNodNamLis, rcovryNamLis, procssInsanc.gTaskDpndTyp()); procssDag == null){ loggr.rror("procssDag is null"); rurn; } // dag = DagHlpr.buildDagGraph(procssDag); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
1,336
[BUG] [api]Dependent execution fails after task performs serial complement
**To Reproduce** 1. A task depends on B task, the deviation range is the first 3 days 2. The serial complement of 3 days before the B task execution 3. Run workflow, dependent execution fails ![image](https://user-images.githubusercontent.com/55787491/69607569-74297400-1060-11ea-9d15-8175e79056ff.png) **Which version of Dolphin Scheduler:** -[1.2.0]
https://github.com/apache/dolphinscheduler/issues/1336
https://github.com/apache/dolphinscheduler/pull/3331
624f0aeab9621abbbc9584c4a3167cb1bd2dcf00
5f725aa28b2edbd246480a554ac7822bf07fbbfd
2019-11-26T07:23:55Z
java
2020-07-29T07:37:49Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
/** * */ priva void iniTaskQuu(){ askFaildSubmi = fals; acivTaskNod.clar(); dpndFaildTask.clar(); complTaskLis.clar(); rrorTaskLis.clar(); Lis<TaskInsanc> askInsancLis = procssSrvic.findValidTaskLisByProcssId(procssInsanc.gId()); for(TaskInsanc ask : askInsancLis){ ask.isTaskCompl()){ complTaskLis.pu(ask.gNam(), ask); } ask.gSa().ypIsFailur() && !ask.askCanRry()){ rrorTaskLis.pu(ask.gNam(), ask); } } } /** * procss pos handl */ priva void posHandl() { loggr.info("dvlop mod is: {}", CommonUils.isDvlopMod()); if (!CommonUils.isDvlopMod()) { // Sring xcLocalPah = org.apach.dolphinschdulr.common.uils.FilUils .gProcssExcDir(procssInsanc.gProcssDfiniion().gProjcId(), procssInsanc.gProcssDfiniionId(), procssInsanc.gId());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
1,336
[BUG] [api]Dependent execution fails after task performs serial complement
**To Reproduce** 1. A task depends on B task, the deviation range is the first 3 days 2. The serial complement of 3 days before the B task execution 3. Run workflow, dependent execution fails ![image](https://user-images.githubusercontent.com/55787491/69607569-74297400-1060-11ea-9d15-8175e79056ff.png) **Which version of Dolphin Scheduler:** -[1.2.0]
https://github.com/apache/dolphinscheduler/issues/1336
https://github.com/apache/dolphinscheduler/pull/3331
624f0aeab9621abbbc9584c4a3167cb1bd2dcf00
5f725aa28b2edbd246480a554ac7822bf07fbbfd
2019-11-26T07:23:55Z
java
2020-07-29T07:37:49Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
ry { FilUils.dlDircory(nw Fil(xcLocalPah)); } cach (IOExcpion ) { loggr.rror("dl xc dir faild ", ); } } } /** * submi ask o xcu * @param askInsanc ask insanc * @rurn TaskInsanc */ priva TaskInsanc submiTaskExc(TaskInsanc askInsanc) { MasrBasTaskExcThrad absracExcThrad = null; askInsanc.isSubProcss()){ absracExcThrad = nw SubProcssTaskExcThrad(askInsanc); }ls askInsanc.isDpndTask()){ absracExcThrad = nw DpndnTaskExcThrad(askInsanc); }ls askInsanc.isCondiionsTask()){ absracExcThrad = nw CondiionsTaskExcThrad(askInsanc); }ls { absracExcThrad = nw MasrTaskExcThrad(askInsanc); } Fuur<Boolan> fuur = askExcSrvic.submi(absracExcThrad); acivTaskNod.puIfAbsn(absracExcThrad, fuur); rurn absracExcThrad.gTaskInsanc(); } /** * find ask insanc in db. * in cas submi mor han on sam nam ask in h sam im.
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
1,336
[BUG] [api]Dependent execution fails after task performs serial complement
**To Reproduce** 1. A task depends on B task, the deviation range is the first 3 days 2. The serial complement of 3 days before the B task execution 3. Run workflow, dependent execution fails ![image](https://user-images.githubusercontent.com/55787491/69607569-74297400-1060-11ea-9d15-8175e79056ff.png) **Which version of Dolphin Scheduler:** -[1.2.0]
https://github.com/apache/dolphinscheduler/issues/1336
https://github.com/apache/dolphinscheduler/pull/3331
624f0aeab9621abbbc9584c4a3167cb1bd2dcf00
5f725aa28b2edbd246480a554ac7822bf07fbbfd
2019-11-26T07:23:55Z
java
2020-07-29T07:37:49Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
* @param askNam ask nam * @rurn TaskInsanc */ priva TaskInsanc findTaskIfExiss(Sring askNam){ Lis<TaskInsanc> askInsancLis = procssSrvic.findValidTaskLisByProcssId(his.procssInsanc.gId()); for(TaskInsanc askInsanc : askInsancLis){ askInsanc.gNam().quals(askNam)){ rurn askInsanc; } } rurn null; } /** * ncapsulaion ask * @param procssInsanc procss insanc * @param nodNam nod nam * @rurn TaskInsanc */ priva TaskInsanc craTaskInsanc(ProcssInsanc procssInsanc, Sring nodNam, TaskNod askNod) { TaskInsanc askInsanc = findTaskIfExiss(nodNam); askInsanc == null){ askInsanc = nw TaskInsanc(); // ask nam askInsanc.sNam(nodNam); // askInsanc.sProcssDfiniionId(procssInsanc.gProcssDfiniionId()); // askInsanc.sSa(ExcuionSaus.SUBMITTED_SUCCESS); //
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
1,336
[BUG] [api]Dependent execution fails after task performs serial complement
**To Reproduce** 1. A task depends on B task, the deviation range is the first 3 days 2. The serial complement of 3 days before the B task execution 3. Run workflow, dependent execution fails ![image](https://user-images.githubusercontent.com/55787491/69607569-74297400-1060-11ea-9d15-8175e79056ff.png) **Which version of Dolphin Scheduler:** -[1.2.0]
https://github.com/apache/dolphinscheduler/issues/1336
https://github.com/apache/dolphinscheduler/pull/3331
624f0aeab9621abbbc9584c4a3167cb1bd2dcf00
5f725aa28b2edbd246480a554ac7822bf07fbbfd
2019-11-26T07:23:55Z
java
2020-07-29T07:37:49Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
askInsanc.sProcssInsancId(procssInsanc.gId()); // askInsanc.sTaskJson(JSONUils.oJsonSring(askNod)); // askInsanc.sTaskTyp(askNod.gTyp()); // askInsanc.sAlrFlag(Flag.NO); // askInsanc.sSarTim(nw Da()); // askInsanc.sFlag(Flag.YES); // askInsanc.sRryTims(0); // askInsanc.sMaxRryTims(askNod.gMaxRryTims()); // askInsanc.sRryInrval(askNod.gRryInrval()); // askNod.gTaskInsancPrioriy() == null){ askInsanc.sTaskInsancPrioriy(Prioriy.MEDIUM); }ls{ askInsanc.sTaskInsancPrioriy(askNod.gTaskInsancPrioriy()); } Sring procssWorkrGroup = procssInsanc.gWorkrGroup(); procssWorkrGroup = SringUils.isBlank(procssWorkrGroup) ? DEFAULT_WORKER_GROUP : procssWorkrGroup; Sring askWorkrGroup = SringUils.isBlank(askNod.gWorkrGroup()) ? procssWorkrGroup : askNod.gWorkrGroup(); if (!procssWorkrGroup.quals(DEFAULT_WORKER_GROUP) && askWorkrGroup.quals(DEFAULT_WORKER_GROUP)) { askInsanc.sWorkrGroup(procssWorkrGroup); }ls { askInsanc.sWorkrGroup(askWorkrGroup);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
1,336
[BUG] [api]Dependent execution fails after task performs serial complement
**To Reproduce** 1. A task depends on B task, the deviation range is the first 3 days 2. The serial complement of 3 days before the B task execution 3. Run workflow, dependent execution fails ![image](https://user-images.githubusercontent.com/55787491/69607569-74297400-1060-11ea-9d15-8175e79056ff.png) **Which version of Dolphin Scheduler:** -[1.2.0]
https://github.com/apache/dolphinscheduler/issues/1336
https://github.com/apache/dolphinscheduler/pull/3331
624f0aeab9621abbbc9584c4a3167cb1bd2dcf00
5f725aa28b2edbd246480a554ac7822bf07fbbfd
2019-11-26T07:23:55Z
java
2020-07-29T07:37:49Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
} } rurn askInsanc; } /** * if all of h ask dpndnc ar skip, skip i oo. * @param askNod * @rurn */ priva boolan isTaskNodNdSkip(TaskNod askNod){ CollcionUils.isEmpy(askNod.gDpLis())){ rurn fals; } for(Sring dpNod : askNod.gDpLis()){ !skipTaskNodLis.conainsKy(dpNod)){ rurn fals; } } rurn ru; } /** * s ask nod skip if dpndnc all skip * @param askNodsSkipLis */ priva void sTaskNodSkip(Lis<Sring> askNodsSkipLis){ for(Sring skipNod : askNodsSkipLis){ skipTaskNodLis.puIfAbsn(skipNod, dag.gNod(skipNod)); Collcion<Sring> posNodLis = DagHlpr.gSarVrx(skipNod, dag, complTaskLis); Lis<Sring> posSkipLis = nw ArrayLis<>(); for(Sring pos : posNodLis){
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
1,336
[BUG] [api]Dependent execution fails after task performs serial complement
**To Reproduce** 1. A task depends on B task, the deviation range is the first 3 days 2. The serial complement of 3 days before the B task execution 3. Run workflow, dependent execution fails ![image](https://user-images.githubusercontent.com/55787491/69607569-74297400-1060-11ea-9d15-8175e79056ff.png) **Which version of Dolphin Scheduler:** -[1.2.0]
https://github.com/apache/dolphinscheduler/issues/1336
https://github.com/apache/dolphinscheduler/pull/3331
624f0aeab9621abbbc9584c4a3167cb1bd2dcf00
5f725aa28b2edbd246480a554ac7822bf07fbbfd
2019-11-26T07:23:55Z
java
2020-07-29T07:37:49Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
TaskNod posNod = dag.gNod(pos); isTaskNodNdSkip(posNod)){ posSkipLis.add(pos); } } sTaskNodSkip(posSkipLis); } } /** * pars condiion ask find h branch procss * s skip flag for anohr on. * @param nodNam * @rurn */ priva Lis<Sring> parsCondiionTask(Sring nodNam){ Lis<Sring> condiionTaskLis = nw ArrayLis<>(); TaskNod askNod = dag.gNod(nodNam); !askNod.isCondiionsTask()){ rurn condiionTaskLis; } CondiionsParamrs condiionsParamrs = JSONUils.parsObjc(askNod.gCondiionRsul(), CondiionsParamrs.class); TaskInsanc askInsanc = complTaskLis.g(nodNam); askInsanc == null){ loggr.rror("ask insanc {} canno find, plas chck i!", nodNam); rurn condiionTaskLis; } askInsanc.gSa().ypIsSuccss()){ condiionTaskLis = condiionsParamrs.gSuccssNod(); sTaskNodSkip(condiionsParamrs.gFaildNod());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
1,336
[BUG] [api]Dependent execution fails after task performs serial complement
**To Reproduce** 1. A task depends on B task, the deviation range is the first 3 days 2. The serial complement of 3 days before the B task execution 3. Run workflow, dependent execution fails ![image](https://user-images.githubusercontent.com/55787491/69607569-74297400-1060-11ea-9d15-8175e79056ff.png) **Which version of Dolphin Scheduler:** -[1.2.0]
https://github.com/apache/dolphinscheduler/issues/1336
https://github.com/apache/dolphinscheduler/pull/3331
624f0aeab9621abbbc9584c4a3167cb1bd2dcf00
5f725aa28b2edbd246480a554ac7822bf07fbbfd
2019-11-26T07:23:55Z
java
2020-07-29T07:37:49Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
}ls askInsanc.gSa().ypIsFailur()){ condiionTaskLis = condiionsParamrs.gFaildNod(); sTaskNodSkip(condiionsParamrs.gSuccssNod()); }ls{ condiionTaskLis.add(nodNam); } rurn condiionTaskLis; } /** * pars pos nod lis of prvious nod * if condiion nod: rurn procss according o h sings * if pos nod compld, rurn pos nods of h compld nod * @param prviousNodNam * @rurn */ priva Lis<Sring> parsPosNodLis(Sring prviousNodNam){ Lis<Sring> posNodLis = nw ArrayLis<>(); TaskNod askNod = dag.gNod(prviousNodNam); askNod != null && askNod.isCondiionsTask()){ rurn parsCondiionTask(prviousNodNam); } Collcion<Sring> posNodCollcion = DagHlpr.gSarVrx(prviousNodNam, dag, complTaskLis); Lis<Sring> posSkipLis = nw ArrayLis<>(); // // // // for(Sring posNod : posNodCollcion){ complTaskLis.conainsKy(posNod)){ TaskInsanc posTaskInsanc = complTaskLis.g(posNod);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
1,336
[BUG] [api]Dependent execution fails after task performs serial complement
**To Reproduce** 1. A task depends on B task, the deviation range is the first 3 days 2. The serial complement of 3 days before the B task execution 3. Run workflow, dependent execution fails ![image](https://user-images.githubusercontent.com/55787491/69607569-74297400-1060-11ea-9d15-8175e79056ff.png) **Which version of Dolphin Scheduler:** -[1.2.0]
https://github.com/apache/dolphinscheduler/issues/1336
https://github.com/apache/dolphinscheduler/pull/3331
624f0aeab9621abbbc9584c4a3167cb1bd2dcf00
5f725aa28b2edbd246480a554ac7822bf07fbbfd
2019-11-26T07:23:55Z
java
2020-07-29T07:37:49Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
dag.gNod(posNod).isCondiionsTask()){ Lis<Sring> condiionTaskNodLis = parsCondiionTask(posNod); for(Sring condiions : condiionTaskNodLis){ posNodLis.addAll(parsPosNodLis(condiions)); } }ls posTaskInsanc.gSa().ypIsSuccss()){ posNodLis.addAll(parsPosNodLis(posNod)); }ls{ posNodLis.add(posNod); } }ls isTaskNodNdSkip(dag.gNod(posNod))){ posSkipLis.add(posNod); sTaskNodSkip(posSkipLis); posSkipLis.clar(); }ls{ posNodLis.add(posNod); } } rurn posNodLis; } /** * submi pos nod * @param parnNodNam parn nod nam */ priva void submiPosNod(Sring parnNodNam){ Lis<Sring> submiTaskNodLis = parsPosNodLis(parnNodNam); Lis<TaskInsanc> askInsancs = nw ArrayLis<>(); for(Sring askNod : submiTaskNodLis){ askInsancs.add(craTaskInsanc(procssInsanc, askNod, dag.gNod(askNod)));
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
1,336
[BUG] [api]Dependent execution fails after task performs serial complement
**To Reproduce** 1. A task depends on B task, the deviation range is the first 3 days 2. The serial complement of 3 days before the B task execution 3. Run workflow, dependent execution fails ![image](https://user-images.githubusercontent.com/55787491/69607569-74297400-1060-11ea-9d15-8175e79056ff.png) **Which version of Dolphin Scheduler:** -[1.2.0]
https://github.com/apache/dolphinscheduler/issues/1336
https://github.com/apache/dolphinscheduler/pull/3331
624f0aeab9621abbbc9584c4a3167cb1bd2dcf00
5f725aa28b2edbd246480a554ac7822bf07fbbfd
2019-11-26T07:23:55Z
java
2020-07-29T07:37:49Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
} // for(TaskInsanc ask : askInsancs){ radyToSubmiTaskLis.conainsKy(ask.gNam())){ coninu; } complTaskLis.conainsKy(ask.gNam())){ loggr.info("ask {} has alrady run succss", ask.gNam()); coninu; } ask.gSa().ypIsPaus() || ask.gSa().ypIsCancl()){ loggr.info("ask {} soppd, h sa is {}", ask.gNam(), ask.gSa()); }ls{ addTaskToSandByLis(ask); } } } /** * drmin whhr h dpndncis of h ask nod ar compl * @rurn DpndRsul */ priva DpndRsul isTaskDpsCompl(Sring askNam) { Collcion<Sring> sarNods = dag.gBginNod(); // sarNods.conains(askNam)){ rurn DpndRsul.SUCCESS; } TaskNod askNod = dag.gNod(askNam); Lis<Sring> dpNamLis = askNod.gDpLis(); for(Sring dpsNod : dpNamLis ){
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
1,336
[BUG] [api]Dependent execution fails after task performs serial complement
**To Reproduce** 1. A task depends on B task, the deviation range is the first 3 days 2. The serial complement of 3 days before the B task execution 3. Run workflow, dependent execution fails ![image](https://user-images.githubusercontent.com/55787491/69607569-74297400-1060-11ea-9d15-8175e79056ff.png) **Which version of Dolphin Scheduler:** -[1.2.0]
https://github.com/apache/dolphinscheduler/issues/1336
https://github.com/apache/dolphinscheduler/pull/3331
624f0aeab9621abbbc9584c4a3167cb1bd2dcf00
5f725aa28b2edbd246480a554ac7822bf07fbbfd
2019-11-26T07:23:55Z
java
2020-07-29T07:37:49Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
!dag.conainsNod(dpsNod) || forbiddnTaskLis.conainsKy(dpsNod) || skipTaskNodLis.conainsKy(dpsNod)){ coninu; } // !complTaskLis.conainsKy(dpsNod)){ rurn DpndRsul.WAITING; } ExcuionSaus dpTaskSa = complTaskLis.g(dpsNod).gSa(); // dpTaskSa.ypIsFailur() && !DagHlpr.havCondiionsAfrNod(dpsNod, dag ) && !dag.gNod(dpsNod).isCondiionsTask()){ rurn DpndRsul.FAILED; } dpTaskSa.ypIsPaus() || dpTaskSa.ypIsCancl()){ rurn DpndRsul.WAITING; } } loggr.info("askNam: {} complDpndTaskLis: {}", askNam, Arrays.oSring(complTaskLis.kyS().oArray())); rurn DpndRsul.SUCCESS; } /** * qury ask insanc by compl sa * @param sa sa * @rurn ask insanc lis */ priva Lis<TaskInsanc> gComplTaskBySa(ExcuionSaus sa){ Lis<TaskInsanc> rsulLis = nw ArrayLis<>();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
1,336
[BUG] [api]Dependent execution fails after task performs serial complement
**To Reproduce** 1. A task depends on B task, the deviation range is the first 3 days 2. The serial complement of 3 days before the B task execution 3. Run workflow, dependent execution fails ![image](https://user-images.githubusercontent.com/55787491/69607569-74297400-1060-11ea-9d15-8175e79056ff.png) **Which version of Dolphin Scheduler:** -[1.2.0]
https://github.com/apache/dolphinscheduler/issues/1336
https://github.com/apache/dolphinscheduler/pull/3331
624f0aeab9621abbbc9584c4a3167cb1bd2dcf00
5f725aa28b2edbd246480a554ac7822bf07fbbfd
2019-11-26T07:23:55Z
java
2020-07-29T07:37:49Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
for (Map.Enry<Sring, TaskInsanc> nry: complTaskLis.nryS()) { nry.gValu().gSa() == sa){ rsulLis.add(nry.gValu()); } } rurn rsulLis; } /** * whr hr ar ongoing asks * @param sa sa * @rurn ExcuionSaus */ priva ExcuionSaus runningSa(ExcuionSaus sa){ sa == ExcuionSaus.READY_STOP || sa == ExcuionSaus.READY_PAUSE || sa == ExcuionSaus.WAITTING_THREAD){ // rurn sa; }ls{ rurn ExcuionSaus.RUNNING_EXEUTION; } } /** * xiss failur ask,conains submi failur、dpndncy failur,xcu failur(rry afr) * * @rurn Boolan whhr has faild ask */ priva boolan hasFaildTask(){ his.askFaildSubmi){ rurn ru;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
1,336
[BUG] [api]Dependent execution fails after task performs serial complement
**To Reproduce** 1. A task depends on B task, the deviation range is the first 3 days 2. The serial complement of 3 days before the B task execution 3. Run workflow, dependent execution fails ![image](https://user-images.githubusercontent.com/55787491/69607569-74297400-1060-11ea-9d15-8175e79056ff.png) **Which version of Dolphin Scheduler:** -[1.2.0]
https://github.com/apache/dolphinscheduler/issues/1336
https://github.com/apache/dolphinscheduler/pull/3331
624f0aeab9621abbbc9584c4a3167cb1bd2dcf00
5f725aa28b2edbd246480a554ac7822bf07fbbfd
2019-11-26T07:23:55Z
java
2020-07-29T07:37:49Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
} his.rrorTaskLis.siz() > 0){ rurn ru; } rurn his.dpndFaildTask.siz() > 0; } /** * procss insanc failur * * @rurn Boolan whhr procss insanc faild */ priva boolan procssFaild(){ hasFaildTask()) { procssInsanc.gFailurSragy() == FailurSragy.END){ rurn ru; } if (procssInsanc.gFailurSragy() == FailurSragy.CONTINUE) { rurn radyToSubmiTaskLis.siz() == 0 || acivTaskNod.siz() == 0; } } rurn fals; } /** * whhr ask for waiing hrad * @rurn Boolan whhr has waiing hrad ask */ priva boolan hasWaiingThradTask(){ Lis<TaskInsanc> waiingLis = gComplTaskBySa(ExcuionSaus.WAITTING_THREAD); rurn CollcionUils.isNoEmpy(waiingLis); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
1,336
[BUG] [api]Dependent execution fails after task performs serial complement
**To Reproduce** 1. A task depends on B task, the deviation range is the first 3 days 2. The serial complement of 3 days before the B task execution 3. Run workflow, dependent execution fails ![image](https://user-images.githubusercontent.com/55787491/69607569-74297400-1060-11ea-9d15-8175e79056ff.png) **Which version of Dolphin Scheduler:** -[1.2.0]
https://github.com/apache/dolphinscheduler/issues/1336
https://github.com/apache/dolphinscheduler/pull/3331
624f0aeab9621abbbc9584c4a3167cb1bd2dcf00
5f725aa28b2edbd246480a554ac7822bf07fbbfd
2019-11-26T07:23:55Z
java
2020-07-29T07:37:49Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
/** * prpar for paus * 1,faild rry ask in h prparaion quu , rurns o failur dircly * 2,xiss paus ask,complmn no compld, pnding submission of asks, rurn o suspnsion * 3,succss * @rurn ExcuionSaus */ priva ExcuionSaus procssRadyPaus(){ hasRryTaskInSandBy()){ rurn ExcuionSaus.FAILURE; } Lis<TaskInsanc> pausLis = gComplTaskBySa(ExcuionSaus.PAUSE); CollcionUils.isNoEmpy(pausLis) || !isComplmnEnd() || radyToSubmiTaskLis.siz() > 0){ rurn ExcuionSaus.PAUSE; }ls{ rurn ExcuionSaus.SUCCESS; } } /** * gnra h las procss insanc saus by h asks sa * @rurn procss insanc xcuion saus */ priva ExcuionSaus gProcssInsancSa(){ ProcssInsanc insanc = procssSrvic.findProcssInsancById(procssInsanc.gId()); ExcuionSaus sa = insanc.gSa(); acivTaskNod.siz() > 0 || rryTaskExiss()){ // aciv a rurn runningSa(sa);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
1,336
[BUG] [api]Dependent execution fails after task performs serial complement
**To Reproduce** 1. A task depends on B task, the deviation range is the first 3 days 2. The serial complement of 3 days before the B task execution 3. Run workflow, dependent execution fails ![image](https://user-images.githubusercontent.com/55787491/69607569-74297400-1060-11ea-9d15-8175e79056ff.png) **Which version of Dolphin Scheduler:** -[1.2.0]
https://github.com/apache/dolphinscheduler/issues/1336
https://github.com/apache/dolphinscheduler/pull/3331
624f0aeab9621abbbc9584c4a3167cb1bd2dcf00
5f725aa28b2edbd246480a554ac7822bf07fbbfd
2019-11-26T07:23:55Z
java
2020-07-29T07:37:49Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
} // procss failur procssFaild()){ rurn ExcuionSaus.FAILURE; } // waiing hrad hasWaiingThradTask()){ rurn ExcuionSaus.WAITTING_THREAD; } // paus sa == ExcuionSaus.READY_PAUSE){ rurn procssRadyPaus(); } // sop sa == ExcuionSaus.READY_STOP){ Lis<TaskInsanc> sopLis = gComplTaskBySa(ExcuionSaus.STOP); Lis<TaskInsanc> killLis = gComplTaskBySa(ExcuionSaus.KILL); CollcionUils.isNoEmpy(sopLis) || CollcionUils.isNoEmpy(killLis) || !isComplmnEnd()){ rurn ExcuionSaus.STOP; }ls{ rurn ExcuionSaus.SUCCESS; } } // succss sa == ExcuionSaus.RUNNING_EXEUTION){ Lis<TaskInsanc> killTasks = gComplTaskBySa(ExcuionSaus.KILL); radyToSubmiTaskLis.siz() > 0){ //asks curr
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
1,336
[BUG] [api]Dependent execution fails after task performs serial complement
**To Reproduce** 1. A task depends on B task, the deviation range is the first 3 days 2. The serial complement of 3 days before the B task execution 3. Run workflow, dependent execution fails ![image](https://user-images.githubusercontent.com/55787491/69607569-74297400-1060-11ea-9d15-8175e79056ff.png) **Which version of Dolphin Scheduler:** -[1.2.0]
https://github.com/apache/dolphinscheduler/issues/1336
https://github.com/apache/dolphinscheduler/pull/3331
624f0aeab9621abbbc9584c4a3167cb1bd2dcf00
5f725aa28b2edbd246480a554ac7822bf07fbbfd
2019-11-26T07:23:55Z
java
2020-07-29T07:37:49Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
rurn ExcuionSaus.RUNNING_EXEUTION; }ls CollcionUils.isNoEmpy(killTasks)){ // asks may rurn ExcuionSaus.FAILURE; }ls{ // if h w rurn ExcuionSaus.SUCCESS; } } rurn sa; } /** * whhr sandby ask lis hav rry asks * @rurn */ priva boolan rryTaskExiss() { boolan rsul = fals; for(Sring askNam : radyToSubmiTaskLis.kyS()){ TaskInsanc ask = radyToSubmiTaskLis.g(askNam); ask.gSa().ypIsFailur()){ rsul = ru; brak; } } rurn rsul; } /** * whhr complmn nd * @rurn Boolan whhr is complmn nd */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
1,336
[BUG] [api]Dependent execution fails after task performs serial complement
**To Reproduce** 1. A task depends on B task, the deviation range is the first 3 days 2. The serial complement of 3 days before the B task execution 3. Run workflow, dependent execution fails ![image](https://user-images.githubusercontent.com/55787491/69607569-74297400-1060-11ea-9d15-8175e79056ff.png) **Which version of Dolphin Scheduler:** -[1.2.0]
https://github.com/apache/dolphinscheduler/issues/1336
https://github.com/apache/dolphinscheduler/pull/3331
624f0aeab9621abbbc9584c4a3167cb1bd2dcf00
5f725aa28b2edbd246480a554ac7822bf07fbbfd
2019-11-26T07:23:55Z
java
2020-07-29T07:37:49Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
priva boolan isComplmnEnd() { !procssInsanc.isComplmnDaa()){ rurn ru; } ry { Map<Sring, Sring> cmdParam = JSONUils.oMap(procssInsanc.gCommandParam()); Da ndTim = DaUils.gSchdulDa(cmdParam.g(CMDPARAM_COMPLEMENT_DATA_END_DATE)); rurn procssInsanc.gSchdulTim().quals(ndTim); } cach (Excpion ) { loggr.rror("complmn nd faild ",); rurn fals; } } /** * updaProcssInsanc procss insanc sa * afr ach bach of asks is xcud, h saus of h procss insanc is updad */ priva void updaProcssInsancSa() { ExcuionSaus sa = gProcssInsancSa(); procssInsanc.gSa() != sa){ loggr.info( "work flow procss insanc [id: {}, nam:{}], sa chang from {} o {}, cmd yp: {}", procssInsanc.gId(), procssInsanc.gNam(), procssInsanc.gSa(), sa, procssInsanc.gCommandTyp()); ProcssInsanc insanc = procssSrvic.findProcssInsancById(procssInsanc.gId()); insanc.sSa(sa); insanc.sProcssDfiniion(procssInsanc.gProcssDfiniion()); procssSrvic.updaProcssInsanc(insanc); procssInsanc = insanc;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
1,336
[BUG] [api]Dependent execution fails after task performs serial complement
**To Reproduce** 1. A task depends on B task, the deviation range is the first 3 days 2. The serial complement of 3 days before the B task execution 3. Run workflow, dependent execution fails ![image](https://user-images.githubusercontent.com/55787491/69607569-74297400-1060-11ea-9d15-8175e79056ff.png) **Which version of Dolphin Scheduler:** -[1.2.0]
https://github.com/apache/dolphinscheduler/issues/1336
https://github.com/apache/dolphinscheduler/pull/3331
624f0aeab9621abbbc9584c4a3167cb1bd2dcf00
5f725aa28b2edbd246480a554ac7822bf07fbbfd
2019-11-26T07:23:55Z
java
2020-07-29T07:37:49Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
} } /** * g ask dpndncy rsul * @param askInsanc ask insanc * @rurn DpndRsul */ priva DpndRsul gDpndRsulForTask(TaskInsanc askInsanc){ rurn isTaskDpsCompl(askInsanc.gNam()); } /** * add ask o sandby lis * @param askInsanc ask insanc */ priva void addTaskToSandByLis(TaskInsanc askInsanc){ loggr.info("add ask o sand by lis: {}", askInsanc.gNam()); radyToSubmiTaskLis.puIfAbsn(askInsanc.gNam(), askInsanc); } /** * rmov ask from sand by lis * @param askInsanc ask insanc */ priva void rmovTaskFromSandbyLis(TaskInsanc askInsanc){ loggr.info("rmov ask from sand by lis: {}", askInsanc.gNam()); radyToSubmiTaskLis.rmov(askInsanc.gNam()); } /** * has rry ask in sandby * @rurn Boolan whhr has rry ask in sandby */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
1,336
[BUG] [api]Dependent execution fails after task performs serial complement
**To Reproduce** 1. A task depends on B task, the deviation range is the first 3 days 2. The serial complement of 3 days before the B task execution 3. Run workflow, dependent execution fails ![image](https://user-images.githubusercontent.com/55787491/69607569-74297400-1060-11ea-9d15-8175e79056ff.png) **Which version of Dolphin Scheduler:** -[1.2.0]
https://github.com/apache/dolphinscheduler/issues/1336
https://github.com/apache/dolphinscheduler/pull/3331
624f0aeab9621abbbc9584c4a3167cb1bd2dcf00
5f725aa28b2edbd246480a554ac7822bf07fbbfd
2019-11-26T07:23:55Z
java
2020-07-29T07:37:49Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
priva boolan hasRryTaskInSandBy(){ for (Map.Enry<Sring, TaskInsanc> nry: radyToSubmiTaskLis.nryS()) { nry.gValu().gSa().ypIsFailur()){ rurn ru; } } rurn fals; } /** * submi and wach h asks, unil h work flow sop */ priva void runProcss(){ // submi sar nod submiPosNod(null); boolan sndTimWarning = fals; whil(!procssInsanc.isProcssInsancSop()){ // snd warn !sndTimWarning && chckProcssTimOu(procssInsanc) ){ alrManagr.sndProcssTimouAlr(procssInsanc, procssSrvic.findProcssDfinById(procssInsanc.gProcssDfiniionId())); sndTimWarning = ru; } for(Map.Enry<MasrBasTaskExcThrad,Fuur<Boolan>> nry: acivTaskNod.nryS()) { Fuur<Boolan> fuur = nry.gValu(); TaskInsanc ask = nry.gKy().gTaskInsanc(); !fuur.isDon()){ coninu; } // nod moni ask = his.procssSrvic.findTaskInsancById(ask.gId());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
1,336
[BUG] [api]Dependent execution fails after task performs serial complement
**To Reproduce** 1. A task depends on B task, the deviation range is the first 3 days 2. The serial complement of 3 days before the B task execution 3. Run workflow, dependent execution fails ![image](https://user-images.githubusercontent.com/55787491/69607569-74297400-1060-11ea-9d15-8175e79056ff.png) **Which version of Dolphin Scheduler:** -[1.2.0]
https://github.com/apache/dolphinscheduler/issues/1336
https://github.com/apache/dolphinscheduler/pull/3331
624f0aeab9621abbbc9584c4a3167cb1bd2dcf00
5f725aa28b2edbd246480a554ac7822bf07fbbfd
2019-11-26T07:23:55Z
java
2020-07-29T07:37:49Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
ask == null){ his.askFaildSubmi = ru; acivTaskNod.rmov(nry.gKy()); coninu; } // nod moni ask.gSa().ypIsFinishd()){ acivTaskNod.rmov(nry.gKy()); } loggr.info("ask :{}, id:{} compl, sa is {} ", ask.gNam(), ask.gId(), ask.gSa()); // nod succ ask.gSa() == ExcuionSaus.SUCCESS){ complTaskLis.pu(ask.gNam(), ask); submiPosNod(ask.gNam()); coninu; } // nod fail ask.gSa().ypIsFailur()){ ask.gSa() == ExcuionSaus.NEED_FAULT_TOLERANCE){ his.rcovrTolrancFaulTaskLis.add(ask); } ask.askCanRry()){ addTaskToSandByLis(ask); }ls{ complTaskLis.pu(ask.gNam(), ask); ask.isCondiionsTask() || DagHlpr.havCondiionsAfrNod(ask.gNam(), dag)) { submiPosNod(ask.gNam()); }ls{
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
1,336
[BUG] [api]Dependent execution fails after task performs serial complement
**To Reproduce** 1. A task depends on B task, the deviation range is the first 3 days 2. The serial complement of 3 days before the B task execution 3. Run workflow, dependent execution fails ![image](https://user-images.githubusercontent.com/55787491/69607569-74297400-1060-11ea-9d15-8175e79056ff.png) **Which version of Dolphin Scheduler:** -[1.2.0]
https://github.com/apache/dolphinscheduler/issues/1336
https://github.com/apache/dolphinscheduler/pull/3331
624f0aeab9621abbbc9584c4a3167cb1bd2dcf00
5f725aa28b2edbd246480a554ac7822bf07fbbfd
2019-11-26T07:23:55Z
java
2020-07-29T07:37:49Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
rrorTaskLis.pu(ask.gNam(), ask); procssInsanc.gFailurSragy() == FailurSragy.END){ killThOhrTasks(); } } } coninu; } // ohr sa complTaskLis.pu(ask.gNam(), ask); } // snd alr CollcionUils.isNoEmpy(his.rcovrTolrancFaulTaskLis)){ alrManagr.sndAlrWorkrTolrancFaul(procssInsanc, rcovrTolrancFaulTaskLis); his.rcovrTolrancFaulTaskLis.clar(); } // updaPro // failur p // if a ask rrorTaskLis.siz() > 0){ for(Map.Enry<Sring, TaskInsanc> nry: complTaskLis.nryS()) { TaskInsanc complTask = nry.gValu(); complTask.gSa()== ExcuionSaus.PAUSE){ complTask.sSa(ExcuionSaus.KILL); complTaskLis.pu(nry.gKy(), complTask); procssSrvic.updaTaskInsanc(complTask); } } } canSubmiTaskToQuu()){
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
1,336
[BUG] [api]Dependent execution fails after task performs serial complement
**To Reproduce** 1. A task depends on B task, the deviation range is the first 3 days 2. The serial complement of 3 days before the B task execution 3. Run workflow, dependent execution fails ![image](https://user-images.githubusercontent.com/55787491/69607569-74297400-1060-11ea-9d15-8175e79056ff.png) **Which version of Dolphin Scheduler:** -[1.2.0]
https://github.com/apache/dolphinscheduler/issues/1336
https://github.com/apache/dolphinscheduler/pull/3331
624f0aeab9621abbbc9584c4a3167cb1bd2dcf00
5f725aa28b2edbd246480a554ac7822bf07fbbfd
2019-11-26T07:23:55Z
java
2020-07-29T07:37:49Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
submiSandByTask(); } ry { Thrad.slp(Consans.SLEEP_TIME_MILLIS); } cach (InrrupdExcpion ) { loggr.rror(.gMssag(),); } updaProcssInsancSa(); } loggr.info("procss:{} nd, sa :{}", procssInsanc.gId(), procssInsanc.gSa()); } /** * whhr chck procss im ou * @param procssInsanc ask insanc * @rurn ru if im ou of procss insanc > running im of procss insanc */ priva boolan chckProcssTimOu(ProcssInsanc procssInsanc) { procssInsanc.gTimou() == 0 ){ rurn fals; } Da now = nw Da(); long runningTim = DaUils.diffMin(now, procssInsanc.gSarTim()); rurn runningTim > procssInsanc.gTimou(); } /** * whhr can submi ask o quu * @rurn boolan */ priva boolan canSubmiTaskToQuu() { rurn OSUils.chckRsourc(masrConfig.gMasrMaxCpuloadAvg(), masrConfig.gMasrRsrvdMmory());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
1,336
[BUG] [api]Dependent execution fails after task performs serial complement
**To Reproduce** 1. A task depends on B task, the deviation range is the first 3 days 2. The serial complement of 3 days before the B task execution 3. Run workflow, dependent execution fails ![image](https://user-images.githubusercontent.com/55787491/69607569-74297400-1060-11ea-9d15-8175e79056ff.png) **Which version of Dolphin Scheduler:** -[1.2.0]
https://github.com/apache/dolphinscheduler/issues/1336
https://github.com/apache/dolphinscheduler/pull/3331
624f0aeab9621abbbc9584c4a3167cb1bd2dcf00
5f725aa28b2edbd246480a554ac7822bf07fbbfd
2019-11-26T07:23:55Z
java
2020-07-29T07:37:49Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
} /** * clos h on going asks */ priva void killThOhrTasks() { loggr.info("kill calld on : {}, num: {}", procssInsanc.gId(), acivTaskNod.siz()); for (Map.Enry<MasrBasTaskExcThrad, Fuur<Boolan>> nry : acivTaskNod.nryS()) { MasrBasTaskExcThrad askExcThrad = nry.gKy(); Fuur<Boolan> fuur = nry.gValu(); TaskInsanc askInsanc = askExcThrad.gTaskInsanc(); askInsanc = procssSrvic.findTaskInsancById(askInsanc.gId()); askInsanc != null && askInsanc.gSa().ypIsFinishd()){ coninu; } if (!fuur.isDon()) { // rcord ki loggr.info("kill procss insanc, id: {}, ask: {}", procssInsanc.gId(), askExcThrad.gTaskInsanc().gId()); // kill nod askExcThrad.kill(); } } } /** * whhr h rry inrval is imd ou * @param askInsanc ask insanc * @rurn Boolan */ priva boolan rryTaskInrvalOvrTim(TaskInsanc askInsanc){ askInsanc.gSa() != ExcuionSaus.FAILURE){
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
1,336
[BUG] [api]Dependent execution fails after task performs serial complement
**To Reproduce** 1. A task depends on B task, the deviation range is the first 3 days 2. The serial complement of 3 days before the B task execution 3. Run workflow, dependent execution fails ![image](https://user-images.githubusercontent.com/55787491/69607569-74297400-1060-11ea-9d15-8175e79056ff.png) **Which version of Dolphin Scheduler:** -[1.2.0]
https://github.com/apache/dolphinscheduler/issues/1336
https://github.com/apache/dolphinscheduler/pull/3331
624f0aeab9621abbbc9584c4a3167cb1bd2dcf00
5f725aa28b2edbd246480a554ac7822bf07fbbfd
2019-11-26T07:23:55Z
java
2020-07-29T07:37:49Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
rurn ru; } askInsanc.gId() == 0 || askInsanc.gMaxRryTims() ==0 || askInsanc.gRryInrval() == 0 ){ rurn ru; } Da now = nw Da(); long faildTimInrval = DaUils.diffrSc(now, askInsanc.gEndTim()); // ask rry dos no ovr im, rurn fals rurn askInsanc.gRryInrval() * SEC_2_MINUTES_TIME_UNIT < faildTimInrval; } /** * handling h lis of asks o b submid */ priva void submiSandByTask(){ for(Map.Enry<Sring, TaskInsanc> nry: radyToSubmiTaskLis.nryS()) { TaskInsanc ask = nry.gValu(); DpndRsul dpndRsul = gDpndRsulForTask(ask); DpndRsul.SUCCESS == dpndRsul){ rryTaskInrvalOvrTim(ask)){ submiTaskExc(ask); rmovTaskFromSandbyLis(ask); } }ls DpndRsul.FAILED == dpndRsul){ // if h d dpndFaildTask.pu(nry.gKy(), ask); rmovTaskFromSandbyLis(ask); loggr.info("ask {},id:{} dpnd rsul : {}",ask.gNam(), ask.gId(), dpndRsul); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
1,336
[BUG] [api]Dependent execution fails after task performs serial complement
**To Reproduce** 1. A task depends on B task, the deviation range is the first 3 days 2. The serial complement of 3 days before the B task execution 3. Run workflow, dependent execution fails ![image](https://user-images.githubusercontent.com/55787491/69607569-74297400-1060-11ea-9d15-8175e79056ff.png) **Which version of Dolphin Scheduler:** -[1.2.0]
https://github.com/apache/dolphinscheduler/issues/1336
https://github.com/apache/dolphinscheduler/pull/3331
624f0aeab9621abbbc9584c4a3167cb1bd2dcf00
5f725aa28b2edbd246480a554ac7822bf07fbbfd
2019-11-26T07:23:55Z
java
2020-07-29T07:37:49Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
} } /** * g rcovry ask insanc * @param askId ask id * @rurn rcovry ask insanc */ priva TaskInsanc gRcovryTaskInsanc(Sring askId){ !SringUils.isNoEmpy(askId)){ rurn null; } ry { Ingr inId = Ingr.valuOf(askId); TaskInsanc ask = procssSrvic.findTaskInsancById(inId); ask == null){ loggr.rror("sar nod id canno b found: {}", askId); }ls { rurn ask; } }cach (Excpion ){ loggr.rror("g rcovry ask insanc faild ",); } rurn null; } /** * g sar ask insanc lis * @param cmdParam command param * @rurn ask insanc lis */ priva Lis<TaskInsanc> gSarTaskInsancLis(Sring cmdParam){
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
1,336
[BUG] [api]Dependent execution fails after task performs serial complement
**To Reproduce** 1. A task depends on B task, the deviation range is the first 3 days 2. The serial complement of 3 days before the B task execution 3. Run workflow, dependent execution fails ![image](https://user-images.githubusercontent.com/55787491/69607569-74297400-1060-11ea-9d15-8175e79056ff.png) **Which version of Dolphin Scheduler:** -[1.2.0]
https://github.com/apache/dolphinscheduler/issues/1336
https://github.com/apache/dolphinscheduler/pull/3331
624f0aeab9621abbbc9584c4a3167cb1bd2dcf00
5f725aa28b2edbd246480a554ac7822bf07fbbfd
2019-11-26T07:23:55Z
java
2020-07-29T07:37:49Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
Lis<TaskInsanc> insancLis = nw ArrayLis<>(); Map<Sring, Sring> paramMap = JSONUils.oMap(cmdParam); paramMap != null && paramMap.conainsKy(CMDPARAM_RECOVERY_START_NODE_STRING)){ Sring[] idLis = paramMap.g(CMDPARAM_RECOVERY_START_NODE_STRING).spli(Consans.COMMA); for(Sring nodId : idLis){ TaskInsanc ask = gRcovryTaskInsanc(nodId); ask != null){ insancLis.add(ask); } } } rurn insancLis; } /** * pars "SarNodNamLis" from cmd param * @param cmdParam command param * @rurn sar nod nam lis */ priva Lis<Sring> parsSarNodNam(Sring cmdParam){ Lis<Sring> sarNodNamLis = nw ArrayLis<>(); Map<Sring, Sring> paramMap = JSONUils.oMap(cmdParam); paramMap == null){ rurn sarNodNamLis; } paramMap.conainsKy(CMDPARAM_START_NODE_NAMES)){ sarNodNamLis = Arrays.asLis(paramMap.g(CMDPARAM_START_NODE_NAMES).spli(Consans.COMMA)); } rurn sarNodNamLis; } /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
1,336
[BUG] [api]Dependent execution fails after task performs serial complement
**To Reproduce** 1. A task depends on B task, the deviation range is the first 3 days 2. The serial complement of 3 days before the B task execution 3. Run workflow, dependent execution fails ![image](https://user-images.githubusercontent.com/55787491/69607569-74297400-1060-11ea-9d15-8175e79056ff.png) **Which version of Dolphin Scheduler:** -[1.2.0]
https://github.com/apache/dolphinscheduler/issues/1336
https://github.com/apache/dolphinscheduler/pull/3331
624f0aeab9621abbbc9584c4a3167cb1bd2dcf00
5f725aa28b2edbd246480a554ac7822bf07fbbfd
2019-11-26T07:23:55Z
java
2020-07-29T07:37:49Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
* gnra sar nod nam lis from parsing command param; * if "SarNodIdLis" xiss in command param, rurn SarNodIdLis * @rurn rcovry nod nam lis */ priva Lis<Sring> gRcovryNodNamLis(){ Lis<Sring> rcovryNodNamLis = nw ArrayLis<>(); CollcionUils.isNoEmpy(rcovrNodIdLis)) { for (TaskInsanc ask : rcovrNodIdLis) { rcovryNodNamLis.add(ask.gNam()); } } rurn rcovryNodNamLis; } /** * gnra flow dag * @param procssDfiniionJson procss dfiniion json * @param sarNodNamLis sar nod nam lis * @param rcovryNodNamLis rcovry nod nam lis * @param dpNodTyp dpnd nod yp * @rurn ProcssDag procss dag * @hrows Excpion xcpion */ public ProcssDag gnraFlowDag(Sring procssDfiniionJson, Lis<Sring> sarNodNamLis, Lis<Sring> rcovryNodNamLis, TaskDpndTyp dpNodTyp)hrows Excpion{ rurn DagHlpr.gnraFlowDag(procssDfiniionJson, sarNodNamLis, rcovryNodNamLis, dpNodTyp); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,295
When I create a scheduler directly through the api, a NullPointerException will appear when the processInstancePriority field is not passed. he is @RequestParam(value = "processInstancePriority", required = false)
![image](https://user-images.githubusercontent.com/34977303/88355113-e1c7a480-cd95-11ea-8cfa-9d34d866cb08.png) error line ![image](https://user-images.githubusercontent.com/34977303/88355156-10457f80-cd96-11ea-8e3f-31170d6fdff6.png) Do you need to modify it to @RequestParam(value = "processInstancePriority", required = true)
https://github.com/apache/dolphinscheduler/issues/3295
https://github.com/apache/dolphinscheduler/pull/3341
5f725aa28b2edbd246480a554ac7822bf07fbbfd
e2a117032de53a206fd0d8a55b665a199efb276a
2020-07-24T02:12:26Z
java
2020-07-29T11:01:53Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/SchedulerController.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.dolphinscheduler.api.controller; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.SchedulerService; import org.apache.dolphinscheduler.api.utils.Result; import org.apache.dolphinscheduler.common.enums.FailureStrategy; import org.apache.dolphinscheduler.common.enums.Priority;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,295
When I create a scheduler directly through the api, a NullPointerException will appear when the processInstancePriority field is not passed. he is @RequestParam(value = "processInstancePriority", required = false)
![image](https://user-images.githubusercontent.com/34977303/88355113-e1c7a480-cd95-11ea-8cfa-9d34d866cb08.png) error line ![image](https://user-images.githubusercontent.com/34977303/88355156-10457f80-cd96-11ea-8e3f-31170d6fdff6.png) Do you need to modify it to @RequestParam(value = "processInstancePriority", required = true)
https://github.com/apache/dolphinscheduler/issues/3295
https://github.com/apache/dolphinscheduler/pull/3341
5f725aa28b2edbd246480a554ac7822bf07fbbfd
e2a117032de53a206fd0d8a55b665a199efb276a
2020-07-24T02:12:26Z
java
2020-07-29T11:01:53Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/SchedulerController.java
import org.apache.dolphinscheduler.common.enums.ReleaseState; import org.apache.dolphinscheduler.common.enums.WarningType; import org.apache.dolphinscheduler.common.utils.ParameterUtils; import org.apache.dolphinscheduler.dao.entity.User; import io.swagger.annotations.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; import springfox.documentation.annotations.ApiIgnore; import java.io.IOException; import java.util.Map; import static org.apache.dolphinscheduler.api.enums.Status.*; import static org.apache.dolphinscheduler.common.Constants.SESSION_USER; /** * schedule controller */ @Api(tags = "SCHEDULER_TAG", position = 13) @RestController @RequestMapping("/projects/{projectName}/schedule") public class SchedulerController extends BaseController { private static final Logger logger = LoggerFactory.getLogger(SchedulerController.class); public static final String DEFAULT_WARNING_TYPE = "NONE"; public static final String DEFAULT_NOTIFY_GROUP_ID = "1"; public static final String DEFAULT_FAILURE_POLICY = "CONTINUE"; @Autowired private SchedulerService schedulerService; /** * create schedule
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,295
When I create a scheduler directly through the api, a NullPointerException will appear when the processInstancePriority field is not passed. he is @RequestParam(value = "processInstancePriority", required = false)
![image](https://user-images.githubusercontent.com/34977303/88355113-e1c7a480-cd95-11ea-8cfa-9d34d866cb08.png) error line ![image](https://user-images.githubusercontent.com/34977303/88355156-10457f80-cd96-11ea-8e3f-31170d6fdff6.png) Do you need to modify it to @RequestParam(value = "processInstancePriority", required = true)
https://github.com/apache/dolphinscheduler/issues/3295
https://github.com/apache/dolphinscheduler/pull/3341
5f725aa28b2edbd246480a554ac7822bf07fbbfd
e2a117032de53a206fd0d8a55b665a199efb276a
2020-07-24T02:12:26Z
java
2020-07-29T11:01:53Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/SchedulerController.java
* * @param loginUser login user * @param projectName project name * @param processDefinitionId process definition id * @param schedule scheduler * @param warningType warning type * @param warningGroupId warning group id * @param failureStrategy failure strategy * @param processInstancePriority process instance priority * @param receivers receivers * @param receiversCc receivers cc * @param workerGroup worker group * @return create result code */ @ApiOperation(value = "createSchedule", notes = "CREATE_SCHEDULE_NOTES") @ApiImplicitParams({ @ApiImplicitParam(name = "processDefinitionId", value = "PROCESS_DEFINITION_ID", required = true, dataType = "Int", example = "100"), @ApiImplicitParam(name = "schedule", value = "SCHEDULE", dataType = "String", example = "{'startTime':'2019-06-10 00:00:00','endTime':'2019-06-13 00:00:00','crontab':'0 0 3/6 * * ? *'}"), @ApiImplicitParam(name = "warningType", value = "WARNING_TYPE", type = "WarningType"), @ApiImplicitParam(name = "warningGroupId", value = "WARNING_GROUP_ID", dataType = "Int", example = "100"), @ApiImplicitParam(name = "failureStrategy", value = "FAILURE_STRATEGY", type = "FailureStrategy"), @ApiImplicitParam(name = "receivers", value = "RECEIVERS", type = "String"), @ApiImplicitParam(name = "receiversCc", value = "RECEIVERS_CC", type = "String"), @ApiImplicitParam(name = "workerGroupId", value = "WORKER_GROUP_ID", dataType = "Int", example = "100"), @ApiImplicitParam(name = "processInstancePriority", value = "PROCESS_INSTANCE_PRIORITY", type = "Priority"), }) @PostMapping("/create") @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_SCHEDULE_ERROR) public Result createSchedule(@ApiIgnore @RequestAttribute(value = SESSION_USER) User loginUser,
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,295
When I create a scheduler directly through the api, a NullPointerException will appear when the processInstancePriority field is not passed. he is @RequestParam(value = "processInstancePriority", required = false)
![image](https://user-images.githubusercontent.com/34977303/88355113-e1c7a480-cd95-11ea-8cfa-9d34d866cb08.png) error line ![image](https://user-images.githubusercontent.com/34977303/88355156-10457f80-cd96-11ea-8e3f-31170d6fdff6.png) Do you need to modify it to @RequestParam(value = "processInstancePriority", required = true)
https://github.com/apache/dolphinscheduler/issues/3295
https://github.com/apache/dolphinscheduler/pull/3341
5f725aa28b2edbd246480a554ac7822bf07fbbfd
e2a117032de53a206fd0d8a55b665a199efb276a
2020-07-24T02:12:26Z
java
2020-07-29T11:01:53Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/SchedulerController.java
@ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable String projectName, @RequestParam(value = "processDefinitionId") Integer processDefinitionId, @RequestParam(value = "schedule") String schedule, @RequestParam(value = "warningType", required = false, defaultValue = DEFAULT_WARNING_TYPE) WarningType warningType, @RequestParam(value = "warningGroupId", required = false, defaultValue = DEFAULT_NOTIFY_GROUP_ID) int warningGroupId, @RequestParam(value = "failureStrategy", required = false, defaultValue = DEFAULT_FAILURE_POLICY) FailureStrategy failureStrategy, @RequestParam(value = "receivers", required = false) String receivers, @RequestParam(value = "receiversCc", required = false) String receiversCc, @RequestParam(value = "workerGroup", required = false, defaultValue = "default") String workerGroup, @RequestParam(value = "processInstancePriority", required = false) Priority processInstancePriority) throws IOException { logger.info("login user {}, project name: {}, process name: {}, create schedule: {}, warning type: {}, warning group id: {}," + "failure policy: {},receivers : {},receiversCc : {},processInstancePriority : {}, workGroupId:{}", loginUser.getUserName(), projectName, processDefinitionId, schedule, warningType, warningGroupId, failureStrategy, receivers, receiversCc, processInstancePriority, workerGroup); Map<String, Object> result = schedulerService.insertSchedule(loginUser, projectName, processDefinitionId, schedule, warningType, warningGroupId, failureStrategy, receivers, receiversCc, processInstancePriority, workerGroup); return returnDataList(result); } /** * updateProcessInstance schedule * * @param loginUser login user * @param projectName project name * @param id scheduler id * @param schedule scheduler * @param warningType warning type * @param warningGroupId warning group id * @param failureStrategy failure strategy * @param receivers receivers * @param workerGroup worker group
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,295
When I create a scheduler directly through the api, a NullPointerException will appear when the processInstancePriority field is not passed. he is @RequestParam(value = "processInstancePriority", required = false)
![image](https://user-images.githubusercontent.com/34977303/88355113-e1c7a480-cd95-11ea-8cfa-9d34d866cb08.png) error line ![image](https://user-images.githubusercontent.com/34977303/88355156-10457f80-cd96-11ea-8e3f-31170d6fdff6.png) Do you need to modify it to @RequestParam(value = "processInstancePriority", required = true)
https://github.com/apache/dolphinscheduler/issues/3295
https://github.com/apache/dolphinscheduler/pull/3341
5f725aa28b2edbd246480a554ac7822bf07fbbfd
e2a117032de53a206fd0d8a55b665a199efb276a
2020-07-24T02:12:26Z
java
2020-07-29T11:01:53Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/SchedulerController.java
* @param processInstancePriority process instance priority * @param receiversCc receivers cc * @return update result code */ @ApiOperation(value = "updateSchedule", notes = "UPDATE_SCHEDULE_NOTES") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "SCHEDULE_ID", required = true, dataType = "Int", example = "100"), @ApiImplicitParam(name = "schedule", value = "SCHEDULE", dataType = "String", example = "{'startTime':'2019-06-10 00:00:00','endTime':'2019-06-13 00:00:00','crontab':'0 0 3/6 * * ? *'}"), @ApiImplicitParam(name = "warningType", value = "WARNING_TYPE", type = "WarningType"), @ApiImplicitParam(name = "warningGroupId", value = "WARNING_GROUP_ID", dataType = "Int", example = "100"), @ApiImplicitParam(name = "failureStrategy", value = "FAILURE_STRATEGY", type = "FailureStrategy"), @ApiImplicitParam(name = "receivers", value = "RECEIVERS", type = "String"), @ApiImplicitParam(name = "receiversCc", value = "RECEIVERS_CC", type = "String"), @ApiImplicitParam(name = "workerGroupId", value = "WORKER_GROUP_ID", dataType = "Int", example = "100"), @ApiImplicitParam(name = "processInstancePriority", value = "PROCESS_INSTANCE_PRIORITY", type = "Priority"), }) @PostMapping("/update") @ApiException(UPDATE_SCHEDULE_ERROR) public Result updateSchedule(@ApiIgnore @RequestAttribute(value = SESSION_USER) User loginUser, @ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable String projectName, @RequestParam(value = "id") Integer id, @RequestParam(value = "schedule") String schedule, @RequestParam(value = "warningType", required = false, defaultValue = DEFAULT_WARNING_TYPE) WarningType warningType, @RequestParam(value = "warningGroupId", required = false) int warningGroupId, @RequestParam(value = "failureStrategy", required = false, defaultValue = "END") FailureStrategy failureStrategy, @RequestParam(value = "receivers", required = false) String receivers, @RequestParam(value = "receiversCc", required = false) String receiversCc, @RequestParam(value = "workerGroup", required = false, defaultValue = "default") String workerGroup, @RequestParam(value = "processInstancePriority", required = false) Priority processInstancePriority) throws IOException { logger.info("login user {}, project name: {},id: {}, updateProcessInstance schedule: {}, notify type: {}, notify mails: {}, " +
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,295
When I create a scheduler directly through the api, a NullPointerException will appear when the processInstancePriority field is not passed. he is @RequestParam(value = "processInstancePriority", required = false)
![image](https://user-images.githubusercontent.com/34977303/88355113-e1c7a480-cd95-11ea-8cfa-9d34d866cb08.png) error line ![image](https://user-images.githubusercontent.com/34977303/88355156-10457f80-cd96-11ea-8e3f-31170d6fdff6.png) Do you need to modify it to @RequestParam(value = "processInstancePriority", required = true)
https://github.com/apache/dolphinscheduler/issues/3295
https://github.com/apache/dolphinscheduler/pull/3341
5f725aa28b2edbd246480a554ac7822bf07fbbfd
e2a117032de53a206fd0d8a55b665a199efb276a
2020-07-24T02:12:26Z
java
2020-07-29T11:01:53Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/SchedulerController.java
"failure policy: {},receivers : {},receiversCc : {},processInstancePriority : {},workerGroupId:{}", loginUser.getUserName(), projectName, id, schedule, warningType, warningGroupId, failureStrategy, receivers, receiversCc, processInstancePriority, workerGroup); Map<String, Object> result = schedulerService.updateSchedule(loginUser, projectName, id, schedule, warningType, warningGroupId, failureStrategy, receivers, receiversCc, null, processInstancePriority, workerGroup); return returnDataList(result); } /** * publish schedule setScheduleState * * @param loginUser login user * @param projectName project name * @param id scheduler id * @return publish result code */ @ApiOperation(value = "online", notes = "ONLINE_SCHEDULE_NOTES") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "SCHEDULE_ID", required = true, dataType = "Int", example = "100") }) @PostMapping("/online") @ApiException(PUBLISH_SCHEDULE_ONLINE_ERROR) public Result online(@ApiIgnore @RequestAttribute(value = SESSION_USER) User loginUser, @ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable("projectName") String projectName, @RequestParam("id") Integer id) { logger.info("login user {}, schedule setScheduleState, project name: {}, id: {}", loginUser.getUserName(), projectName, id); Map<String, Object> result = schedulerService.setScheduleState(loginUser, projectName, id, ReleaseState.ONLINE); return returnDataList(result); } /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,295
When I create a scheduler directly through the api, a NullPointerException will appear when the processInstancePriority field is not passed. he is @RequestParam(value = "processInstancePriority", required = false)
![image](https://user-images.githubusercontent.com/34977303/88355113-e1c7a480-cd95-11ea-8cfa-9d34d866cb08.png) error line ![image](https://user-images.githubusercontent.com/34977303/88355156-10457f80-cd96-11ea-8e3f-31170d6fdff6.png) Do you need to modify it to @RequestParam(value = "processInstancePriority", required = true)
https://github.com/apache/dolphinscheduler/issues/3295
https://github.com/apache/dolphinscheduler/pull/3341
5f725aa28b2edbd246480a554ac7822bf07fbbfd
e2a117032de53a206fd0d8a55b665a199efb276a
2020-07-24T02:12:26Z
java
2020-07-29T11:01:53Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/SchedulerController.java
* offline schedule * * @param loginUser login user * @param projectName project name * @param id schedule id * @return operation result code */ @ApiOperation(value = "offline", notes = "OFFLINE_SCHEDULE_NOTES") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "SCHEDULE_ID", required = true, dataType = "Int", example = "100") }) @PostMapping("/offline") @ApiException(OFFLINE_SCHEDULE_ERROR) public Result offline(@ApiIgnore @RequestAttribute(value = SESSION_USER) User loginUser, @ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable("projectName") String projectName, @RequestParam("id") Integer id) { logger.info("login user {}, schedule offline, project name: {}, process definition id: {}", loginUser.getUserName(), projectName, id); Map<String, Object> result = schedulerService.setScheduleState(loginUser, projectName, id, ReleaseState.OFFLINE); return returnDataList(result); } /** * query schedule list paging * * @param loginUser login user * @param projectName project name * @param processDefinitionId process definition id * @param pageNo page number * @param pageSize page size * @param searchVal search value
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,295
When I create a scheduler directly through the api, a NullPointerException will appear when the processInstancePriority field is not passed. he is @RequestParam(value = "processInstancePriority", required = false)
![image](https://user-images.githubusercontent.com/34977303/88355113-e1c7a480-cd95-11ea-8cfa-9d34d866cb08.png) error line ![image](https://user-images.githubusercontent.com/34977303/88355156-10457f80-cd96-11ea-8e3f-31170d6fdff6.png) Do you need to modify it to @RequestParam(value = "processInstancePriority", required = true)
https://github.com/apache/dolphinscheduler/issues/3295
https://github.com/apache/dolphinscheduler/pull/3341
5f725aa28b2edbd246480a554ac7822bf07fbbfd
e2a117032de53a206fd0d8a55b665a199efb276a
2020-07-24T02:12:26Z
java
2020-07-29T11:01:53Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/SchedulerController.java
* @return schedule list page */ @ApiOperation(value = "queryScheduleListPaging", notes = "QUERY_SCHEDULE_LIST_PAGING_NOTES") @ApiImplicitParams({ @ApiImplicitParam(name = "processDefinitionId", value = "PROCESS_DEFINITION_ID", required = true, dataType = "Int", example = "100"), @ApiImplicitParam(name = "searchVal", value = "SEARCH_VAL", type = "String"), @ApiImplicitParam(name = "pageNo", value = "PAGE_NO", dataType = "Int", example = "100"), @ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", dataType = "Int", example = "100") }) @GetMapping("/list-paging") @ApiException(QUERY_SCHEDULE_LIST_PAGING_ERROR) public Result queryScheduleListPaging(@ApiIgnore @RequestAttribute(value = SESSION_USER) User loginUser, @ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable String projectName, @RequestParam Integer processDefinitionId, @RequestParam(value = "searchVal", required = false) String searchVal, @RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize) { logger.info("login user {}, query schedule, project name: {}, process definition id: {}", loginUser.getUserName(), projectName, processDefinitionId); searchVal = ParameterUtils.handleEscapes(searchVal); Map<String, Object> result = schedulerService.querySchedule(loginUser, projectName, processDefinitionId, searchVal, pageNo, pageSize); return returnDataListPaging(result); } /** * delete schedule by id * * @param loginUser login user * @param projectName project name * @param scheduleId scheule id * @return delete result code
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,295
When I create a scheduler directly through the api, a NullPointerException will appear when the processInstancePriority field is not passed. he is @RequestParam(value = "processInstancePriority", required = false)
![image](https://user-images.githubusercontent.com/34977303/88355113-e1c7a480-cd95-11ea-8cfa-9d34d866cb08.png) error line ![image](https://user-images.githubusercontent.com/34977303/88355156-10457f80-cd96-11ea-8e3f-31170d6fdff6.png) Do you need to modify it to @RequestParam(value = "processInstancePriority", required = true)
https://github.com/apache/dolphinscheduler/issues/3295
https://github.com/apache/dolphinscheduler/pull/3341
5f725aa28b2edbd246480a554ac7822bf07fbbfd
e2a117032de53a206fd0d8a55b665a199efb276a
2020-07-24T02:12:26Z
java
2020-07-29T11:01:53Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/SchedulerController.java
*/ @ApiOperation(value = "deleteScheduleById", notes = "OFFLINE_SCHEDULE_NOTES") @ApiImplicitParams({ @ApiImplicitParam(name = "scheduleId", value = "SCHEDULE_ID", required = true, dataType = "Int", example = "100") }) @GetMapping(value = "/delete") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_SCHEDULE_CRON_BY_ID_ERROR) public Result deleteScheduleById(@RequestAttribute(value = SESSION_USER) User loginUser, @PathVariable String projectName, @RequestParam("scheduleId") Integer scheduleId ) { logger.info("delete schedule by id, login user:{}, project name:{}, schedule id:{}", loginUser.getUserName(), projectName, scheduleId); Map<String, Object> result = schedulerService.deleteScheduleById(loginUser, projectName, scheduleId); return returnDataList(result); } /** * query schedule list * * @param loginUser login user * @param projectName project name * @return schedule list */ @ApiOperation(value = "queryScheduleList", notes = "QUERY_SCHEDULE_LIST_NOTES") @PostMapping("/list") @ApiException(QUERY_SCHEDULE_LIST_ERROR) public Result queryScheduleList(@ApiIgnore @RequestAttribute(value = SESSION_USER) User loginUser, @ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable String projectName) { logger.info("login user {}, query schedule list, project name: {}",
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,295
When I create a scheduler directly through the api, a NullPointerException will appear when the processInstancePriority field is not passed. he is @RequestParam(value = "processInstancePriority", required = false)
![image](https://user-images.githubusercontent.com/34977303/88355113-e1c7a480-cd95-11ea-8cfa-9d34d866cb08.png) error line ![image](https://user-images.githubusercontent.com/34977303/88355156-10457f80-cd96-11ea-8e3f-31170d6fdff6.png) Do you need to modify it to @RequestParam(value = "processInstancePriority", required = true)
https://github.com/apache/dolphinscheduler/issues/3295
https://github.com/apache/dolphinscheduler/pull/3341
5f725aa28b2edbd246480a554ac7822bf07fbbfd
e2a117032de53a206fd0d8a55b665a199efb276a
2020-07-24T02:12:26Z
java
2020-07-29T11:01:53Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/SchedulerController.java
loginUser.getUserName(), projectName); Map<String, Object> result = schedulerService.queryScheduleList(loginUser, projectName); return returnDataList(result); } /** * preview schedule * * @param loginUser login user * @param projectName project name * @param schedule schedule expression * @return the next five fire time */ @ApiOperation(value = "previewSchedule", notes = "PREVIEW_SCHEDULE_NOTES") @ApiImplicitParams({ @ApiImplicitParam(name = "schedule", value = "SCHEDULE", dataType = "String", example = "{'startTime':'2019-06-10 00:00:00','endTime':'2019-06-13 00:00:00','crontab':'0 0 3/6 * * ? *'}"), }) @PostMapping("/preview") @ResponseStatus(HttpStatus.CREATED) @ApiException(PREVIEW_SCHEDULE_ERROR) public Result previewSchedule(@ApiIgnore @RequestAttribute(value = SESSION_USER) User loginUser, @ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable String projectName, @RequestParam(value = "schedule") String schedule ) { logger.info("login user {}, project name: {}, preview schedule: {}", loginUser.getUserName(), projectName, schedule); Map<String, Object> result = schedulerService.previewSchedule(loginUser, projectName, schedule); return returnDataList(result); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,314
[Question] Why "Failed to load ApplicationContext" when running tests locally
# Why "Failed to load ApplicationContext" when running tests locally The first is the test command I ran: ``` mvn test -pl dolphinscheduler-server -Dtest =TaskPriorityQueueConsumerTest#testSHELLTask ``` It should be noted that the above test is not the only one with this problem. ## The environment in which the problem occurs The problem was originally discovered by running tests in IDEA, but also by testing directly with the 'mvn' command. - Operating system: MacOS - JAVA: 1.8.0_111 - Maven: 3.5.2 - DS version: dev branch To verify that it was a local environment problem, I created a new virtual machine to test, which had the same problem. - Operating system: CentOS 7 - JAVA: 1.8.0_221 - Maven: 3.6.3 - DS version: dev branch ## Action steps I tested it on my virtual machine using the following steps: ``` git clone ... cd incubator-dolphinscheduler-github/ git checkout dev mvn clean install -pl dolphinscheduler-common -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-dao -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-service -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-alert -am -Dmaven.test.skip=true mvn test -pl dolphinscheduler-server -Dtest=TaskPriorityQueueConsumerTest#testSHELLTask ``` ## Error log ``` [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 15.247 s <<< FAILURE! - in org.apache.dolphinscheduler.server.master.consumer.TaskPriorityQueueConsumerTest [ERROR] testSHELLTask(org.apache.dolphinscheduler.server.master.consumer.TaskPriorityQueueConsumerTest) Time elapsed: 0 s <<< ERROR! java.lang.IllegalStateException: Failed to load ApplicationContext Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'nettyExecutorManager': Unsatisfied dependency expressed through field 'zookeeperNodeManager'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperNodeManager': Unsatisfied dependency expressed through field 'registryCenter'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperNodeManager': Unsatisfied dependency expressed through field 'registryCenter'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} 01:07:48.958 [SessionTracker] INFO org.apache.zookeeper.server.SessionTrackerImpl - SessionTrackerImpl exited loop! [INFO] [INFO] Results: [INFO] [ERROR] Errors: [ERROR] TaskPriorityQueueConsumerTest.testSHELLTask » IllegalState Failed to load Appl... [INFO] [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0 [INFO] [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 48.206 s [INFO] Finished at: 2020-07-27T01:07:49Z [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project dolphinscheduler-server: There are test failures. [ERROR] [ERROR] Please refer to /root/incubator-dolphinscheduler-github/dolphinscheduler-server/target/surefire-reports for the individual test results. [ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream. [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException ``` ## Problem analysis According to my own knowledge, I tried to solve the above problems. Because the reason is that `Autowired` errors, so I according to the prompt in the test code `dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumerTest.java`, To annotate `@ContextConfiguration` added a class `CuratorZookeeperClient.class`, problem is solved. Just like this: ```java @ContextConfiguration(classes={DependencyConfig.class, SpringApplicationContext.class, SpringZKServer.class, NettyExecutorManager.class, ExecutorDispatcher.class, ZookeeperRegistryCenter.class, TaskPriorityQueueConsumer.class, ZookeeperNodeManager.class, ZookeeperCachedOperator.class, ZookeeperConfig.class, MasterConfig.class, CuratorZookeeperClient.class}) ``` I mentioned this problem with more than one test code, but I'll summarize it now: > if the test code needs to Autowired class A objects, class A needs to Autowired class B objects. Then `A.class` appears in the context configuration, while `B.class` is not, an 'Failed to load ApplicationContext' exception will appear and the test will fail. ## Question Every time the project merges new code, it will be tested automatically. Why is this test enough to pass without these problems?
https://github.com/apache/dolphinscheduler/issues/3314
https://github.com/apache/dolphinscheduler/pull/3304
b555d0a086c88c29b40304802589b3ef77955ab9
3a0d4da27e6f981ecba7d061bad4644079ae122d
2020-07-27T02:02:58Z
java
2020-07-30T05:28:27Z
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumerTest.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.dolphinscheduler.server.master.consumer; import java.util.Date; import org.apache.dolphinscheduler.common.enums.CommandType;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,314
[Question] Why "Failed to load ApplicationContext" when running tests locally
# Why "Failed to load ApplicationContext" when running tests locally The first is the test command I ran: ``` mvn test -pl dolphinscheduler-server -Dtest =TaskPriorityQueueConsumerTest#testSHELLTask ``` It should be noted that the above test is not the only one with this problem. ## The environment in which the problem occurs The problem was originally discovered by running tests in IDEA, but also by testing directly with the 'mvn' command. - Operating system: MacOS - JAVA: 1.8.0_111 - Maven: 3.5.2 - DS version: dev branch To verify that it was a local environment problem, I created a new virtual machine to test, which had the same problem. - Operating system: CentOS 7 - JAVA: 1.8.0_221 - Maven: 3.6.3 - DS version: dev branch ## Action steps I tested it on my virtual machine using the following steps: ``` git clone ... cd incubator-dolphinscheduler-github/ git checkout dev mvn clean install -pl dolphinscheduler-common -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-dao -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-service -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-alert -am -Dmaven.test.skip=true mvn test -pl dolphinscheduler-server -Dtest=TaskPriorityQueueConsumerTest#testSHELLTask ``` ## Error log ``` [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 15.247 s <<< FAILURE! - in org.apache.dolphinscheduler.server.master.consumer.TaskPriorityQueueConsumerTest [ERROR] testSHELLTask(org.apache.dolphinscheduler.server.master.consumer.TaskPriorityQueueConsumerTest) Time elapsed: 0 s <<< ERROR! java.lang.IllegalStateException: Failed to load ApplicationContext Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'nettyExecutorManager': Unsatisfied dependency expressed through field 'zookeeperNodeManager'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperNodeManager': Unsatisfied dependency expressed through field 'registryCenter'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperNodeManager': Unsatisfied dependency expressed through field 'registryCenter'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} 01:07:48.958 [SessionTracker] INFO org.apache.zookeeper.server.SessionTrackerImpl - SessionTrackerImpl exited loop! [INFO] [INFO] Results: [INFO] [ERROR] Errors: [ERROR] TaskPriorityQueueConsumerTest.testSHELLTask » IllegalState Failed to load Appl... [INFO] [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0 [INFO] [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 48.206 s [INFO] Finished at: 2020-07-27T01:07:49Z [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project dolphinscheduler-server: There are test failures. [ERROR] [ERROR] Please refer to /root/incubator-dolphinscheduler-github/dolphinscheduler-server/target/surefire-reports for the individual test results. [ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream. [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException ``` ## Problem analysis According to my own knowledge, I tried to solve the above problems. Because the reason is that `Autowired` errors, so I according to the prompt in the test code `dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumerTest.java`, To annotate `@ContextConfiguration` added a class `CuratorZookeeperClient.class`, problem is solved. Just like this: ```java @ContextConfiguration(classes={DependencyConfig.class, SpringApplicationContext.class, SpringZKServer.class, NettyExecutorManager.class, ExecutorDispatcher.class, ZookeeperRegistryCenter.class, TaskPriorityQueueConsumer.class, ZookeeperNodeManager.class, ZookeeperCachedOperator.class, ZookeeperConfig.class, MasterConfig.class, CuratorZookeeperClient.class}) ``` I mentioned this problem with more than one test code, but I'll summarize it now: > if the test code needs to Autowired class A objects, class A needs to Autowired class B objects. Then `A.class` appears in the context configuration, while `B.class` is not, an 'Failed to load ApplicationContext' exception will appear and the test will fail. ## Question Every time the project merges new code, it will be tested automatically. Why is this test enough to pass without these problems?
https://github.com/apache/dolphinscheduler/issues/3314
https://github.com/apache/dolphinscheduler/pull/3304
b555d0a086c88c29b40304802589b3ef77955ab9
3a0d4da27e6f981ecba7d061bad4644079ae122d
2020-07-27T02:02:58Z
java
2020-07-30T05:28:27Z
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumerTest.java
import org.apache.dolphinscheduler.common.enums.DbType; import org.apache.dolphinscheduler.common.enums.ExecutionStatus; import org.apache.dolphinscheduler.common.enums.Priority; import org.apache.dolphinscheduler.common.thread.Stopper; import org.apache.dolphinscheduler.dao.entity.DataSource; import org.apache.dolphinscheduler.dao.entity.ProcessDefinition; import org.apache.dolphinscheduler.dao.entity.ProcessInstance; import org.apache.dolphinscheduler.dao.entity.TaskInstance; import org.apache.dolphinscheduler.dao.entity.Tenant; import org.apache.dolphinscheduler.server.master.config.MasterConfig; import org.apache.dolphinscheduler.server.master.dispatch.ExecutorDispatcher; import org.apache.dolphinscheduler.server.master.dispatch.executor.NettyExecutorManager; import org.apache.dolphinscheduler.server.registry.DependencyConfig; import org.apache.dolphinscheduler.server.registry.ZookeeperNodeManager; import org.apache.dolphinscheduler.server.registry.ZookeeperRegistryCenter; import org.apache.dolphinscheduler.server.zk.SpringZKServer; import org.apache.dolphinscheduler.service.bean.SpringApplicationContext; import org.apache.dolphinscheduler.service.process.ProcessService; import org.apache.dolphinscheduler.service.queue.TaskPriorityQueue; import org.apache.dolphinscheduler.service.zk.ZookeeperCachedOperator; import org.apache.dolphinscheduler.service.zk.ZookeeperConfig; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mockito; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @RunWith(SpringJUnit4ClassRunner.class)
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,314
[Question] Why "Failed to load ApplicationContext" when running tests locally
# Why "Failed to load ApplicationContext" when running tests locally The first is the test command I ran: ``` mvn test -pl dolphinscheduler-server -Dtest =TaskPriorityQueueConsumerTest#testSHELLTask ``` It should be noted that the above test is not the only one with this problem. ## The environment in which the problem occurs The problem was originally discovered by running tests in IDEA, but also by testing directly with the 'mvn' command. - Operating system: MacOS - JAVA: 1.8.0_111 - Maven: 3.5.2 - DS version: dev branch To verify that it was a local environment problem, I created a new virtual machine to test, which had the same problem. - Operating system: CentOS 7 - JAVA: 1.8.0_221 - Maven: 3.6.3 - DS version: dev branch ## Action steps I tested it on my virtual machine using the following steps: ``` git clone ... cd incubator-dolphinscheduler-github/ git checkout dev mvn clean install -pl dolphinscheduler-common -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-dao -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-service -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-alert -am -Dmaven.test.skip=true mvn test -pl dolphinscheduler-server -Dtest=TaskPriorityQueueConsumerTest#testSHELLTask ``` ## Error log ``` [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 15.247 s <<< FAILURE! - in org.apache.dolphinscheduler.server.master.consumer.TaskPriorityQueueConsumerTest [ERROR] testSHELLTask(org.apache.dolphinscheduler.server.master.consumer.TaskPriorityQueueConsumerTest) Time elapsed: 0 s <<< ERROR! java.lang.IllegalStateException: Failed to load ApplicationContext Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'nettyExecutorManager': Unsatisfied dependency expressed through field 'zookeeperNodeManager'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperNodeManager': Unsatisfied dependency expressed through field 'registryCenter'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperNodeManager': Unsatisfied dependency expressed through field 'registryCenter'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} 01:07:48.958 [SessionTracker] INFO org.apache.zookeeper.server.SessionTrackerImpl - SessionTrackerImpl exited loop! [INFO] [INFO] Results: [INFO] [ERROR] Errors: [ERROR] TaskPriorityQueueConsumerTest.testSHELLTask » IllegalState Failed to load Appl... [INFO] [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0 [INFO] [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 48.206 s [INFO] Finished at: 2020-07-27T01:07:49Z [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project dolphinscheduler-server: There are test failures. [ERROR] [ERROR] Please refer to /root/incubator-dolphinscheduler-github/dolphinscheduler-server/target/surefire-reports for the individual test results. [ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream. [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException ``` ## Problem analysis According to my own knowledge, I tried to solve the above problems. Because the reason is that `Autowired` errors, so I according to the prompt in the test code `dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumerTest.java`, To annotate `@ContextConfiguration` added a class `CuratorZookeeperClient.class`, problem is solved. Just like this: ```java @ContextConfiguration(classes={DependencyConfig.class, SpringApplicationContext.class, SpringZKServer.class, NettyExecutorManager.class, ExecutorDispatcher.class, ZookeeperRegistryCenter.class, TaskPriorityQueueConsumer.class, ZookeeperNodeManager.class, ZookeeperCachedOperator.class, ZookeeperConfig.class, MasterConfig.class, CuratorZookeeperClient.class}) ``` I mentioned this problem with more than one test code, but I'll summarize it now: > if the test code needs to Autowired class A objects, class A needs to Autowired class B objects. Then `A.class` appears in the context configuration, while `B.class` is not, an 'Failed to load ApplicationContext' exception will appear and the test will fail. ## Question Every time the project merges new code, it will be tested automatically. Why is this test enough to pass without these problems?
https://github.com/apache/dolphinscheduler/issues/3314
https://github.com/apache/dolphinscheduler/pull/3304
b555d0a086c88c29b40304802589b3ef77955ab9
3a0d4da27e6f981ecba7d061bad4644079ae122d
2020-07-27T02:02:58Z
java
2020-07-30T05:28:27Z
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumerTest.java
@ContextConfiguration(classes={DependencyConfig.class, SpringApplicationContext.class, SpringZKServer.class, NettyExecutorManager.class, ExecutorDispatcher.class, ZookeeperRegistryCenter.class, TaskPriorityQueueConsumer.class, ZookeeperNodeManager.class, ZookeeperCachedOperator.class, ZookeeperConfig.class, MasterConfig.class}) public class TaskPriorityQueueConsumerTest { @Autowired private TaskPriorityQueue taskPriorityQueue; @Autowired private TaskPriorityQueueConsumer taskPriorityQueueConsumer; @Autowired private ProcessService processService; @Autowired private ExecutorDispatcher dispatcher; @Before public void init(){ Tenant tenant = new Tenant(); tenant.setId(1); tenant.setTenantCode("journey"); tenant.setTenantName("journey"); tenant.setDescription("journey");
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,314
[Question] Why "Failed to load ApplicationContext" when running tests locally
# Why "Failed to load ApplicationContext" when running tests locally The first is the test command I ran: ``` mvn test -pl dolphinscheduler-server -Dtest =TaskPriorityQueueConsumerTest#testSHELLTask ``` It should be noted that the above test is not the only one with this problem. ## The environment in which the problem occurs The problem was originally discovered by running tests in IDEA, but also by testing directly with the 'mvn' command. - Operating system: MacOS - JAVA: 1.8.0_111 - Maven: 3.5.2 - DS version: dev branch To verify that it was a local environment problem, I created a new virtual machine to test, which had the same problem. - Operating system: CentOS 7 - JAVA: 1.8.0_221 - Maven: 3.6.3 - DS version: dev branch ## Action steps I tested it on my virtual machine using the following steps: ``` git clone ... cd incubator-dolphinscheduler-github/ git checkout dev mvn clean install -pl dolphinscheduler-common -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-dao -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-service -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-alert -am -Dmaven.test.skip=true mvn test -pl dolphinscheduler-server -Dtest=TaskPriorityQueueConsumerTest#testSHELLTask ``` ## Error log ``` [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 15.247 s <<< FAILURE! - in org.apache.dolphinscheduler.server.master.consumer.TaskPriorityQueueConsumerTest [ERROR] testSHELLTask(org.apache.dolphinscheduler.server.master.consumer.TaskPriorityQueueConsumerTest) Time elapsed: 0 s <<< ERROR! java.lang.IllegalStateException: Failed to load ApplicationContext Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'nettyExecutorManager': Unsatisfied dependency expressed through field 'zookeeperNodeManager'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperNodeManager': Unsatisfied dependency expressed through field 'registryCenter'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperNodeManager': Unsatisfied dependency expressed through field 'registryCenter'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} 01:07:48.958 [SessionTracker] INFO org.apache.zookeeper.server.SessionTrackerImpl - SessionTrackerImpl exited loop! [INFO] [INFO] Results: [INFO] [ERROR] Errors: [ERROR] TaskPriorityQueueConsumerTest.testSHELLTask » IllegalState Failed to load Appl... [INFO] [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0 [INFO] [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 48.206 s [INFO] Finished at: 2020-07-27T01:07:49Z [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project dolphinscheduler-server: There are test failures. [ERROR] [ERROR] Please refer to /root/incubator-dolphinscheduler-github/dolphinscheduler-server/target/surefire-reports for the individual test results. [ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream. [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException ``` ## Problem analysis According to my own knowledge, I tried to solve the above problems. Because the reason is that `Autowired` errors, so I according to the prompt in the test code `dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumerTest.java`, To annotate `@ContextConfiguration` added a class `CuratorZookeeperClient.class`, problem is solved. Just like this: ```java @ContextConfiguration(classes={DependencyConfig.class, SpringApplicationContext.class, SpringZKServer.class, NettyExecutorManager.class, ExecutorDispatcher.class, ZookeeperRegistryCenter.class, TaskPriorityQueueConsumer.class, ZookeeperNodeManager.class, ZookeeperCachedOperator.class, ZookeeperConfig.class, MasterConfig.class, CuratorZookeeperClient.class}) ``` I mentioned this problem with more than one test code, but I'll summarize it now: > if the test code needs to Autowired class A objects, class A needs to Autowired class B objects. Then `A.class` appears in the context configuration, while `B.class` is not, an 'Failed to load ApplicationContext' exception will appear and the test will fail. ## Question Every time the project merges new code, it will be tested automatically. Why is this test enough to pass without these problems?
https://github.com/apache/dolphinscheduler/issues/3314
https://github.com/apache/dolphinscheduler/pull/3304
b555d0a086c88c29b40304802589b3ef77955ab9
3a0d4da27e6f981ecba7d061bad4644079ae122d
2020-07-27T02:02:58Z
java
2020-07-30T05:28:27Z
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumerTest.java
tenant.setQueueId(1); tenant.setCreateTime(new Date()); tenant.setUpdateTime(new Date()); Mockito.doReturn(tenant).when(processService).getTenantForProcess(1,2); Mockito.doReturn("default").when(processService).queryUserQueueByProcessInstanceId(1); } @Test public void testSHELLTask() throws Exception { TaskInstance taskInstance = new TaskInstance(); taskInstance.setId(1); taskInstance.setTaskType("SHELL"); taskInstance.setProcessDefinitionId(1); taskInstance.setProcessInstanceId(1); taskInstance.setState(ExecutionStatus.KILL); taskInstance.setTaskJson("{\"conditionResult\":\"{\\\"successNode\\\":[\\\"\\\"],\\\"failedNode\\\":[\\\"\\\"]}\",\"conditionsTask\":false,\"depList\":[],\"dependence\":\"{}\",\"forbidden\":false,\"id\":\"tasks-55201\",\"maxRetryTimes\":0,\"name\":\"测试任务\",\"params\":\"{\\\"rawScript\\\":\\\"echo \\\\\\\"测试任务\\\\\\\"\\\",\\\"localParams\\\":[],\\\"resourceList\\\":[]}\",\"preTasks\":\"[]\",\"retryInterval\":1,\"runFlag\":\"NORMAL\",\"taskInstancePriority\":\"MEDIUM\",\"taskTimeoutParameter\":{\"enable\":false,\"interval\":0},\"timeout\":\"{\\\"enable\\\":false,\\\"strategy\\\":\\\"\\\"}\",\"type\":\"SHELL\",\"workerGroup\":\"default\"}"); taskInstance.setProcessInstancePriority(Priority.MEDIUM); taskInstance.setWorkerGroup("default"); taskInstance.setExecutorId(2); ProcessInstance processInstance = new ProcessInstance(); processInstance.setTenantId(1); processInstance.setCommandType(CommandType.START_PROCESS); taskInstance.setProcessInstance(processInstance); ProcessDefinition processDefinition = new ProcessDefinition(); processDefinition.setUserId(2); processDefinition.setProjectId(1); taskInstance.setProcessDefine(processDefinition); Mockito.doReturn(taskInstance).when(processService).getTaskInstanceDetailByTaskId(1); taskPriorityQueue.put("2_1_2_1_default"); Thread.sleep(10000); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,314
[Question] Why "Failed to load ApplicationContext" when running tests locally
# Why "Failed to load ApplicationContext" when running tests locally The first is the test command I ran: ``` mvn test -pl dolphinscheduler-server -Dtest =TaskPriorityQueueConsumerTest#testSHELLTask ``` It should be noted that the above test is not the only one with this problem. ## The environment in which the problem occurs The problem was originally discovered by running tests in IDEA, but also by testing directly with the 'mvn' command. - Operating system: MacOS - JAVA: 1.8.0_111 - Maven: 3.5.2 - DS version: dev branch To verify that it was a local environment problem, I created a new virtual machine to test, which had the same problem. - Operating system: CentOS 7 - JAVA: 1.8.0_221 - Maven: 3.6.3 - DS version: dev branch ## Action steps I tested it on my virtual machine using the following steps: ``` git clone ... cd incubator-dolphinscheduler-github/ git checkout dev mvn clean install -pl dolphinscheduler-common -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-dao -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-service -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-alert -am -Dmaven.test.skip=true mvn test -pl dolphinscheduler-server -Dtest=TaskPriorityQueueConsumerTest#testSHELLTask ``` ## Error log ``` [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 15.247 s <<< FAILURE! - in org.apache.dolphinscheduler.server.master.consumer.TaskPriorityQueueConsumerTest [ERROR] testSHELLTask(org.apache.dolphinscheduler.server.master.consumer.TaskPriorityQueueConsumerTest) Time elapsed: 0 s <<< ERROR! java.lang.IllegalStateException: Failed to load ApplicationContext Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'nettyExecutorManager': Unsatisfied dependency expressed through field 'zookeeperNodeManager'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperNodeManager': Unsatisfied dependency expressed through field 'registryCenter'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperNodeManager': Unsatisfied dependency expressed through field 'registryCenter'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} 01:07:48.958 [SessionTracker] INFO org.apache.zookeeper.server.SessionTrackerImpl - SessionTrackerImpl exited loop! [INFO] [INFO] Results: [INFO] [ERROR] Errors: [ERROR] TaskPriorityQueueConsumerTest.testSHELLTask » IllegalState Failed to load Appl... [INFO] [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0 [INFO] [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 48.206 s [INFO] Finished at: 2020-07-27T01:07:49Z [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project dolphinscheduler-server: There are test failures. [ERROR] [ERROR] Please refer to /root/incubator-dolphinscheduler-github/dolphinscheduler-server/target/surefire-reports for the individual test results. [ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream. [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException ``` ## Problem analysis According to my own knowledge, I tried to solve the above problems. Because the reason is that `Autowired` errors, so I according to the prompt in the test code `dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumerTest.java`, To annotate `@ContextConfiguration` added a class `CuratorZookeeperClient.class`, problem is solved. Just like this: ```java @ContextConfiguration(classes={DependencyConfig.class, SpringApplicationContext.class, SpringZKServer.class, NettyExecutorManager.class, ExecutorDispatcher.class, ZookeeperRegistryCenter.class, TaskPriorityQueueConsumer.class, ZookeeperNodeManager.class, ZookeeperCachedOperator.class, ZookeeperConfig.class, MasterConfig.class, CuratorZookeeperClient.class}) ``` I mentioned this problem with more than one test code, but I'll summarize it now: > if the test code needs to Autowired class A objects, class A needs to Autowired class B objects. Then `A.class` appears in the context configuration, while `B.class` is not, an 'Failed to load ApplicationContext' exception will appear and the test will fail. ## Question Every time the project merges new code, it will be tested automatically. Why is this test enough to pass without these problems?
https://github.com/apache/dolphinscheduler/issues/3314
https://github.com/apache/dolphinscheduler/pull/3304
b555d0a086c88c29b40304802589b3ef77955ab9
3a0d4da27e6f981ecba7d061bad4644079ae122d
2020-07-27T02:02:58Z
java
2020-07-30T05:28:27Z
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumerTest.java
@Test public void testSQLTask() throws Exception { TaskInstance taskInstance = new TaskInstance(); taskInstance.setId(1); taskInstance.setTaskType("SQL"); taskInstance.setProcessDefinitionId(1); taskInstance.setProcessInstanceId(1); taskInstance.setState(ExecutionStatus.KILL); taskInstance.setTaskJson("{\"conditionsTask\":false,\"depList\":[],\"dependence\":\"{}\",\"forbidden\":false,\"id\":\"tasks-3655\",\"maxRetryTimes\":0,\"name\":\"UDF测试\",\"params\":\"{\\\"postStatements\\\":[],\\\"connParams\\\":\\\"\\\",\\\"receiversCc\\\":\\\"\\\",\\\"udfs\\\":\\\"1\\\",\\\"type\\\":\\\"HIVE\\\",\\\"title\\\":\\\"test\\\",\\\"sql\\\":\\\"select id,name,ds,zodia(ds) from t_journey_user\\\",\\\"preStatements\\\":[],\\\"sqlType\\\":0,\\\"receivers\\\":\\\"[email protected]\\\",\\\"datasource\\\":3,\\\"showType\\\":\\\"TABLE\\\",\\\"localParams\\\":[]}\",\"preTasks\":\"[]\",\"retryInterval\":1,\"runFlag\":\"NORMAL\",\"taskInstancePriority\":\"MEDIUM\",\"taskTimeoutParameter\":{\"enable\":false,\"interval\":0},\"timeout\":\"{\\\"enable\\\":false,\\\"strategy\\\":\\\"\\\"}\",\"type\":\"SQL\"}"); taskInstance.setProcessInstancePriority(Priority.MEDIUM); taskInstance.setWorkerGroup("default"); taskInstance.setExecutorId(2); ProcessInstance processInstance = new ProcessInstance(); processInstance.setTenantId(1); processInstance.setCommandType(CommandType.START_PROCESS); taskInstance.setProcessInstance(processInstance); ProcessDefinition processDefinition = new ProcessDefinition(); processDefinition.setUserId(2); processDefinition.setProjectId(1); taskInstance.setProcessDefine(processDefinition); Mockito.doReturn(taskInstance).when(processService).getTaskInstanceDetailByTaskId(1); taskPriorityQueue.put("2_1_2_1_default"); DataSource dataSource = new DataSource(); dataSource.setId(1); dataSource.setName("sqlDatasource"); dataSource.setType(DbType.MYSQL); dataSource.setUserId(2); dataSource.setConnectionParams("{\"address\":\"jdbc:mysql://192.168.221.185:3306\",\"database\":\"dolphinscheduler_qiaozhanwei\",\"jdbcUrl\":\"jdbc:mysql://192.168.221.185:3306/dolphinscheduler_qiaozhanwei\",\"user\":\"root\",\"password\":\"root@123\"}"); dataSource.setCreateTime(new Date()); dataSource.setUpdateTime(new Date());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,314
[Question] Why "Failed to load ApplicationContext" when running tests locally
# Why "Failed to load ApplicationContext" when running tests locally The first is the test command I ran: ``` mvn test -pl dolphinscheduler-server -Dtest =TaskPriorityQueueConsumerTest#testSHELLTask ``` It should be noted that the above test is not the only one with this problem. ## The environment in which the problem occurs The problem was originally discovered by running tests in IDEA, but also by testing directly with the 'mvn' command. - Operating system: MacOS - JAVA: 1.8.0_111 - Maven: 3.5.2 - DS version: dev branch To verify that it was a local environment problem, I created a new virtual machine to test, which had the same problem. - Operating system: CentOS 7 - JAVA: 1.8.0_221 - Maven: 3.6.3 - DS version: dev branch ## Action steps I tested it on my virtual machine using the following steps: ``` git clone ... cd incubator-dolphinscheduler-github/ git checkout dev mvn clean install -pl dolphinscheduler-common -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-dao -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-service -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-alert -am -Dmaven.test.skip=true mvn test -pl dolphinscheduler-server -Dtest=TaskPriorityQueueConsumerTest#testSHELLTask ``` ## Error log ``` [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 15.247 s <<< FAILURE! - in org.apache.dolphinscheduler.server.master.consumer.TaskPriorityQueueConsumerTest [ERROR] testSHELLTask(org.apache.dolphinscheduler.server.master.consumer.TaskPriorityQueueConsumerTest) Time elapsed: 0 s <<< ERROR! java.lang.IllegalStateException: Failed to load ApplicationContext Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'nettyExecutorManager': Unsatisfied dependency expressed through field 'zookeeperNodeManager'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperNodeManager': Unsatisfied dependency expressed through field 'registryCenter'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperNodeManager': Unsatisfied dependency expressed through field 'registryCenter'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} 01:07:48.958 [SessionTracker] INFO org.apache.zookeeper.server.SessionTrackerImpl - SessionTrackerImpl exited loop! [INFO] [INFO] Results: [INFO] [ERROR] Errors: [ERROR] TaskPriorityQueueConsumerTest.testSHELLTask » IllegalState Failed to load Appl... [INFO] [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0 [INFO] [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 48.206 s [INFO] Finished at: 2020-07-27T01:07:49Z [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project dolphinscheduler-server: There are test failures. [ERROR] [ERROR] Please refer to /root/incubator-dolphinscheduler-github/dolphinscheduler-server/target/surefire-reports for the individual test results. [ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream. [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException ``` ## Problem analysis According to my own knowledge, I tried to solve the above problems. Because the reason is that `Autowired` errors, so I according to the prompt in the test code `dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumerTest.java`, To annotate `@ContextConfiguration` added a class `CuratorZookeeperClient.class`, problem is solved. Just like this: ```java @ContextConfiguration(classes={DependencyConfig.class, SpringApplicationContext.class, SpringZKServer.class, NettyExecutorManager.class, ExecutorDispatcher.class, ZookeeperRegistryCenter.class, TaskPriorityQueueConsumer.class, ZookeeperNodeManager.class, ZookeeperCachedOperator.class, ZookeeperConfig.class, MasterConfig.class, CuratorZookeeperClient.class}) ``` I mentioned this problem with more than one test code, but I'll summarize it now: > if the test code needs to Autowired class A objects, class A needs to Autowired class B objects. Then `A.class` appears in the context configuration, while `B.class` is not, an 'Failed to load ApplicationContext' exception will appear and the test will fail. ## Question Every time the project merges new code, it will be tested automatically. Why is this test enough to pass without these problems?
https://github.com/apache/dolphinscheduler/issues/3314
https://github.com/apache/dolphinscheduler/pull/3304
b555d0a086c88c29b40304802589b3ef77955ab9
3a0d4da27e6f981ecba7d061bad4644079ae122d
2020-07-27T02:02:58Z
java
2020-07-30T05:28:27Z
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumerTest.java
Mockito.doReturn(dataSource).when(processService).findDataSourceById(1); Thread.sleep(10000); } @Test public void testDataxTask() throws Exception { TaskInstance taskInstance = new TaskInstance(); taskInstance.setId(1); taskInstance.setTaskType("DATAX"); taskInstance.setProcessDefinitionId(1); taskInstance.setProcessInstanceId(1); taskInstance.setState(ExecutionStatus.KILL); taskInstance.setTaskJson("{\"conditionResult\":\"{\\\"successNode\\\":[\\\"\\\"],\\\"failedNode\\\":[\\\"\\\"]}\",\"conditionsTask\":false,\"depList\":[],\"dependence\":\"{}\",\"forbidden\":false,\"id\":\"tasks-97625\",\"maxRetryTimes\":0,\"name\":\"MySQL数据相互导入\",\"params\":\"{\\\"targetTable\\\":\\\"pv2\\\",\\\"postStatements\\\":[],\\\"jobSpeedRecord\\\":1000,\\\"customConfig\\\":0,\\\"dtType\\\":\\\"MYSQL\\\",\\\"dsType\\\":\\\"MYSQL\\\",\\\"jobSpeedByte\\\":0,\\\"dataSource\\\":80,\\\"dataTarget\\\":80,\\\"sql\\\":\\\"SELECT dt,count FROM pv\\\",\\\"preStatements\\\":[]}\",\"preTasks\":\"[]\",\"retryInterval\":1,\"runFlag\":\"NORMAL\",\"taskInstancePriority\":\"MEDIUM\",\"taskTimeoutParameter\":{\"enable\":false,\"interval\":0},\"timeout\":\"{\\\"enable\\\":false,\\\"strategy\\\":\\\"\\\"}\",\"type\":\"DATAX\",\"workerGroup\":\"default\"}"); taskInstance.setProcessInstancePriority(Priority.MEDIUM); taskInstance.setWorkerGroup("default"); taskInstance.setExecutorId(2); ProcessInstance processInstance = new ProcessInstance(); processInstance.setTenantId(1); processInstance.setCommandType(CommandType.START_PROCESS); taskInstance.setProcessInstance(processInstance); ProcessDefinition processDefinition = new ProcessDefinition(); processDefinition.setUserId(2); processDefinition.setProjectId(1); taskInstance.setProcessDefine(processDefinition); Mockito.doReturn(taskInstance).when(processService).getTaskInstanceDetailByTaskId(1); taskPriorityQueue.put("2_1_2_1_default"); DataSource dataSource = new DataSource(); dataSource.setId(80); dataSource.setName("datax"); dataSource.setType(DbType.MYSQL); dataSource.setUserId(2);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,314
[Question] Why "Failed to load ApplicationContext" when running tests locally
# Why "Failed to load ApplicationContext" when running tests locally The first is the test command I ran: ``` mvn test -pl dolphinscheduler-server -Dtest =TaskPriorityQueueConsumerTest#testSHELLTask ``` It should be noted that the above test is not the only one with this problem. ## The environment in which the problem occurs The problem was originally discovered by running tests in IDEA, but also by testing directly with the 'mvn' command. - Operating system: MacOS - JAVA: 1.8.0_111 - Maven: 3.5.2 - DS version: dev branch To verify that it was a local environment problem, I created a new virtual machine to test, which had the same problem. - Operating system: CentOS 7 - JAVA: 1.8.0_221 - Maven: 3.6.3 - DS version: dev branch ## Action steps I tested it on my virtual machine using the following steps: ``` git clone ... cd incubator-dolphinscheduler-github/ git checkout dev mvn clean install -pl dolphinscheduler-common -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-dao -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-service -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-alert -am -Dmaven.test.skip=true mvn test -pl dolphinscheduler-server -Dtest=TaskPriorityQueueConsumerTest#testSHELLTask ``` ## Error log ``` [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 15.247 s <<< FAILURE! - in org.apache.dolphinscheduler.server.master.consumer.TaskPriorityQueueConsumerTest [ERROR] testSHELLTask(org.apache.dolphinscheduler.server.master.consumer.TaskPriorityQueueConsumerTest) Time elapsed: 0 s <<< ERROR! java.lang.IllegalStateException: Failed to load ApplicationContext Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'nettyExecutorManager': Unsatisfied dependency expressed through field 'zookeeperNodeManager'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperNodeManager': Unsatisfied dependency expressed through field 'registryCenter'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperNodeManager': Unsatisfied dependency expressed through field 'registryCenter'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} 01:07:48.958 [SessionTracker] INFO org.apache.zookeeper.server.SessionTrackerImpl - SessionTrackerImpl exited loop! [INFO] [INFO] Results: [INFO] [ERROR] Errors: [ERROR] TaskPriorityQueueConsumerTest.testSHELLTask » IllegalState Failed to load Appl... [INFO] [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0 [INFO] [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 48.206 s [INFO] Finished at: 2020-07-27T01:07:49Z [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project dolphinscheduler-server: There are test failures. [ERROR] [ERROR] Please refer to /root/incubator-dolphinscheduler-github/dolphinscheduler-server/target/surefire-reports for the individual test results. [ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream. [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException ``` ## Problem analysis According to my own knowledge, I tried to solve the above problems. Because the reason is that `Autowired` errors, so I according to the prompt in the test code `dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumerTest.java`, To annotate `@ContextConfiguration` added a class `CuratorZookeeperClient.class`, problem is solved. Just like this: ```java @ContextConfiguration(classes={DependencyConfig.class, SpringApplicationContext.class, SpringZKServer.class, NettyExecutorManager.class, ExecutorDispatcher.class, ZookeeperRegistryCenter.class, TaskPriorityQueueConsumer.class, ZookeeperNodeManager.class, ZookeeperCachedOperator.class, ZookeeperConfig.class, MasterConfig.class, CuratorZookeeperClient.class}) ``` I mentioned this problem with more than one test code, but I'll summarize it now: > if the test code needs to Autowired class A objects, class A needs to Autowired class B objects. Then `A.class` appears in the context configuration, while `B.class` is not, an 'Failed to load ApplicationContext' exception will appear and the test will fail. ## Question Every time the project merges new code, it will be tested automatically. Why is this test enough to pass without these problems?
https://github.com/apache/dolphinscheduler/issues/3314
https://github.com/apache/dolphinscheduler/pull/3304
b555d0a086c88c29b40304802589b3ef77955ab9
3a0d4da27e6f981ecba7d061bad4644079ae122d
2020-07-27T02:02:58Z
java
2020-07-30T05:28:27Z
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumerTest.java
dataSource.setConnectionParams("{\"address\":\"jdbc:mysql://192.168.221.185:3306\",\"database\":\"dolphinscheduler_qiaozhanwei\",\"jdbcUrl\":\"jdbc:mysql://192.168.221.185:3306/dolphinscheduler_qiaozhanwei\",\"user\":\"root\",\"password\":\"root@123\"}"); dataSource.setCreateTime(new Date()); dataSource.setUpdateTime(new Date()); Mockito.doReturn(dataSource).when(processService).findDataSourceById(80); Thread.sleep(10000); } @Test public void testSqoopTask() throws Exception { TaskInstance taskInstance = new TaskInstance(); taskInstance.setId(1); taskInstance.setTaskType("SQOOP"); taskInstance.setProcessDefinitionId(1); taskInstance.setProcessInstanceId(1); taskInstance.setState(ExecutionStatus.KILL); taskInstance.setTaskJson("{\"conditionResult\":\"{\\\"successNode\\\":[\\\"\\\"],\\\"failedNode\\\":[\\\"\\\"]}\",\"conditionsTask\":false,\"depList\":[],\"dependence\":\"{}\",\"forbidden\":false,\"id\":\"tasks-63634\",\"maxRetryTimes\":0,\"name\":\"MySQL数据导入HDSF\",\"params\":\"{\\\"sourceType\\\":\\\"MYSQL\\\",\\\"targetType\\\":\\\"HDFS\\\",\\\"targetParams\\\":\\\"{\\\\\\\"targetPath\\\\\\\":\\\\\\\"/test/datatest\\\\\\\",\\\\\\\"deleteTargetDir\\\\\\\":true,\\\\\\\"fileType\\\\\\\":\\\\\\\"--as-textfile\\\\\\\",\\\\\\\"compressionCodec\\\\\\\":\\\\\\\"\\\\\\\",\\\\\\\"fieldsTerminated\\\\\\\":\\\\\\\",\\\\\\\",\\\\\\\"linesTerminated\\\\\\\":\\\\\\\"\\\\\\\\\\\\\\\\n\\\\\\\"}\\\",\\\"modelType\\\":\\\"import\\\",\\\"sourceParams\\\":\\\"{\\\\\\\"srcType\\\\\\\":\\\\\\\"MYSQL\\\\\\\",\\\\\\\"srcDatasource\\\\\\\":1,\\\\\\\"srcTable\\\\\\\":\\\\\\\"t_ds_user\\\\\\\",\\\\\\\"srcQueryType\\\\\\\":\\\\\\\"0\\\\\\\",\\\\\\\"srcQuerySql\\\\\\\":\\\\\\\"\\\\\\\",\\\\\\\"srcColumnType\\\\\\\":\\\\\\\"0\\\\\\\",\\\\\\\"srcColumns\\\\\\\":\\\\\\\"\\\\\\\",\\\\\\\"srcConditionList\\\\\\\":[],\\\\\\\"mapColumnHive\\\\\\\":[],\\\\\\\"mapColumnJava\\\\\\\":[]}\\\",\\\"localParams\\\":[],\\\"concurrency\\\":1}\",\"preTasks\":\"[]\",\"retryInterval\":1,\"runFlag\":\"NORMAL\",\"taskInstancePriority\":\"MEDIUM\",\"taskTimeoutParameter\":{\"enable\":false,\"interval\":0},\"timeout\":\"{\\\"enable\\\":false,\\\"strategy\\\":\\\"\\\"}\",\"type\":\"SQOOP\",\"workerGroup\":\"default\"}"); taskInstance.setProcessInstancePriority(Priority.MEDIUM); taskInstance.setWorkerGroup("default"); taskInstance.setExecutorId(2); ProcessInstance processInstance = new ProcessInstance(); processInstance.setTenantId(1); processInstance.setCommandType(CommandType.START_PROCESS); taskInstance.setProcessInstance(processInstance); ProcessDefinition processDefinition = new ProcessDefinition(); processDefinition.setUserId(2); processDefinition.setProjectId(1); taskInstance.setProcessDefine(processDefinition); Mockito.doReturn(taskInstance).when(processService).getTaskInstanceDetailByTaskId(1); taskPriorityQueue.put("2_1_2_1_default"); DataSource dataSource = new DataSource(); dataSource.setId(1);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,314
[Question] Why "Failed to load ApplicationContext" when running tests locally
# Why "Failed to load ApplicationContext" when running tests locally The first is the test command I ran: ``` mvn test -pl dolphinscheduler-server -Dtest =TaskPriorityQueueConsumerTest#testSHELLTask ``` It should be noted that the above test is not the only one with this problem. ## The environment in which the problem occurs The problem was originally discovered by running tests in IDEA, but also by testing directly with the 'mvn' command. - Operating system: MacOS - JAVA: 1.8.0_111 - Maven: 3.5.2 - DS version: dev branch To verify that it was a local environment problem, I created a new virtual machine to test, which had the same problem. - Operating system: CentOS 7 - JAVA: 1.8.0_221 - Maven: 3.6.3 - DS version: dev branch ## Action steps I tested it on my virtual machine using the following steps: ``` git clone ... cd incubator-dolphinscheduler-github/ git checkout dev mvn clean install -pl dolphinscheduler-common -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-dao -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-service -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-alert -am -Dmaven.test.skip=true mvn test -pl dolphinscheduler-server -Dtest=TaskPriorityQueueConsumerTest#testSHELLTask ``` ## Error log ``` [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 15.247 s <<< FAILURE! - in org.apache.dolphinscheduler.server.master.consumer.TaskPriorityQueueConsumerTest [ERROR] testSHELLTask(org.apache.dolphinscheduler.server.master.consumer.TaskPriorityQueueConsumerTest) Time elapsed: 0 s <<< ERROR! java.lang.IllegalStateException: Failed to load ApplicationContext Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'nettyExecutorManager': Unsatisfied dependency expressed through field 'zookeeperNodeManager'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperNodeManager': Unsatisfied dependency expressed through field 'registryCenter'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperNodeManager': Unsatisfied dependency expressed through field 'registryCenter'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} 01:07:48.958 [SessionTracker] INFO org.apache.zookeeper.server.SessionTrackerImpl - SessionTrackerImpl exited loop! [INFO] [INFO] Results: [INFO] [ERROR] Errors: [ERROR] TaskPriorityQueueConsumerTest.testSHELLTask » IllegalState Failed to load Appl... [INFO] [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0 [INFO] [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 48.206 s [INFO] Finished at: 2020-07-27T01:07:49Z [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project dolphinscheduler-server: There are test failures. [ERROR] [ERROR] Please refer to /root/incubator-dolphinscheduler-github/dolphinscheduler-server/target/surefire-reports for the individual test results. [ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream. [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException ``` ## Problem analysis According to my own knowledge, I tried to solve the above problems. Because the reason is that `Autowired` errors, so I according to the prompt in the test code `dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumerTest.java`, To annotate `@ContextConfiguration` added a class `CuratorZookeeperClient.class`, problem is solved. Just like this: ```java @ContextConfiguration(classes={DependencyConfig.class, SpringApplicationContext.class, SpringZKServer.class, NettyExecutorManager.class, ExecutorDispatcher.class, ZookeeperRegistryCenter.class, TaskPriorityQueueConsumer.class, ZookeeperNodeManager.class, ZookeeperCachedOperator.class, ZookeeperConfig.class, MasterConfig.class, CuratorZookeeperClient.class}) ``` I mentioned this problem with more than one test code, but I'll summarize it now: > if the test code needs to Autowired class A objects, class A needs to Autowired class B objects. Then `A.class` appears in the context configuration, while `B.class` is not, an 'Failed to load ApplicationContext' exception will appear and the test will fail. ## Question Every time the project merges new code, it will be tested automatically. Why is this test enough to pass without these problems?
https://github.com/apache/dolphinscheduler/issues/3314
https://github.com/apache/dolphinscheduler/pull/3304
b555d0a086c88c29b40304802589b3ef77955ab9
3a0d4da27e6f981ecba7d061bad4644079ae122d
2020-07-27T02:02:58Z
java
2020-07-30T05:28:27Z
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumerTest.java
dataSource.setName("datax"); dataSource.setType(DbType.MYSQL); dataSource.setUserId(2); dataSource.setConnectionParams("{\"address\":\"jdbc:mysql://192.168.221.185:3306\",\"database\":\"dolphinscheduler_qiaozhanwei\",\"jdbcUrl\":\"jdbc:mysql://192.168.221.185:3306/dolphinscheduler_qiaozhanwei\",\"user\":\"root\",\"password\":\"root@123\"}"); dataSource.setCreateTime(new Date()); dataSource.setUpdateTime(new Date()); Mockito.doReturn(dataSource).when(processService).findDataSourceById(1); Thread.sleep(10000); } @Test public void testTaskInstanceIsFinalState(){ TaskInstance taskInstance = new TaskInstance(); taskInstance.setId(1); taskInstance.setTaskType("SHELL"); taskInstance.setProcessDefinitionId(1); taskInstance.setProcessInstanceId(1); taskInstance.setState(ExecutionStatus.KILL); taskInstance.setTaskJson("{\"conditionResult\":\"{\\\"successNode\\\":[\\\"\\\"],\\\"failedNode\\\":[\\\"\\\"]}\",\"conditionsTask\":false,\"depList\":[],\"dependence\":\"{}\",\"forbidden\":false,\"id\":\"tasks-55201\",\"maxRetryTimes\":0,\"name\":\"测试任务\",\"params\":\"{\\\"rawScript\\\":\\\"echo \\\\\\\"测试任务\\\\\\\"\\\",\\\"localParams\\\":[],\\\"resourceList\\\":[]}\",\"preTasks\":\"[]\",\"retryInterval\":1,\"runFlag\":\"NORMAL\",\"taskInstancePriority\":\"MEDIUM\",\"taskTimeoutParameter\":{\"enable\":false,\"interval\":0},\"timeout\":\"{\\\"enable\\\":false,\\\"strategy\\\":\\\"\\\"}\",\"type\":\"SHELL\",\"workerGroup\":\"default\"}"); taskInstance.setProcessInstancePriority(Priority.MEDIUM); taskInstance.setWorkerGroup("default"); taskInstance.setExecutorId(2); Mockito.doReturn(taskInstance).when(processService).findTaskInstanceById(1); taskPriorityQueueConsumer.taskInstanceIsFinalState(1); } @After public void close() { Stopper.stop(); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,314
[Question] Why "Failed to load ApplicationContext" when running tests locally
# Why "Failed to load ApplicationContext" when running tests locally The first is the test command I ran: ``` mvn test -pl dolphinscheduler-server -Dtest =TaskPriorityQueueConsumerTest#testSHELLTask ``` It should be noted that the above test is not the only one with this problem. ## The environment in which the problem occurs The problem was originally discovered by running tests in IDEA, but also by testing directly with the 'mvn' command. - Operating system: MacOS - JAVA: 1.8.0_111 - Maven: 3.5.2 - DS version: dev branch To verify that it was a local environment problem, I created a new virtual machine to test, which had the same problem. - Operating system: CentOS 7 - JAVA: 1.8.0_221 - Maven: 3.6.3 - DS version: dev branch ## Action steps I tested it on my virtual machine using the following steps: ``` git clone ... cd incubator-dolphinscheduler-github/ git checkout dev mvn clean install -pl dolphinscheduler-common -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-dao -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-service -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-alert -am -Dmaven.test.skip=true mvn test -pl dolphinscheduler-server -Dtest=TaskPriorityQueueConsumerTest#testSHELLTask ``` ## Error log ``` [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 15.247 s <<< FAILURE! - in org.apache.dolphinscheduler.server.master.consumer.TaskPriorityQueueConsumerTest [ERROR] testSHELLTask(org.apache.dolphinscheduler.server.master.consumer.TaskPriorityQueueConsumerTest) Time elapsed: 0 s <<< ERROR! java.lang.IllegalStateException: Failed to load ApplicationContext Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'nettyExecutorManager': Unsatisfied dependency expressed through field 'zookeeperNodeManager'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperNodeManager': Unsatisfied dependency expressed through field 'registryCenter'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperNodeManager': Unsatisfied dependency expressed through field 'registryCenter'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} 01:07:48.958 [SessionTracker] INFO org.apache.zookeeper.server.SessionTrackerImpl - SessionTrackerImpl exited loop! [INFO] [INFO] Results: [INFO] [ERROR] Errors: [ERROR] TaskPriorityQueueConsumerTest.testSHELLTask » IllegalState Failed to load Appl... [INFO] [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0 [INFO] [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 48.206 s [INFO] Finished at: 2020-07-27T01:07:49Z [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project dolphinscheduler-server: There are test failures. [ERROR] [ERROR] Please refer to /root/incubator-dolphinscheduler-github/dolphinscheduler-server/target/surefire-reports for the individual test results. [ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream. [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException ``` ## Problem analysis According to my own knowledge, I tried to solve the above problems. Because the reason is that `Autowired` errors, so I according to the prompt in the test code `dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumerTest.java`, To annotate `@ContextConfiguration` added a class `CuratorZookeeperClient.class`, problem is solved. Just like this: ```java @ContextConfiguration(classes={DependencyConfig.class, SpringApplicationContext.class, SpringZKServer.class, NettyExecutorManager.class, ExecutorDispatcher.class, ZookeeperRegistryCenter.class, TaskPriorityQueueConsumer.class, ZookeeperNodeManager.class, ZookeeperCachedOperator.class, ZookeeperConfig.class, MasterConfig.class, CuratorZookeeperClient.class}) ``` I mentioned this problem with more than one test code, but I'll summarize it now: > if the test code needs to Autowired class A objects, class A needs to Autowired class B objects. Then `A.class` appears in the context configuration, while `B.class` is not, an 'Failed to load ApplicationContext' exception will appear and the test will fail. ## Question Every time the project merges new code, it will be tested automatically. Why is this test enough to pass without these problems?
https://github.com/apache/dolphinscheduler/issues/3314
https://github.com/apache/dolphinscheduler/pull/3304
b555d0a086c88c29b40304802589b3ef77955ab9
3a0d4da27e6f981ecba7d061bad4644079ae122d
2020-07-27T02:02:58Z
java
2020-07-30T05:28:27Z
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/registry/ZookeeperNodeManagerTest.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at *
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,314
[Question] Why "Failed to load ApplicationContext" when running tests locally
# Why "Failed to load ApplicationContext" when running tests locally The first is the test command I ran: ``` mvn test -pl dolphinscheduler-server -Dtest =TaskPriorityQueueConsumerTest#testSHELLTask ``` It should be noted that the above test is not the only one with this problem. ## The environment in which the problem occurs The problem was originally discovered by running tests in IDEA, but also by testing directly with the 'mvn' command. - Operating system: MacOS - JAVA: 1.8.0_111 - Maven: 3.5.2 - DS version: dev branch To verify that it was a local environment problem, I created a new virtual machine to test, which had the same problem. - Operating system: CentOS 7 - JAVA: 1.8.0_221 - Maven: 3.6.3 - DS version: dev branch ## Action steps I tested it on my virtual machine using the following steps: ``` git clone ... cd incubator-dolphinscheduler-github/ git checkout dev mvn clean install -pl dolphinscheduler-common -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-dao -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-service -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-alert -am -Dmaven.test.skip=true mvn test -pl dolphinscheduler-server -Dtest=TaskPriorityQueueConsumerTest#testSHELLTask ``` ## Error log ``` [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 15.247 s <<< FAILURE! - in org.apache.dolphinscheduler.server.master.consumer.TaskPriorityQueueConsumerTest [ERROR] testSHELLTask(org.apache.dolphinscheduler.server.master.consumer.TaskPriorityQueueConsumerTest) Time elapsed: 0 s <<< ERROR! java.lang.IllegalStateException: Failed to load ApplicationContext Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'nettyExecutorManager': Unsatisfied dependency expressed through field 'zookeeperNodeManager'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperNodeManager': Unsatisfied dependency expressed through field 'registryCenter'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperNodeManager': Unsatisfied dependency expressed through field 'registryCenter'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} 01:07:48.958 [SessionTracker] INFO org.apache.zookeeper.server.SessionTrackerImpl - SessionTrackerImpl exited loop! [INFO] [INFO] Results: [INFO] [ERROR] Errors: [ERROR] TaskPriorityQueueConsumerTest.testSHELLTask » IllegalState Failed to load Appl... [INFO] [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0 [INFO] [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 48.206 s [INFO] Finished at: 2020-07-27T01:07:49Z [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project dolphinscheduler-server: There are test failures. [ERROR] [ERROR] Please refer to /root/incubator-dolphinscheduler-github/dolphinscheduler-server/target/surefire-reports for the individual test results. [ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream. [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException ``` ## Problem analysis According to my own knowledge, I tried to solve the above problems. Because the reason is that `Autowired` errors, so I according to the prompt in the test code `dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumerTest.java`, To annotate `@ContextConfiguration` added a class `CuratorZookeeperClient.class`, problem is solved. Just like this: ```java @ContextConfiguration(classes={DependencyConfig.class, SpringApplicationContext.class, SpringZKServer.class, NettyExecutorManager.class, ExecutorDispatcher.class, ZookeeperRegistryCenter.class, TaskPriorityQueueConsumer.class, ZookeeperNodeManager.class, ZookeeperCachedOperator.class, ZookeeperConfig.class, MasterConfig.class, CuratorZookeeperClient.class}) ``` I mentioned this problem with more than one test code, but I'll summarize it now: > if the test code needs to Autowired class A objects, class A needs to Autowired class B objects. Then `A.class` appears in the context configuration, while `B.class` is not, an 'Failed to load ApplicationContext' exception will appear and the test will fail. ## Question Every time the project merges new code, it will be tested automatically. Why is this test enough to pass without these problems?
https://github.com/apache/dolphinscheduler/issues/3314
https://github.com/apache/dolphinscheduler/pull/3304
b555d0a086c88c29b40304802589b3ef77955ab9
3a0d4da27e6f981ecba7d061bad4644079ae122d
2020-07-27T02:02:58Z
java
2020-07-30T05:28:27Z
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/registry/ZookeeperNodeManagerTest.java
* http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.dolphinscheduler.server.registry; import java.util.Map; import java.util.Set; import org.apache.dolphinscheduler.common.utils.CollectionUtils; import org.apache.dolphinscheduler.common.utils.NetUtils; import org.apache.dolphinscheduler.server.master.config.MasterConfig; import org.apache.dolphinscheduler.server.master.registry.MasterRegistry; import org.apache.dolphinscheduler.server.worker.config.WorkerConfig; import org.apache.dolphinscheduler.server.worker.registry.WorkerRegistry; import org.apache.dolphinscheduler.server.zk.SpringZKServer; import org.apache.dolphinscheduler.service.zk.ZookeeperCachedOperator; import org.apache.dolphinscheduler.service.zk.ZookeeperConfig; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; /** * zookeeper node manager test */ @RunWith(SpringJUnit4ClassRunner.class)
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,314
[Question] Why "Failed to load ApplicationContext" when running tests locally
# Why "Failed to load ApplicationContext" when running tests locally The first is the test command I ran: ``` mvn test -pl dolphinscheduler-server -Dtest =TaskPriorityQueueConsumerTest#testSHELLTask ``` It should be noted that the above test is not the only one with this problem. ## The environment in which the problem occurs The problem was originally discovered by running tests in IDEA, but also by testing directly with the 'mvn' command. - Operating system: MacOS - JAVA: 1.8.0_111 - Maven: 3.5.2 - DS version: dev branch To verify that it was a local environment problem, I created a new virtual machine to test, which had the same problem. - Operating system: CentOS 7 - JAVA: 1.8.0_221 - Maven: 3.6.3 - DS version: dev branch ## Action steps I tested it on my virtual machine using the following steps: ``` git clone ... cd incubator-dolphinscheduler-github/ git checkout dev mvn clean install -pl dolphinscheduler-common -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-dao -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-service -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-alert -am -Dmaven.test.skip=true mvn test -pl dolphinscheduler-server -Dtest=TaskPriorityQueueConsumerTest#testSHELLTask ``` ## Error log ``` [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 15.247 s <<< FAILURE! - in org.apache.dolphinscheduler.server.master.consumer.TaskPriorityQueueConsumerTest [ERROR] testSHELLTask(org.apache.dolphinscheduler.server.master.consumer.TaskPriorityQueueConsumerTest) Time elapsed: 0 s <<< ERROR! java.lang.IllegalStateException: Failed to load ApplicationContext Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'nettyExecutorManager': Unsatisfied dependency expressed through field 'zookeeperNodeManager'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperNodeManager': Unsatisfied dependency expressed through field 'registryCenter'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperNodeManager': Unsatisfied dependency expressed through field 'registryCenter'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} 01:07:48.958 [SessionTracker] INFO org.apache.zookeeper.server.SessionTrackerImpl - SessionTrackerImpl exited loop! [INFO] [INFO] Results: [INFO] [ERROR] Errors: [ERROR] TaskPriorityQueueConsumerTest.testSHELLTask » IllegalState Failed to load Appl... [INFO] [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0 [INFO] [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 48.206 s [INFO] Finished at: 2020-07-27T01:07:49Z [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project dolphinscheduler-server: There are test failures. [ERROR] [ERROR] Please refer to /root/incubator-dolphinscheduler-github/dolphinscheduler-server/target/surefire-reports for the individual test results. [ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream. [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException ``` ## Problem analysis According to my own knowledge, I tried to solve the above problems. Because the reason is that `Autowired` errors, so I according to the prompt in the test code `dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumerTest.java`, To annotate `@ContextConfiguration` added a class `CuratorZookeeperClient.class`, problem is solved. Just like this: ```java @ContextConfiguration(classes={DependencyConfig.class, SpringApplicationContext.class, SpringZKServer.class, NettyExecutorManager.class, ExecutorDispatcher.class, ZookeeperRegistryCenter.class, TaskPriorityQueueConsumer.class, ZookeeperNodeManager.class, ZookeeperCachedOperator.class, ZookeeperConfig.class, MasterConfig.class, CuratorZookeeperClient.class}) ``` I mentioned this problem with more than one test code, but I'll summarize it now: > if the test code needs to Autowired class A objects, class A needs to Autowired class B objects. Then `A.class` appears in the context configuration, while `B.class` is not, an 'Failed to load ApplicationContext' exception will appear and the test will fail. ## Question Every time the project merges new code, it will be tested automatically. Why is this test enough to pass without these problems?
https://github.com/apache/dolphinscheduler/issues/3314
https://github.com/apache/dolphinscheduler/pull/3304
b555d0a086c88c29b40304802589b3ef77955ab9
3a0d4da27e6f981ecba7d061bad4644079ae122d
2020-07-27T02:02:58Z
java
2020-07-30T05:28:27Z
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/registry/ZookeeperNodeManagerTest.java
@ContextConfiguration(classes={DependencyConfig.class, SpringZKServer.class, MasterRegistry.class,WorkerRegistry.class, ZookeeperRegistryCenter.class, MasterConfig.class, WorkerConfig.class, ZookeeperCachedOperator.class, ZookeeperConfig.class, ZookeeperNodeManager.class}) public class ZookeeperNodeManagerTest { @Autowired private ZookeeperNodeManager zookeeperNodeManager; @Autowired private MasterRegistry masterRegistry; @Autowired private WorkerRegistry workerRegistry; @Autowired private ZookeeperRegistryCenter zookeeperRegistryCenter; @Autowired private WorkerConfig workerConfig; @Autowired private MasterConfig masterConfig; @Test public void testGetMasterNodes(){ masterRegistry.registry(); try { Thread.sleep(2000); } catch (InterruptedException ignore) { } Set<String> masterNodes = zookeeperNodeManager.getMasterNodes(); Assert.assertTrue(CollectionUtils.isNotEmpty(masterNodes)); Assert.assertEquals(1, masterNodes.size()); Assert.assertEquals(NetUtils.getHost() + ":" + masterConfig.getListenPort(), masterNodes.iterator().next()); workerRegistry.unRegistry(); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,314
[Question] Why "Failed to load ApplicationContext" when running tests locally
# Why "Failed to load ApplicationContext" when running tests locally The first is the test command I ran: ``` mvn test -pl dolphinscheduler-server -Dtest =TaskPriorityQueueConsumerTest#testSHELLTask ``` It should be noted that the above test is not the only one with this problem. ## The environment in which the problem occurs The problem was originally discovered by running tests in IDEA, but also by testing directly with the 'mvn' command. - Operating system: MacOS - JAVA: 1.8.0_111 - Maven: 3.5.2 - DS version: dev branch To verify that it was a local environment problem, I created a new virtual machine to test, which had the same problem. - Operating system: CentOS 7 - JAVA: 1.8.0_221 - Maven: 3.6.3 - DS version: dev branch ## Action steps I tested it on my virtual machine using the following steps: ``` git clone ... cd incubator-dolphinscheduler-github/ git checkout dev mvn clean install -pl dolphinscheduler-common -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-dao -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-service -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-alert -am -Dmaven.test.skip=true mvn test -pl dolphinscheduler-server -Dtest=TaskPriorityQueueConsumerTest#testSHELLTask ``` ## Error log ``` [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 15.247 s <<< FAILURE! - in org.apache.dolphinscheduler.server.master.consumer.TaskPriorityQueueConsumerTest [ERROR] testSHELLTask(org.apache.dolphinscheduler.server.master.consumer.TaskPriorityQueueConsumerTest) Time elapsed: 0 s <<< ERROR! java.lang.IllegalStateException: Failed to load ApplicationContext Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'nettyExecutorManager': Unsatisfied dependency expressed through field 'zookeeperNodeManager'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperNodeManager': Unsatisfied dependency expressed through field 'registryCenter'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperNodeManager': Unsatisfied dependency expressed through field 'registryCenter'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} 01:07:48.958 [SessionTracker] INFO org.apache.zookeeper.server.SessionTrackerImpl - SessionTrackerImpl exited loop! [INFO] [INFO] Results: [INFO] [ERROR] Errors: [ERROR] TaskPriorityQueueConsumerTest.testSHELLTask » IllegalState Failed to load Appl... [INFO] [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0 [INFO] [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 48.206 s [INFO] Finished at: 2020-07-27T01:07:49Z [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project dolphinscheduler-server: There are test failures. [ERROR] [ERROR] Please refer to /root/incubator-dolphinscheduler-github/dolphinscheduler-server/target/surefire-reports for the individual test results. [ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream. [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException ``` ## Problem analysis According to my own knowledge, I tried to solve the above problems. Because the reason is that `Autowired` errors, so I according to the prompt in the test code `dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumerTest.java`, To annotate `@ContextConfiguration` added a class `CuratorZookeeperClient.class`, problem is solved. Just like this: ```java @ContextConfiguration(classes={DependencyConfig.class, SpringApplicationContext.class, SpringZKServer.class, NettyExecutorManager.class, ExecutorDispatcher.class, ZookeeperRegistryCenter.class, TaskPriorityQueueConsumer.class, ZookeeperNodeManager.class, ZookeeperCachedOperator.class, ZookeeperConfig.class, MasterConfig.class, CuratorZookeeperClient.class}) ``` I mentioned this problem with more than one test code, but I'll summarize it now: > if the test code needs to Autowired class A objects, class A needs to Autowired class B objects. Then `A.class` appears in the context configuration, while `B.class` is not, an 'Failed to load ApplicationContext' exception will appear and the test will fail. ## Question Every time the project merges new code, it will be tested automatically. Why is this test enough to pass without these problems?
https://github.com/apache/dolphinscheduler/issues/3314
https://github.com/apache/dolphinscheduler/pull/3304
b555d0a086c88c29b40304802589b3ef77955ab9
3a0d4da27e6f981ecba7d061bad4644079ae122d
2020-07-27T02:02:58Z
java
2020-07-30T05:28:27Z
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/registry/ZookeeperNodeManagerTest.java
@Test public void testGetWorkerGroupNodes(){ workerRegistry.registry(); try { Thread.sleep(2000); } catch (InterruptedException ignore) { } Map<String, Set<String>> workerGroupNodes = zookeeperNodeManager.getWorkerGroupNodes(); Assert.assertEquals(1, workerGroupNodes.size()); Assert.assertEquals("default".trim(), workerGroupNodes.keySet().iterator().next()); workerRegistry.unRegistry(); } @Test public void testGetWorkerGroupNodesWithParam(){ workerRegistry.registry(); try { Thread.sleep(3000); } catch (InterruptedException ignore) { } Map<String, Set<String>> workerGroupNodes = zookeeperNodeManager.getWorkerGroupNodes(); Set<String> workerNodes = zookeeperNodeManager.getWorkerGroupNodes("default"); Assert.assertTrue(CollectionUtils.isNotEmpty(workerNodes)); Assert.assertEquals(1, workerNodes.size()); Assert.assertEquals(NetUtils.getHost() + ":" + workerConfig.getListenPort(), workerNodes.iterator().next()); workerRegistry.unRegistry(); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,314
[Question] Why "Failed to load ApplicationContext" when running tests locally
# Why "Failed to load ApplicationContext" when running tests locally The first is the test command I ran: ``` mvn test -pl dolphinscheduler-server -Dtest =TaskPriorityQueueConsumerTest#testSHELLTask ``` It should be noted that the above test is not the only one with this problem. ## The environment in which the problem occurs The problem was originally discovered by running tests in IDEA, but also by testing directly with the 'mvn' command. - Operating system: MacOS - JAVA: 1.8.0_111 - Maven: 3.5.2 - DS version: dev branch To verify that it was a local environment problem, I created a new virtual machine to test, which had the same problem. - Operating system: CentOS 7 - JAVA: 1.8.0_221 - Maven: 3.6.3 - DS version: dev branch ## Action steps I tested it on my virtual machine using the following steps: ``` git clone ... cd incubator-dolphinscheduler-github/ git checkout dev mvn clean install -pl dolphinscheduler-common -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-dao -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-service -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-alert -am -Dmaven.test.skip=true mvn test -pl dolphinscheduler-server -Dtest=TaskPriorityQueueConsumerTest#testSHELLTask ``` ## Error log ``` [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 15.247 s <<< FAILURE! - in org.apache.dolphinscheduler.server.master.consumer.TaskPriorityQueueConsumerTest [ERROR] testSHELLTask(org.apache.dolphinscheduler.server.master.consumer.TaskPriorityQueueConsumerTest) Time elapsed: 0 s <<< ERROR! java.lang.IllegalStateException: Failed to load ApplicationContext Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'nettyExecutorManager': Unsatisfied dependency expressed through field 'zookeeperNodeManager'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperNodeManager': Unsatisfied dependency expressed through field 'registryCenter'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperNodeManager': Unsatisfied dependency expressed through field 'registryCenter'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} 01:07:48.958 [SessionTracker] INFO org.apache.zookeeper.server.SessionTrackerImpl - SessionTrackerImpl exited loop! [INFO] [INFO] Results: [INFO] [ERROR] Errors: [ERROR] TaskPriorityQueueConsumerTest.testSHELLTask » IllegalState Failed to load Appl... [INFO] [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0 [INFO] [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 48.206 s [INFO] Finished at: 2020-07-27T01:07:49Z [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project dolphinscheduler-server: There are test failures. [ERROR] [ERROR] Please refer to /root/incubator-dolphinscheduler-github/dolphinscheduler-server/target/surefire-reports for the individual test results. [ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream. [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException ``` ## Problem analysis According to my own knowledge, I tried to solve the above problems. Because the reason is that `Autowired` errors, so I according to the prompt in the test code `dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumerTest.java`, To annotate `@ContextConfiguration` added a class `CuratorZookeeperClient.class`, problem is solved. Just like this: ```java @ContextConfiguration(classes={DependencyConfig.class, SpringApplicationContext.class, SpringZKServer.class, NettyExecutorManager.class, ExecutorDispatcher.class, ZookeeperRegistryCenter.class, TaskPriorityQueueConsumer.class, ZookeeperNodeManager.class, ZookeeperCachedOperator.class, ZookeeperConfig.class, MasterConfig.class, CuratorZookeeperClient.class}) ``` I mentioned this problem with more than one test code, but I'll summarize it now: > if the test code needs to Autowired class A objects, class A needs to Autowired class B objects. Then `A.class` appears in the context configuration, while `B.class` is not, an 'Failed to load ApplicationContext' exception will appear and the test will fail. ## Question Every time the project merges new code, it will be tested automatically. Why is this test enough to pass without these problems?
https://github.com/apache/dolphinscheduler/issues/3314
https://github.com/apache/dolphinscheduler/pull/3304
b555d0a086c88c29b40304802589b3ef77955ab9
3a0d4da27e6f981ecba7d061bad4644079ae122d
2020-07-27T02:02:58Z
java
2020-07-30T05:28:27Z
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/processor/TaskCallbackServiceTest.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http:www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.dolphinscheduler.server.worker.processor; import java.util.Date; import org.apache.dolphinscheduler.common.thread.Stopper; import org.apache.dolphinscheduler.common.utils.JSONUtils; import org.apache.dolphinscheduler.remote.NettyRemotingClient; import org.apache.dolphinscheduler.remote.NettyRemotingServer; import org.apache.dolphinscheduler.remote.command.CommandType; import org.apache.dolphinscheduler.remote.command.TaskExecuteAckCommand; import org.apache.dolphinscheduler.remote.command.TaskExecuteRequestCommand;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,314
[Question] Why "Failed to load ApplicationContext" when running tests locally
# Why "Failed to load ApplicationContext" when running tests locally The first is the test command I ran: ``` mvn test -pl dolphinscheduler-server -Dtest =TaskPriorityQueueConsumerTest#testSHELLTask ``` It should be noted that the above test is not the only one with this problem. ## The environment in which the problem occurs The problem was originally discovered by running tests in IDEA, but also by testing directly with the 'mvn' command. - Operating system: MacOS - JAVA: 1.8.0_111 - Maven: 3.5.2 - DS version: dev branch To verify that it was a local environment problem, I created a new virtual machine to test, which had the same problem. - Operating system: CentOS 7 - JAVA: 1.8.0_221 - Maven: 3.6.3 - DS version: dev branch ## Action steps I tested it on my virtual machine using the following steps: ``` git clone ... cd incubator-dolphinscheduler-github/ git checkout dev mvn clean install -pl dolphinscheduler-common -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-dao -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-service -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-alert -am -Dmaven.test.skip=true mvn test -pl dolphinscheduler-server -Dtest=TaskPriorityQueueConsumerTest#testSHELLTask ``` ## Error log ``` [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 15.247 s <<< FAILURE! - in org.apache.dolphinscheduler.server.master.consumer.TaskPriorityQueueConsumerTest [ERROR] testSHELLTask(org.apache.dolphinscheduler.server.master.consumer.TaskPriorityQueueConsumerTest) Time elapsed: 0 s <<< ERROR! java.lang.IllegalStateException: Failed to load ApplicationContext Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'nettyExecutorManager': Unsatisfied dependency expressed through field 'zookeeperNodeManager'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperNodeManager': Unsatisfied dependency expressed through field 'registryCenter'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperNodeManager': Unsatisfied dependency expressed through field 'registryCenter'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} 01:07:48.958 [SessionTracker] INFO org.apache.zookeeper.server.SessionTrackerImpl - SessionTrackerImpl exited loop! [INFO] [INFO] Results: [INFO] [ERROR] Errors: [ERROR] TaskPriorityQueueConsumerTest.testSHELLTask » IllegalState Failed to load Appl... [INFO] [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0 [INFO] [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 48.206 s [INFO] Finished at: 2020-07-27T01:07:49Z [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project dolphinscheduler-server: There are test failures. [ERROR] [ERROR] Please refer to /root/incubator-dolphinscheduler-github/dolphinscheduler-server/target/surefire-reports for the individual test results. [ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream. [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException ``` ## Problem analysis According to my own knowledge, I tried to solve the above problems. Because the reason is that `Autowired` errors, so I according to the prompt in the test code `dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumerTest.java`, To annotate `@ContextConfiguration` added a class `CuratorZookeeperClient.class`, problem is solved. Just like this: ```java @ContextConfiguration(classes={DependencyConfig.class, SpringApplicationContext.class, SpringZKServer.class, NettyExecutorManager.class, ExecutorDispatcher.class, ZookeeperRegistryCenter.class, TaskPriorityQueueConsumer.class, ZookeeperNodeManager.class, ZookeeperCachedOperator.class, ZookeeperConfig.class, MasterConfig.class, CuratorZookeeperClient.class}) ``` I mentioned this problem with more than one test code, but I'll summarize it now: > if the test code needs to Autowired class A objects, class A needs to Autowired class B objects. Then `A.class` appears in the context configuration, while `B.class` is not, an 'Failed to load ApplicationContext' exception will appear and the test will fail. ## Question Every time the project merges new code, it will be tested automatically. Why is this test enough to pass without these problems?
https://github.com/apache/dolphinscheduler/issues/3314
https://github.com/apache/dolphinscheduler/pull/3304
b555d0a086c88c29b40304802589b3ef77955ab9
3a0d4da27e6f981ecba7d061bad4644079ae122d
2020-07-27T02:02:58Z
java
2020-07-30T05:28:27Z
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/processor/TaskCallbackServiceTest.java
import org.apache.dolphinscheduler.remote.command.TaskExecuteResponseCommand; import org.apache.dolphinscheduler.remote.config.NettyClientConfig; import org.apache.dolphinscheduler.remote.config.NettyServerConfig; import org.apache.dolphinscheduler.remote.utils.Host; import org.apache.dolphinscheduler.server.entity.TaskExecutionContext; import org.apache.dolphinscheduler.server.master.config.MasterConfig; import org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor; import org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor; import org.apache.dolphinscheduler.server.master.processor.queue.TaskResponseService; import org.apache.dolphinscheduler.server.master.registry.MasterRegistry; import org.apache.dolphinscheduler.server.registry.ZookeeperNodeManager; import org.apache.dolphinscheduler.server.registry.ZookeeperRegistryCenter; import org.apache.dolphinscheduler.server.worker.config.WorkerConfig; import org.apache.dolphinscheduler.server.worker.registry.WorkerRegistry; import org.apache.dolphinscheduler.server.zk.SpringZKServer; import org.apache.dolphinscheduler.service.bean.SpringApplicationContext; import org.apache.dolphinscheduler.service.zk.ZookeeperCachedOperator; import org.apache.dolphinscheduler.service.zk.ZookeeperConfig; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mockito; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import io.netty.channel.Channel; /** * test task call back service */ @RunWith(SpringJUnit4ClassRunner.class)
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,314
[Question] Why "Failed to load ApplicationContext" when running tests locally
# Why "Failed to load ApplicationContext" when running tests locally The first is the test command I ran: ``` mvn test -pl dolphinscheduler-server -Dtest =TaskPriorityQueueConsumerTest#testSHELLTask ``` It should be noted that the above test is not the only one with this problem. ## The environment in which the problem occurs The problem was originally discovered by running tests in IDEA, but also by testing directly with the 'mvn' command. - Operating system: MacOS - JAVA: 1.8.0_111 - Maven: 3.5.2 - DS version: dev branch To verify that it was a local environment problem, I created a new virtual machine to test, which had the same problem. - Operating system: CentOS 7 - JAVA: 1.8.0_221 - Maven: 3.6.3 - DS version: dev branch ## Action steps I tested it on my virtual machine using the following steps: ``` git clone ... cd incubator-dolphinscheduler-github/ git checkout dev mvn clean install -pl dolphinscheduler-common -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-dao -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-service -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-alert -am -Dmaven.test.skip=true mvn test -pl dolphinscheduler-server -Dtest=TaskPriorityQueueConsumerTest#testSHELLTask ``` ## Error log ``` [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 15.247 s <<< FAILURE! - in org.apache.dolphinscheduler.server.master.consumer.TaskPriorityQueueConsumerTest [ERROR] testSHELLTask(org.apache.dolphinscheduler.server.master.consumer.TaskPriorityQueueConsumerTest) Time elapsed: 0 s <<< ERROR! java.lang.IllegalStateException: Failed to load ApplicationContext Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'nettyExecutorManager': Unsatisfied dependency expressed through field 'zookeeperNodeManager'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperNodeManager': Unsatisfied dependency expressed through field 'registryCenter'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperNodeManager': Unsatisfied dependency expressed through field 'registryCenter'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} 01:07:48.958 [SessionTracker] INFO org.apache.zookeeper.server.SessionTrackerImpl - SessionTrackerImpl exited loop! [INFO] [INFO] Results: [INFO] [ERROR] Errors: [ERROR] TaskPriorityQueueConsumerTest.testSHELLTask » IllegalState Failed to load Appl... [INFO] [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0 [INFO] [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 48.206 s [INFO] Finished at: 2020-07-27T01:07:49Z [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project dolphinscheduler-server: There are test failures. [ERROR] [ERROR] Please refer to /root/incubator-dolphinscheduler-github/dolphinscheduler-server/target/surefire-reports for the individual test results. [ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream. [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException ``` ## Problem analysis According to my own knowledge, I tried to solve the above problems. Because the reason is that `Autowired` errors, so I according to the prompt in the test code `dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumerTest.java`, To annotate `@ContextConfiguration` added a class `CuratorZookeeperClient.class`, problem is solved. Just like this: ```java @ContextConfiguration(classes={DependencyConfig.class, SpringApplicationContext.class, SpringZKServer.class, NettyExecutorManager.class, ExecutorDispatcher.class, ZookeeperRegistryCenter.class, TaskPriorityQueueConsumer.class, ZookeeperNodeManager.class, ZookeeperCachedOperator.class, ZookeeperConfig.class, MasterConfig.class, CuratorZookeeperClient.class}) ``` I mentioned this problem with more than one test code, but I'll summarize it now: > if the test code needs to Autowired class A objects, class A needs to Autowired class B objects. Then `A.class` appears in the context configuration, while `B.class` is not, an 'Failed to load ApplicationContext' exception will appear and the test will fail. ## Question Every time the project merges new code, it will be tested automatically. Why is this test enough to pass without these problems?
https://github.com/apache/dolphinscheduler/issues/3314
https://github.com/apache/dolphinscheduler/pull/3304
b555d0a086c88c29b40304802589b3ef77955ab9
3a0d4da27e6f981ecba7d061bad4644079ae122d
2020-07-27T02:02:58Z
java
2020-07-30T05:28:27Z
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/processor/TaskCallbackServiceTest.java
@ContextConfiguration(classes={ TaskCallbackServiceTestConfig.class, SpringZKServer.class, SpringApplicationContext.class, MasterRegistry.class, WorkerRegistry.class, ZookeeperRegistryCenter.class, MasterConfig.class, WorkerConfig.class,
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,314
[Question] Why "Failed to load ApplicationContext" when running tests locally
# Why "Failed to load ApplicationContext" when running tests locally The first is the test command I ran: ``` mvn test -pl dolphinscheduler-server -Dtest =TaskPriorityQueueConsumerTest#testSHELLTask ``` It should be noted that the above test is not the only one with this problem. ## The environment in which the problem occurs The problem was originally discovered by running tests in IDEA, but also by testing directly with the 'mvn' command. - Operating system: MacOS - JAVA: 1.8.0_111 - Maven: 3.5.2 - DS version: dev branch To verify that it was a local environment problem, I created a new virtual machine to test, which had the same problem. - Operating system: CentOS 7 - JAVA: 1.8.0_221 - Maven: 3.6.3 - DS version: dev branch ## Action steps I tested it on my virtual machine using the following steps: ``` git clone ... cd incubator-dolphinscheduler-github/ git checkout dev mvn clean install -pl dolphinscheduler-common -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-dao -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-service -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-alert -am -Dmaven.test.skip=true mvn test -pl dolphinscheduler-server -Dtest=TaskPriorityQueueConsumerTest#testSHELLTask ``` ## Error log ``` [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 15.247 s <<< FAILURE! - in org.apache.dolphinscheduler.server.master.consumer.TaskPriorityQueueConsumerTest [ERROR] testSHELLTask(org.apache.dolphinscheduler.server.master.consumer.TaskPriorityQueueConsumerTest) Time elapsed: 0 s <<< ERROR! java.lang.IllegalStateException: Failed to load ApplicationContext Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'nettyExecutorManager': Unsatisfied dependency expressed through field 'zookeeperNodeManager'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperNodeManager': Unsatisfied dependency expressed through field 'registryCenter'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperNodeManager': Unsatisfied dependency expressed through field 'registryCenter'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} 01:07:48.958 [SessionTracker] INFO org.apache.zookeeper.server.SessionTrackerImpl - SessionTrackerImpl exited loop! [INFO] [INFO] Results: [INFO] [ERROR] Errors: [ERROR] TaskPriorityQueueConsumerTest.testSHELLTask » IllegalState Failed to load Appl... [INFO] [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0 [INFO] [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 48.206 s [INFO] Finished at: 2020-07-27T01:07:49Z [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project dolphinscheduler-server: There are test failures. [ERROR] [ERROR] Please refer to /root/incubator-dolphinscheduler-github/dolphinscheduler-server/target/surefire-reports for the individual test results. [ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream. [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException ``` ## Problem analysis According to my own knowledge, I tried to solve the above problems. Because the reason is that `Autowired` errors, so I according to the prompt in the test code `dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumerTest.java`, To annotate `@ContextConfiguration` added a class `CuratorZookeeperClient.class`, problem is solved. Just like this: ```java @ContextConfiguration(classes={DependencyConfig.class, SpringApplicationContext.class, SpringZKServer.class, NettyExecutorManager.class, ExecutorDispatcher.class, ZookeeperRegistryCenter.class, TaskPriorityQueueConsumer.class, ZookeeperNodeManager.class, ZookeeperCachedOperator.class, ZookeeperConfig.class, MasterConfig.class, CuratorZookeeperClient.class}) ``` I mentioned this problem with more than one test code, but I'll summarize it now: > if the test code needs to Autowired class A objects, class A needs to Autowired class B objects. Then `A.class` appears in the context configuration, while `B.class` is not, an 'Failed to load ApplicationContext' exception will appear and the test will fail. ## Question Every time the project merges new code, it will be tested automatically. Why is this test enough to pass without these problems?
https://github.com/apache/dolphinscheduler/issues/3314
https://github.com/apache/dolphinscheduler/pull/3304
b555d0a086c88c29b40304802589b3ef77955ab9
3a0d4da27e6f981ecba7d061bad4644079ae122d
2020-07-27T02:02:58Z
java
2020-07-30T05:28:27Z
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/processor/TaskCallbackServiceTest.java
ZookeeperCachedOperator.class, ZookeeperConfig.class, ZookeeperNodeManager.class, TaskCallbackService.class, TaskResponseService.class, TaskAckProcessor.class, TaskResponseProcessor.class, TaskExecuteProcessor.class}) public class TaskCallbackServiceTest { @Autowired private TaskCallbackService taskCallbackService; @Autowired private MasterRegistry masterRegistry; @Autowired private TaskAckProcessor taskAckProcessor; @Autowired private TaskResponseProcessor taskResponseProcessor; @Autowired private TaskExecuteProcessor taskExecuteProcessor; /** * send ack test * @throws Exception */ @Test public void testSendAck() throws Exception{ final NettyServerConfig serverConfig = new NettyServerConfig(); serverConfig.setListenPort(30000); NettyRemotingServer nettyRemotingServer = new NettyRemotingServer(serverConfig); nettyRemotingServer.registerProcessor(CommandType.TASK_EXECUTE_ACK, taskAckProcessor); nettyRemotingServer.start();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,314
[Question] Why "Failed to load ApplicationContext" when running tests locally
# Why "Failed to load ApplicationContext" when running tests locally The first is the test command I ran: ``` mvn test -pl dolphinscheduler-server -Dtest =TaskPriorityQueueConsumerTest#testSHELLTask ``` It should be noted that the above test is not the only one with this problem. ## The environment in which the problem occurs The problem was originally discovered by running tests in IDEA, but also by testing directly with the 'mvn' command. - Operating system: MacOS - JAVA: 1.8.0_111 - Maven: 3.5.2 - DS version: dev branch To verify that it was a local environment problem, I created a new virtual machine to test, which had the same problem. - Operating system: CentOS 7 - JAVA: 1.8.0_221 - Maven: 3.6.3 - DS version: dev branch ## Action steps I tested it on my virtual machine using the following steps: ``` git clone ... cd incubator-dolphinscheduler-github/ git checkout dev mvn clean install -pl dolphinscheduler-common -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-dao -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-service -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-alert -am -Dmaven.test.skip=true mvn test -pl dolphinscheduler-server -Dtest=TaskPriorityQueueConsumerTest#testSHELLTask ``` ## Error log ``` [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 15.247 s <<< FAILURE! - in org.apache.dolphinscheduler.server.master.consumer.TaskPriorityQueueConsumerTest [ERROR] testSHELLTask(org.apache.dolphinscheduler.server.master.consumer.TaskPriorityQueueConsumerTest) Time elapsed: 0 s <<< ERROR! java.lang.IllegalStateException: Failed to load ApplicationContext Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'nettyExecutorManager': Unsatisfied dependency expressed through field 'zookeeperNodeManager'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperNodeManager': Unsatisfied dependency expressed through field 'registryCenter'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperNodeManager': Unsatisfied dependency expressed through field 'registryCenter'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} 01:07:48.958 [SessionTracker] INFO org.apache.zookeeper.server.SessionTrackerImpl - SessionTrackerImpl exited loop! [INFO] [INFO] Results: [INFO] [ERROR] Errors: [ERROR] TaskPriorityQueueConsumerTest.testSHELLTask » IllegalState Failed to load Appl... [INFO] [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0 [INFO] [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 48.206 s [INFO] Finished at: 2020-07-27T01:07:49Z [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project dolphinscheduler-server: There are test failures. [ERROR] [ERROR] Please refer to /root/incubator-dolphinscheduler-github/dolphinscheduler-server/target/surefire-reports for the individual test results. [ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream. [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException ``` ## Problem analysis According to my own knowledge, I tried to solve the above problems. Because the reason is that `Autowired` errors, so I according to the prompt in the test code `dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumerTest.java`, To annotate `@ContextConfiguration` added a class `CuratorZookeeperClient.class`, problem is solved. Just like this: ```java @ContextConfiguration(classes={DependencyConfig.class, SpringApplicationContext.class, SpringZKServer.class, NettyExecutorManager.class, ExecutorDispatcher.class, ZookeeperRegistryCenter.class, TaskPriorityQueueConsumer.class, ZookeeperNodeManager.class, ZookeeperCachedOperator.class, ZookeeperConfig.class, MasterConfig.class, CuratorZookeeperClient.class}) ``` I mentioned this problem with more than one test code, but I'll summarize it now: > if the test code needs to Autowired class A objects, class A needs to Autowired class B objects. Then `A.class` appears in the context configuration, while `B.class` is not, an 'Failed to load ApplicationContext' exception will appear and the test will fail. ## Question Every time the project merges new code, it will be tested automatically. Why is this test enough to pass without these problems?
https://github.com/apache/dolphinscheduler/issues/3314
https://github.com/apache/dolphinscheduler/pull/3304
b555d0a086c88c29b40304802589b3ef77955ab9
3a0d4da27e6f981ecba7d061bad4644079ae122d
2020-07-27T02:02:58Z
java
2020-07-30T05:28:27Z
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/processor/TaskCallbackServiceTest.java
final NettyClientConfig clientConfig = new NettyClientConfig(); NettyRemotingClient nettyRemotingClient = new NettyRemotingClient(clientConfig); Channel channel = nettyRemotingClient.getChannel(Host.of("localhost:30000")); taskCallbackService.addRemoteChannel(1, new NettyRemoteChannel(channel, 1)); TaskExecuteAckCommand ackCommand = new TaskExecuteAckCommand(); ackCommand.setTaskInstanceId(1); ackCommand.setStartTime(new Date()); taskCallbackService.sendAck(1, ackCommand.convert2Command()); Stopper.stop(); nettyRemotingServer.close(); nettyRemotingClient.close(); } /** * send result test * @throws Exception */ @Test public void testSendResult() throws Exception{ final NettyServerConfig serverConfig = new NettyServerConfig(); serverConfig.setListenPort(30000); NettyRemotingServer nettyRemotingServer = new NettyRemotingServer(serverConfig); nettyRemotingServer.registerProcessor(CommandType.TASK_EXECUTE_RESPONSE, taskResponseProcessor); nettyRemotingServer.start(); final NettyClientConfig clientConfig = new NettyClientConfig(); NettyRemotingClient nettyRemotingClient = new NettyRemotingClient(clientConfig); Channel channel = nettyRemotingClient.getChannel(Host.of("localhost:30000")); taskCallbackService.addRemoteChannel(1, new NettyRemoteChannel(channel, 1)); TaskExecuteResponseCommand responseCommand = new TaskExecuteResponseCommand(); responseCommand.setTaskInstanceId(1); responseCommand.setEndTime(new Date());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,314
[Question] Why "Failed to load ApplicationContext" when running tests locally
# Why "Failed to load ApplicationContext" when running tests locally The first is the test command I ran: ``` mvn test -pl dolphinscheduler-server -Dtest =TaskPriorityQueueConsumerTest#testSHELLTask ``` It should be noted that the above test is not the only one with this problem. ## The environment in which the problem occurs The problem was originally discovered by running tests in IDEA, but also by testing directly with the 'mvn' command. - Operating system: MacOS - JAVA: 1.8.0_111 - Maven: 3.5.2 - DS version: dev branch To verify that it was a local environment problem, I created a new virtual machine to test, which had the same problem. - Operating system: CentOS 7 - JAVA: 1.8.0_221 - Maven: 3.6.3 - DS version: dev branch ## Action steps I tested it on my virtual machine using the following steps: ``` git clone ... cd incubator-dolphinscheduler-github/ git checkout dev mvn clean install -pl dolphinscheduler-common -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-dao -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-service -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-alert -am -Dmaven.test.skip=true mvn test -pl dolphinscheduler-server -Dtest=TaskPriorityQueueConsumerTest#testSHELLTask ``` ## Error log ``` [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 15.247 s <<< FAILURE! - in org.apache.dolphinscheduler.server.master.consumer.TaskPriorityQueueConsumerTest [ERROR] testSHELLTask(org.apache.dolphinscheduler.server.master.consumer.TaskPriorityQueueConsumerTest) Time elapsed: 0 s <<< ERROR! java.lang.IllegalStateException: Failed to load ApplicationContext Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'nettyExecutorManager': Unsatisfied dependency expressed through field 'zookeeperNodeManager'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperNodeManager': Unsatisfied dependency expressed through field 'registryCenter'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperNodeManager': Unsatisfied dependency expressed through field 'registryCenter'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} 01:07:48.958 [SessionTracker] INFO org.apache.zookeeper.server.SessionTrackerImpl - SessionTrackerImpl exited loop! [INFO] [INFO] Results: [INFO] [ERROR] Errors: [ERROR] TaskPriorityQueueConsumerTest.testSHELLTask » IllegalState Failed to load Appl... [INFO] [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0 [INFO] [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 48.206 s [INFO] Finished at: 2020-07-27T01:07:49Z [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project dolphinscheduler-server: There are test failures. [ERROR] [ERROR] Please refer to /root/incubator-dolphinscheduler-github/dolphinscheduler-server/target/surefire-reports for the individual test results. [ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream. [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException ``` ## Problem analysis According to my own knowledge, I tried to solve the above problems. Because the reason is that `Autowired` errors, so I according to the prompt in the test code `dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumerTest.java`, To annotate `@ContextConfiguration` added a class `CuratorZookeeperClient.class`, problem is solved. Just like this: ```java @ContextConfiguration(classes={DependencyConfig.class, SpringApplicationContext.class, SpringZKServer.class, NettyExecutorManager.class, ExecutorDispatcher.class, ZookeeperRegistryCenter.class, TaskPriorityQueueConsumer.class, ZookeeperNodeManager.class, ZookeeperCachedOperator.class, ZookeeperConfig.class, MasterConfig.class, CuratorZookeeperClient.class}) ``` I mentioned this problem with more than one test code, but I'll summarize it now: > if the test code needs to Autowired class A objects, class A needs to Autowired class B objects. Then `A.class` appears in the context configuration, while `B.class` is not, an 'Failed to load ApplicationContext' exception will appear and the test will fail. ## Question Every time the project merges new code, it will be tested automatically. Why is this test enough to pass without these problems?
https://github.com/apache/dolphinscheduler/issues/3314
https://github.com/apache/dolphinscheduler/pull/3304
b555d0a086c88c29b40304802589b3ef77955ab9
3a0d4da27e6f981ecba7d061bad4644079ae122d
2020-07-27T02:02:58Z
java
2020-07-30T05:28:27Z
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/processor/TaskCallbackServiceTest.java
taskCallbackService.sendResult(1, responseCommand.convert2Command()); Thread.sleep(5000); Stopper.stop(); Thread.sleep(5000); nettyRemotingServer.close(); nettyRemotingClient.close(); } @Test(expected = IllegalArgumentException.class) public void testSendAckWithIllegalArgumentException(){ TaskExecuteAckCommand ackCommand = Mockito.mock(TaskExecuteAckCommand.class); taskCallbackService.sendAck(1, ackCommand.convert2Command()); Stopper.stop(); } @Test public void testPause(){ Assert.assertEquals(5000, taskCallbackService.pause(3));; } @Test public void testSendAck1(){ masterRegistry.registry(); final NettyServerConfig serverConfig = new NettyServerConfig(); serverConfig.setListenPort(30000); NettyRemotingServer nettyRemotingServer = new NettyRemotingServer(serverConfig); nettyRemotingServer.registerProcessor(CommandType.TASK_EXECUTE_ACK, taskAckProcessor); nettyRemotingServer.start(); final NettyClientConfig clientConfig = new NettyClientConfig(); NettyRemotingClient nettyRemotingClient = new NettyRemotingClient(clientConfig); Channel channel = nettyRemotingClient.getChannel(Host.of("localhost:30000")); taskCallbackService.addRemoteChannel(1, new NettyRemoteChannel(channel, 1)); TaskExecuteAckCommand ackCommand = new TaskExecuteAckCommand();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,314
[Question] Why "Failed to load ApplicationContext" when running tests locally
# Why "Failed to load ApplicationContext" when running tests locally The first is the test command I ran: ``` mvn test -pl dolphinscheduler-server -Dtest =TaskPriorityQueueConsumerTest#testSHELLTask ``` It should be noted that the above test is not the only one with this problem. ## The environment in which the problem occurs The problem was originally discovered by running tests in IDEA, but also by testing directly with the 'mvn' command. - Operating system: MacOS - JAVA: 1.8.0_111 - Maven: 3.5.2 - DS version: dev branch To verify that it was a local environment problem, I created a new virtual machine to test, which had the same problem. - Operating system: CentOS 7 - JAVA: 1.8.0_221 - Maven: 3.6.3 - DS version: dev branch ## Action steps I tested it on my virtual machine using the following steps: ``` git clone ... cd incubator-dolphinscheduler-github/ git checkout dev mvn clean install -pl dolphinscheduler-common -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-dao -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-service -am -Dmaven.test.skip=true mvn clean install -pl dolphinscheduler-alert -am -Dmaven.test.skip=true mvn test -pl dolphinscheduler-server -Dtest=TaskPriorityQueueConsumerTest#testSHELLTask ``` ## Error log ``` [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 15.247 s <<< FAILURE! - in org.apache.dolphinscheduler.server.master.consumer.TaskPriorityQueueConsumerTest [ERROR] testSHELLTask(org.apache.dolphinscheduler.server.master.consumer.TaskPriorityQueueConsumerTest) Time elapsed: 0 s <<< ERROR! java.lang.IllegalStateException: Failed to load ApplicationContext Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'nettyExecutorManager': Unsatisfied dependency expressed through field 'zookeeperNodeManager'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperNodeManager': Unsatisfied dependency expressed through field 'registryCenter'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperNodeManager': Unsatisfied dependency expressed through field 'registryCenter'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperRegistryCenter': Unsatisfied dependency expressed through field 'zookeeperCachedOperator'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zookeeperCachedOperator': Unsatisfied dependency expressed through field 'zookeeperClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.service.zk.CuratorZookeeperClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} 01:07:48.958 [SessionTracker] INFO org.apache.zookeeper.server.SessionTrackerImpl - SessionTrackerImpl exited loop! [INFO] [INFO] Results: [INFO] [ERROR] Errors: [ERROR] TaskPriorityQueueConsumerTest.testSHELLTask » IllegalState Failed to load Appl... [INFO] [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0 [INFO] [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 48.206 s [INFO] Finished at: 2020-07-27T01:07:49Z [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project dolphinscheduler-server: There are test failures. [ERROR] [ERROR] Please refer to /root/incubator-dolphinscheduler-github/dolphinscheduler-server/target/surefire-reports for the individual test results. [ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream. [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException ``` ## Problem analysis According to my own knowledge, I tried to solve the above problems. Because the reason is that `Autowired` errors, so I according to the prompt in the test code `dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumerTest.java`, To annotate `@ContextConfiguration` added a class `CuratorZookeeperClient.class`, problem is solved. Just like this: ```java @ContextConfiguration(classes={DependencyConfig.class, SpringApplicationContext.class, SpringZKServer.class, NettyExecutorManager.class, ExecutorDispatcher.class, ZookeeperRegistryCenter.class, TaskPriorityQueueConsumer.class, ZookeeperNodeManager.class, ZookeeperCachedOperator.class, ZookeeperConfig.class, MasterConfig.class, CuratorZookeeperClient.class}) ``` I mentioned this problem with more than one test code, but I'll summarize it now: > if the test code needs to Autowired class A objects, class A needs to Autowired class B objects. Then `A.class` appears in the context configuration, while `B.class` is not, an 'Failed to load ApplicationContext' exception will appear and the test will fail. ## Question Every time the project merges new code, it will be tested automatically. Why is this test enough to pass without these problems?
https://github.com/apache/dolphinscheduler/issues/3314
https://github.com/apache/dolphinscheduler/pull/3304
b555d0a086c88c29b40304802589b3ef77955ab9
3a0d4da27e6f981ecba7d061bad4644079ae122d
2020-07-27T02:02:58Z
java
2020-07-30T05:28:27Z
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/processor/TaskCallbackServiceTest.java
ackCommand.setTaskInstanceId(1); ackCommand.setStartTime(new Date()); taskCallbackService.sendAck(1, ackCommand.convert2Command()); Assert.assertEquals(true, channel.isOpen()); Stopper.stop(); nettyRemotingServer.close(); nettyRemotingClient.close(); masterRegistry.unRegistry(); } @Test public void testTaskExecuteProcessor() throws Exception{ final NettyServerConfig serverConfig = new NettyServerConfig(); serverConfig.setListenPort(30000); NettyRemotingServer nettyRemotingServer = new NettyRemotingServer(serverConfig); nettyRemotingServer.registerProcessor(CommandType.TASK_EXECUTE_REQUEST, taskExecuteProcessor); nettyRemotingServer.start(); final NettyClientConfig clientConfig = new NettyClientConfig(); NettyRemotingClient nettyRemotingClient = new NettyRemotingClient(clientConfig); TaskExecuteRequestCommand taskExecuteRequestCommand = new TaskExecuteRequestCommand(); nettyRemotingClient.send(new Host("localhost",30000),taskExecuteRequestCommand.convert2Command()); taskExecuteRequestCommand.setTaskExecutionContext(JSONUtils.toJsonString(new TaskExecutionContext())); nettyRemotingClient.send(new Host("localhost",30000),taskExecuteRequestCommand.convert2Command()); Thread.sleep(5000); Stopper.stop(); Thread.sleep(5000); nettyRemotingServer.close(); nettyRemotingClient.close(); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,364
After update the version from 1.2.0 to 1.3.1,running the spark task fail because the can't find the jar
*For better global communication, please give priority to using English description, thx! * *Please review https://dolphinscheduler.apache.org/en-us/docs/development/issue.html when describe an issue.* **Describe the question** 1.2.0升级1.3.1 由于任务Json格式变更导致Spark任务找不到Jar包 任务报错 ClassNotFound 即便应用了升级Mysql脚本 Json格式也没有变成1.3可以识别的Json格式 升级脚本是否没有对Spark任务 做升级变更处理??? 又或者是1.3.1没有兼容1.2.0的任务???? 导致我必须 把所有Spark类型的任务 都要重新编辑一下 保存 刷新成1.3.1的Json格式才可以执行。。。 **Which version of DolphinScheduler:** -[1.3.1-preview] **Additional context** **Requirement or improvement** - Please describe about your requirements or improvement suggestions.
https://github.com/apache/dolphinscheduler/issues/3364
https://github.com/apache/dolphinscheduler/pull/3378
ff99ef383f647627dc13cfb71f5dd3c9b26ea76c
3744167d52a52892b5ff98d3b07ab250970fdb5d
2020-07-31T03:56:02Z
java
2020-08-03T02:31:27Z
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/process/ResourceInfo.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.dolphinscheduler.common.process; /** * resource info */ public class ResourceInfo {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,364
After update the version from 1.2.0 to 1.3.1,running the spark task fail because the can't find the jar
*For better global communication, please give priority to using English description, thx! * *Please review https://dolphinscheduler.apache.org/en-us/docs/development/issue.html when describe an issue.* **Describe the question** 1.2.0升级1.3.1 由于任务Json格式变更导致Spark任务找不到Jar包 任务报错 ClassNotFound 即便应用了升级Mysql脚本 Json格式也没有变成1.3可以识别的Json格式 升级脚本是否没有对Spark任务 做升级变更处理??? 又或者是1.3.1没有兼容1.2.0的任务???? 导致我必须 把所有Spark类型的任务 都要重新编辑一下 保存 刷新成1.3.1的Json格式才可以执行。。。 **Which version of DolphinScheduler:** -[1.3.1-preview] **Additional context** **Requirement or improvement** - Please describe about your requirements or improvement suggestions.
https://github.com/apache/dolphinscheduler/issues/3364
https://github.com/apache/dolphinscheduler/pull/3378
ff99ef383f647627dc13cfb71f5dd3c9b26ea76c
3744167d52a52892b5ff98d3b07ab250970fdb5d
2020-07-31T03:56:02Z
java
2020-08-03T02:31:27Z
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/process/ResourceInfo.java
/** * res the name of the resource that was uploaded */ private int id; public int getId() { return id; } public void setId(int id) { this.id = id; } private String res; public String getRes() { return res; } public void setRes(String res) { this.res = res; } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,364
After update the version from 1.2.0 to 1.3.1,running the spark task fail because the can't find the jar
*For better global communication, please give priority to using English description, thx! * *Please review https://dolphinscheduler.apache.org/en-us/docs/development/issue.html when describe an issue.* **Describe the question** 1.2.0升级1.3.1 由于任务Json格式变更导致Spark任务找不到Jar包 任务报错 ClassNotFound 即便应用了升级Mysql脚本 Json格式也没有变成1.3可以识别的Json格式 升级脚本是否没有对Spark任务 做升级变更处理??? 又或者是1.3.1没有兼容1.2.0的任务???? 导致我必须 把所有Spark类型的任务 都要重新编辑一下 保存 刷新成1.3.1的Json格式才可以执行。。。 **Which version of DolphinScheduler:** -[1.3.1-preview] **Additional context** **Requirement or improvement** - Please describe about your requirements or improvement suggestions.
https://github.com/apache/dolphinscheduler/issues/3364
https://github.com/apache/dolphinscheduler/pull/3378
ff99ef383f647627dc13cfb71f5dd3c9b26ea76c
3744167d52a52892b5ff98d3b07ab250970fdb5d
2020-07-31T03:56:02Z
java
2020-08-03T02:31:27Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumer.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.dolphinscheduler.server.master.consumer; import com.alibaba.fastjson.JSONObject; import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.common.enums.ExecutionStatus; import org.apache.dolphinscheduler.common.enums.ResourceType; import org.apache.dolphinscheduler.common.enums.TaskType; import org.apache.dolphinscheduler.common.enums.UdfType; import org.apache.dolphinscheduler.common.model.TaskNode; import org.apache.dolphinscheduler.common.process.ResourceInfo; import org.apache.dolphinscheduler.common.task.AbstractParameters;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,364
After update the version from 1.2.0 to 1.3.1,running the spark task fail because the can't find the jar
*For better global communication, please give priority to using English description, thx! * *Please review https://dolphinscheduler.apache.org/en-us/docs/development/issue.html when describe an issue.* **Describe the question** 1.2.0升级1.3.1 由于任务Json格式变更导致Spark任务找不到Jar包 任务报错 ClassNotFound 即便应用了升级Mysql脚本 Json格式也没有变成1.3可以识别的Json格式 升级脚本是否没有对Spark任务 做升级变更处理??? 又或者是1.3.1没有兼容1.2.0的任务???? 导致我必须 把所有Spark类型的任务 都要重新编辑一下 保存 刷新成1.3.1的Json格式才可以执行。。。 **Which version of DolphinScheduler:** -[1.3.1-preview] **Additional context** **Requirement or improvement** - Please describe about your requirements or improvement suggestions.
https://github.com/apache/dolphinscheduler/issues/3364
https://github.com/apache/dolphinscheduler/pull/3378
ff99ef383f647627dc13cfb71f5dd3c9b26ea76c
3744167d52a52892b5ff98d3b07ab250970fdb5d
2020-07-31T03:56:02Z
java
2020-08-03T02:31:27Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumer.java
import org.apache.dolphinscheduler.common.task.datax.DataxParameters; import org.apache.dolphinscheduler.common.task.procedure.ProcedureParameters; import org.apache.dolphinscheduler.common.task.sql.SqlParameters; import org.apache.dolphinscheduler.common.task.sqoop.SqoopParameters; import org.apache.dolphinscheduler.common.task.sqoop.sources.SourceMysqlParameter; import org.apache.dolphinscheduler.common.task.sqoop.targets.TargetMysqlParameter; import org.apache.dolphinscheduler.common.thread.Stopper; import org.apache.dolphinscheduler.common.utils.*; import org.apache.dolphinscheduler.dao.entity.*; import org.apache.dolphinscheduler.server.builder.TaskExecutionContextBuilder; import org.apache.dolphinscheduler.server.entity.*; import org.apache.dolphinscheduler.server.master.config.MasterConfig; import org.apache.dolphinscheduler.server.master.dispatch.ExecutorDispatcher; import org.apache.dolphinscheduler.server.master.dispatch.context.ExecutionContext; import org.apache.dolphinscheduler.server.master.dispatch.enums.ExecutorType; import org.apache.dolphinscheduler.server.master.dispatch.exceptions.ExecuteException; import org.apache.dolphinscheduler.service.process.ProcessService; import org.apache.dolphinscheduler.service.queue.TaskPriorityQueue; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import javax.annotation.PostConstruct; import java.util.*; import java.util.stream.Collectors; import java.util.stream.Stream; /** * TaskUpdateQueue consumer */ @Component
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,364
After update the version from 1.2.0 to 1.3.1,running the spark task fail because the can't find the jar
*For better global communication, please give priority to using English description, thx! * *Please review https://dolphinscheduler.apache.org/en-us/docs/development/issue.html when describe an issue.* **Describe the question** 1.2.0升级1.3.1 由于任务Json格式变更导致Spark任务找不到Jar包 任务报错 ClassNotFound 即便应用了升级Mysql脚本 Json格式也没有变成1.3可以识别的Json格式 升级脚本是否没有对Spark任务 做升级变更处理??? 又或者是1.3.1没有兼容1.2.0的任务???? 导致我必须 把所有Spark类型的任务 都要重新编辑一下 保存 刷新成1.3.1的Json格式才可以执行。。。 **Which version of DolphinScheduler:** -[1.3.1-preview] **Additional context** **Requirement or improvement** - Please describe about your requirements or improvement suggestions.
https://github.com/apache/dolphinscheduler/issues/3364
https://github.com/apache/dolphinscheduler/pull/3378
ff99ef383f647627dc13cfb71f5dd3c9b26ea76c
3744167d52a52892b5ff98d3b07ab250970fdb5d
2020-07-31T03:56:02Z
java
2020-08-03T02:31:27Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumer.java
public class TaskPriorityQueueConsumer extends Thread{ /** * logger of TaskUpdateQueueConsumer */ private static final Logger logger = LoggerFactory.getLogger(TaskPriorityQueueConsumer.class); /** * taskUpdateQueue */ @Autowired private TaskPriorityQueue taskPriorityQueue; /** * processService */ @Autowired private ProcessService processService; /** * executor dispatcher
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,364
After update the version from 1.2.0 to 1.3.1,running the spark task fail because the can't find the jar
*For better global communication, please give priority to using English description, thx! * *Please review https://dolphinscheduler.apache.org/en-us/docs/development/issue.html when describe an issue.* **Describe the question** 1.2.0升级1.3.1 由于任务Json格式变更导致Spark任务找不到Jar包 任务报错 ClassNotFound 即便应用了升级Mysql脚本 Json格式也没有变成1.3可以识别的Json格式 升级脚本是否没有对Spark任务 做升级变更处理??? 又或者是1.3.1没有兼容1.2.0的任务???? 导致我必须 把所有Spark类型的任务 都要重新编辑一下 保存 刷新成1.3.1的Json格式才可以执行。。。 **Which version of DolphinScheduler:** -[1.3.1-preview] **Additional context** **Requirement or improvement** - Please describe about your requirements or improvement suggestions.
https://github.com/apache/dolphinscheduler/issues/3364
https://github.com/apache/dolphinscheduler/pull/3378
ff99ef383f647627dc13cfb71f5dd3c9b26ea76c
3744167d52a52892b5ff98d3b07ab250970fdb5d
2020-07-31T03:56:02Z
java
2020-08-03T02:31:27Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumer.java
*/ @Autowired private ExecutorDispatcher dispatcher; /** * master config */ @Autowired private MasterConfig masterConfig; @PostConstruct public void init(){ super.setName("TaskUpdateQueueConsumerThread"); super.start(); } @Override public void run() { List<String> failedDispatchTasks = new ArrayList<>(); while (Stopper.isRunning()){ try { int fetchTaskNum = masterConfig.getMasterDispatchTaskNumber(); failedDispatchTasks.clear(); for(int i = 0; i < fetchTaskNum; i++){ if(taskPriorityQueue.size() <= 0){ Thread.sleep(Constants.SLEEP_TIME_MILLIS); continue; } String taskPriorityInfo = taskPriorityQueue.take(); TaskPriority taskPriority = TaskPriority.of(taskPriorityInfo); boolean dispatchResult = dispatch(taskPriority.getTaskId()); if(!dispatchResult){
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,364
After update the version from 1.2.0 to 1.3.1,running the spark task fail because the can't find the jar
*For better global communication, please give priority to using English description, thx! * *Please review https://dolphinscheduler.apache.org/en-us/docs/development/issue.html when describe an issue.* **Describe the question** 1.2.0升级1.3.1 由于任务Json格式变更导致Spark任务找不到Jar包 任务报错 ClassNotFound 即便应用了升级Mysql脚本 Json格式也没有变成1.3可以识别的Json格式 升级脚本是否没有对Spark任务 做升级变更处理??? 又或者是1.3.1没有兼容1.2.0的任务???? 导致我必须 把所有Spark类型的任务 都要重新编辑一下 保存 刷新成1.3.1的Json格式才可以执行。。。 **Which version of DolphinScheduler:** -[1.3.1-preview] **Additional context** **Requirement or improvement** - Please describe about your requirements or improvement suggestions.
https://github.com/apache/dolphinscheduler/issues/3364
https://github.com/apache/dolphinscheduler/pull/3378
ff99ef383f647627dc13cfb71f5dd3c9b26ea76c
3744167d52a52892b5ff98d3b07ab250970fdb5d
2020-07-31T03:56:02Z
java
2020-08-03T02:31:27Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumer.java
failedDispatchTasks.add(taskPriorityInfo); } } for(String dispatchFailedTask : failedDispatchTasks){ taskPriorityQueue.put(dispatchFailedTask); } }catch (Exception e){ logger.error("dispatcher task error",e); } } } /** * dispatch task * * @param taskInstanceId taskInstanceId * @return result */ private boolean dispatch(int taskInstanceId){ boolean result = false; try { TaskExecutionContext context = getTaskExecutionContext(taskInstanceId); ExecutionContext executionContext = new ExecutionContext(context.toCommand(), ExecutorType.WORKER, context.getWorkerGroup()); if (taskInstanceIsFinalState(taskInstanceId)){ return true; }else{ result = dispatcher.dispatch(executionContext); } } catch (ExecuteException e) { logger.error("dispatch error",e);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,364
After update the version from 1.2.0 to 1.3.1,running the spark task fail because the can't find the jar
*For better global communication, please give priority to using English description, thx! * *Please review https://dolphinscheduler.apache.org/en-us/docs/development/issue.html when describe an issue.* **Describe the question** 1.2.0升级1.3.1 由于任务Json格式变更导致Spark任务找不到Jar包 任务报错 ClassNotFound 即便应用了升级Mysql脚本 Json格式也没有变成1.3可以识别的Json格式 升级脚本是否没有对Spark任务 做升级变更处理??? 又或者是1.3.1没有兼容1.2.0的任务???? 导致我必须 把所有Spark类型的任务 都要重新编辑一下 保存 刷新成1.3.1的Json格式才可以执行。。。 **Which version of DolphinScheduler:** -[1.3.1-preview] **Additional context** **Requirement or improvement** - Please describe about your requirements or improvement suggestions.
https://github.com/apache/dolphinscheduler/issues/3364
https://github.com/apache/dolphinscheduler/pull/3378
ff99ef383f647627dc13cfb71f5dd3c9b26ea76c
3744167d52a52892b5ff98d3b07ab250970fdb5d
2020-07-31T03:56:02Z
java
2020-08-03T02:31:27Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumer.java
} return result; } /** * taskInstance is final state * success,failure,kill,stop,pause,threadwaiting is final state * @param taskInstanceId taskInstanceId * @return taskInstance is final state */ public Boolean taskInstanceIsFinalState(int taskInstanceId){ TaskInstance taskInstance = processService.findTaskInstanceById(taskInstanceId); return taskInstance.getState().typeIsFinished(); } /** * get TaskExecutionContext * @param taskInstanceId taskInstanceId * @return TaskExecutionContext */ protected TaskExecutionContext getTaskExecutionContext(int taskInstanceId){ TaskInstance taskInstance = processService.getTaskInstanceDetailByTaskId(taskInstanceId); // task type TaskType taskType = TaskType.valueOf(taskInstance.getTaskType()); // task node TaskNode taskNode = JSONObject.parseObject(taskInstance.getTaskJson(), TaskNode.class); Integer userId = taskInstance.getProcessDefine() == null ? 0 : taskInstance.getProcessDefine().getUserId(); Tenant tenant = processService.getTenantForProcess(taskInstance.getProcessInstance().getTenantId(), userId); // verify tenant is null if (verifyTenantIsNull(tenant, taskInstance)) { processService.changeTaskState(ExecutionStatus.FAILURE, taskInstance.getStartTime(),
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,364
After update the version from 1.2.0 to 1.3.1,running the spark task fail because the can't find the jar
*For better global communication, please give priority to using English description, thx! * *Please review https://dolphinscheduler.apache.org/en-us/docs/development/issue.html when describe an issue.* **Describe the question** 1.2.0升级1.3.1 由于任务Json格式变更导致Spark任务找不到Jar包 任务报错 ClassNotFound 即便应用了升级Mysql脚本 Json格式也没有变成1.3可以识别的Json格式 升级脚本是否没有对Spark任务 做升级变更处理??? 又或者是1.3.1没有兼容1.2.0的任务???? 导致我必须 把所有Spark类型的任务 都要重新编辑一下 保存 刷新成1.3.1的Json格式才可以执行。。。 **Which version of DolphinScheduler:** -[1.3.1-preview] **Additional context** **Requirement or improvement** - Please describe about your requirements or improvement suggestions.
https://github.com/apache/dolphinscheduler/issues/3364
https://github.com/apache/dolphinscheduler/pull/3378
ff99ef383f647627dc13cfb71f5dd3c9b26ea76c
3744167d52a52892b5ff98d3b07ab250970fdb5d
2020-07-31T03:56:02Z
java
2020-08-03T02:31:27Z
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumer.java
taskInstance.getHost(), null, null, taskInstance.getId()); return null; } // set queue for process instance, user-specified queue takes precedence over tenant queue String userQueue = processService.queryUserQueueByProcessInstanceId(taskInstance.getProcessInstanceId()); taskInstance.getProcessInstance().setQueue(StringUtils.isEmpty(userQueue) ? tenant.getQueue() : userQueue); taskInstance.getProcessInstance().setTenantCode(tenant.getTenantCode()); taskInstance.setExecutePath(getExecLocalPath(taskInstance)); taskInstance.setResources(getResourceFullNames(taskNode)); SQLTaskExecutionContext sqlTaskExecutionContext = new SQLTaskExecutionContext(); DataxTaskExecutionContext dataxTaskExecutionContext = new DataxTaskExecutionContext(); ProcedureTaskExecutionContext procedureTaskExecutionContext = new ProcedureTaskExecutionContext(); SqoopTaskExecutionContext sqoopTaskExecutionContext = new SqoopTaskExecutionContext(); // SQL task if (taskType == TaskType.SQL){ setSQLTaskRelation(sqlTaskExecutionContext, taskNode); } // DATAX task if (taskType == TaskType.DATAX){ setDataxTaskRelation(dataxTaskExecutionContext, taskNode); } // procedure task if (taskType == TaskType.PROCEDURE){ setProcedureTaskRelation(procedureTaskExecutionContext, taskNode); } if (taskType == TaskType.SQOOP){ setSqoopTaskRelation(sqoopTaskExecutionContext,taskNode);