Lightweight Smart Contract upload not showing up

Hi

When I upload a Lightweight Smart Contract to my Contract Runner Node (Mainnet), it seems that everything is working as it should. But the Contract never shows up in the Contract Runner Tab. There is not even a transaction.

The PrivateKey for the Lightweight Smart Contract Upload is the same that is used in the configuration.json which I load in the Contract Runner Tab. The Account has both ARDR (1000) and IGNIS (150) to pay for the upload.

Here is the log from the upload:

./contractManager.sh -u -n TarascaDAOCardCraft  -k 0000000000000000000000000000REPLACED0000000000000000000000000000 -p org.tarasca.ardor.contracts
Initializing Nxt server version 2.3.3
Command line arguments
-Djava.security.manager
-Djava.security.policy=contractManager.policy
javafx not supported
isHeadless=true
Runtime mode nxt.env.CommandLineMode
User home folder /home/pi/ardor-mainnet
Loading nxt-default.properties from classpath
Loading nxt.properties from classpath
Loading contract.manager.logging-default.properties from classpath
2020-12-11 22:12:10 INFO: nxt.enableStackTraces = "true"
2020-12-11 22:12:11 INFO: nxt.enableLogTraceback = "false"
2020-12-11 22:12:11 INFO: nxt.enableLogThreadName = "true"
2020-12-11 22:12:11 INFO: main logging enabled
2020-12-11 22:12:11 FINE: main java.version = 11.0.9.1
2020-12-11 22:12:11 FINE: main java.vm.version = 11.0.9.1+1-post-Raspbian-1deb10u2
2020-12-11 22:12:11 FINE: main java.vm.name = OpenJDK Server VM
2020-12-11 22:12:11 FINE: main java.vendor = Raspbian
2020-12-11 22:12:11 FINE: main java.vm.vendor = Raspbian
2020-12-11 22:12:11 FINE: main java.home = /usr/lib/jvm/java-11-openjdk-armhf
2020-12-11 22:12:11 FINE: main java.library.path = /usr/java/packages/lib:/usr/lib/arm-linux-gnueabihf/jni:/lib/arm-linux-gnueabihf:/usr/lib/arm-linux-gnueabihf:/usr/lib/jni:/lib:/usr/lib
2020-12-11 22:12:11 FINE: main java.class.path = classes:lib/lucene-queryparser-7.1.0.jar:lib/lucene-queries-7.1.0.jar:lib/tika-core-1.13.jar:lib/jetty-io-9.4.35.v20201120.jar:lib/javax.servlet-api-3.1.0.jar:lib/jetty-servlets-9.4.35.v20201120.jar:lib/lucene-core-7.1.0.jar:lib/bcpkix-jdk15on-165.jar:lib/jetty-util-9.4.35.v20201120.jar:lib/jetty-continuation-9.4.35.v20201120.jar:lib/jetty-servlet-9.4.35.v20201120.jar:lib/jetty-client-9.4.35.v20201120.jar:lib/commons-cli-1.3.1.jar:lib/jna-5.5.0.jar:lib/h2-1.4.200.jar:lib/commons-math3-3.6.1.jar:lib/slf4j-jdk14-1.7.22.jar:lib/jetty-security-9.4.35.v20201120.jar:lib/tika-parsers-1.13.jar:lib/jetty-proxy-9.4.35.v20201120.jar:lib/bcprov-jdk15on-165.jar:lib/weupnp-0.1.4.jar:lib/jetty-server-9.4.35.v20201120.jar:lib/slf4j-api-1.7.22.jar:lib/javase-3.3.0.jar:lib/jna-platform-5.5.0.jar:lib/purejavahidapi-0.0.10j1.jar:lib/jetty-http-9.4.35.v20201120.jar:lib/lucene-analyzers-common-7.1.0.jar:lib/json-simple-1.1.1.jar:lib/javapoet-1.11.0.jar:lib/ed25519.jar:lib/core-3.3.0.jar:conf:addons/classes
2020-12-11 22:12:11 FINE: main java.io.tmpdir = /tmp
2020-12-11 22:12:11 FINE: main os.arch = arm
2020-12-11 22:12:11 FINE: main sun.arch.data.model = 32
2020-12-11 22:12:11 FINE: main os.name = Linux
2020-12-11 22:12:11 FINE: main file.encoding = ANSI_X3.4-1968
2020-12-11 22:12:11 FINE: main java.security.policy = contractManager.policy
2020-12-11 22:12:11 FINE: main java.security.manager =
2020-12-11 22:12:11 FINE: main java.specification.vendor = Oracle Corporation
2020-12-11 22:12:11 FINE: main nxt.runtime.mode = null
2020-12-11 22:12:11 FINE: main nxt.runtime.dirProvider = null
2020-12-11 22:12:11 FINE: main availableProcessors = 4
2020-12-11 22:12:11 FINE: main maxMemory = 235274240
2020-12-11 22:12:11 FINE: main processId = 930
2020-12-11 22:12:11 INFO: main nxt.addOns = "nxt.addons.ContractRunner"
2020-12-11 22:12:11 INFO: main nxt.disableSecurityPolicy = "false"
2020-12-11 22:12:11 INFO: main Creating Jelurida security provider
2020-12-11 22:12:12 INFO: main nxt.runtime.mode not defined
2020-12-11 22:12:12 INFO: main nxt.launchDesktopApplication = "true"
2020-12-11 22:12:12 INFO: main Desktop application isDesktopEnabled:false, isLaunchDesktopApplication:true, hasJavaFX:false
2020-12-11 22:12:12 INFO: main Setting security manager with policy contractManager.policy
2020-12-11 22:12:12 INFO: main Initializing nxt.addons.ContractRunner
2020-12-11 22:12:12 INFO: main nxt.isTestnet = "false"
2020-12-11 22:12:12 INFO: main nxt.isOffline = "false"
2020-12-11 22:12:12 INFO: main nxt.isLightClient = "false"
2020-12-11 22:12:12 INFO: main nxt.isPermissioned = "false"
2020-12-11 22:12:13 INFO: main nxt.customLoginWarning not defined
2020-12-11 22:12:13 INFO: main nxt.maxRollback = "800"
2020-12-11 22:12:13 INFO: main nxt.forgingDelay = "10"
2020-12-11 22:12:13 INFO: main nxt.forgingSpeedup = "3"
2020-12-11 22:12:13 INFO: main nxt.numberOfForkConfirmations = "5"
2020-12-11 22:12:13 INFO: main nxt.batchCommitSize = "100"
2020-12-11 22:12:13 INFO: main nxt.maxPrunableLifetime = "-1"
2020-12-11 22:12:13 INFO: main nxt.includeExpiredPrunable = "true"
2020-12-11 22:12:13 INFO: main nxt.enableLedgerWallet = "true"
2020-12-11 22:12:13 INFO: main nxt.correctInvalidFees = "false"
2020-12-11 22:12:13 INFO: main nxt.minBundlerBalanceFXT = "1000"
2020-12-11 22:12:13 INFO: main nxt.minBundlerFeeLimitFXT = "10"
2020-12-11 22:12:13 INFO: main nxt.disableFullTextSearch = "false"
2020-12-11 22:12:13 INFO: main nxt.disableMetadataDetection = "false"
2020-12-11 22:12:13 INFO: main nxt.adminPassword = "{not logged}"
2020-12-11 22:12:13 INFO: main nxt.adminPasswordHash not defined
2020-12-11 22:12:13 INFO: main nxt.maxAPIRecords = "100"
2020-12-11 22:12:13 INFO: main nxt.enableAPIUPnP = "false"
2020-12-11 22:12:13 INFO: main nxt.apiServerIdleTimeout = "30000"
2020-12-11 22:12:13 INFO: main nxt.apiServerCORS = "true"
2020-12-11 22:12:13 INFO: main nxt.forwardedForHeader not defined
2020-12-11 22:12:13 INFO: main nxt.allowedBotHosts = "*"
2020-12-11 22:12:13 INFO: main nxt.enableAPIServer = "true"
2020-12-11 22:12:13 INFO: main nxt.apiServerPort = "31337"
2020-12-11 22:12:13 INFO: main nxt.apiServerSSLPort = "31337"
2020-12-11 22:12:13 INFO: main nxt.apiServerHost = "0.0.0.0"
2020-12-11 22:12:13 INFO: main nxt.disableAdminPassword = "false"
2020-12-11 22:12:13 INFO: main nxt.apiSSL = "true"
2020-12-11 22:12:14 INFO: main nxt.keyStorePath = "keystore"
2020-12-11 22:12:14 INFO: main nxt.keyStorePassword = "{not logged}"
2020-12-11 22:12:14 INFO: main nxt.keyStoreType = "PKCS12"
2020-12-11 22:12:14 INFO: main Using keystore: /home/pi/ardor-mainnet/keystore
2020-12-11 22:12:14 INFO: main nxt.apiSSLCiphers not defined
2020-12-11 22:12:14 INFO: main nxt.disableJettySSLContextReloaderThread not defined, using default false
2020-12-11 22:12:14 INFO: main API server using HTTPS port 31337
2020-12-11 22:12:15 INFO: main nxt.apiResourceBase = "./html/www"
2020-12-11 22:12:15 INFO: main nxt.apiWelcomeFile = "index.html"
2020-12-11 22:12:15 INFO: main nxt.javadocResourceBase = "./html/doc"
2020-12-11 22:12:15 INFO: main nxt.maxUploadFileSize = "43008"
2020-12-11 22:12:15 INFO: main nxt.maxUploadFileSize = "43008"
2020-12-11 22:12:16 INFO: main nxt.enableAPIServerGZIPFilter not defined, using default true
2020-12-11 22:12:16 INFO: main nxt.apiFrameOptionsSameOrigin = "true"
2020-12-11 22:12:16 INFO: main nxt.apiCustomSetupImpl not defined
2020-12-11 22:12:16 INFO: main ContractRunner not initialized, database is ready false,  addons are enabled true
2020-12-11 22:12:16 INFO: main nxt.debugTraceQuote = """
2020-12-11 22:12:16 INFO: main nxt.debugTraceSeparator = "      "
2020-12-11 22:12:16 INFO: main nxt.debugLogUnconfirmed = "false"
2020-12-11 22:12:16 INFO: main nxt.debugTraceAccounts not defined
2020-12-11 22:12:16 INFO: main nxt.debugTraceLog = "nxt-trace.csv"
2020-12-11 22:12:16 INFO: main nxt.disabledAPIs not defined
2020-12-11 22:12:18 INFO: main nxt.disabledAPITags not defined
2020-12-11 22:12:18 INFO: main Initialization took 8 seconds
2020-12-11 22:12:18 INFO: main Ardor server 2.3.3 started successfully.
2020-12-11 22:12:18 INFO: main Copyright ? 2013-2016 The Nxt Core Developers.
2020-12-11 22:12:18 INFO: main Copyright ? 2016-2020 Jelurida IP B.V.
2020-12-11 22:12:18 INFO: main Distributed under the Jelurida Public License version 1.2 for the Ardor Public Blockchain Platform, with ABSOLUTELY NO WARRANTY.
2020-12-11 22:12:18 INFO: main Client UI is at https://localhost:31337/index.html
2020-12-11 22:12:18 INFO: main contract.manager.serverAddress = "localhost"
2020-12-11 22:12:18 INFO: main contract.manager.useHttps = "false"
2020-12-11 22:12:18 INFO: main contract.manager.serverPort not defined or not numeric, using default value 0
2020-12-11 22:12:18 INFO: main nxt.apiServerPort = "31337"
2020-12-11 22:12:18 INFO: main Connecting to URL http://localhost:31337/nxt
2020-12-11 22:12:18 SEVERE: main Error connecting to remote node http://localhost:31337/nxt
java.lang.IllegalStateException: java.net.SocketException: Unexpected end of file from server
        at nxt.http.APIRemoteConnector.sendPostRequest(APIRemoteConnector.java:87)
        at nxt.http.APIRemoteConnector.getInputStream(APIRemoteConnector.java:59)
        at nxt.http.APICall.invokeImpl(APICall.java:376)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at nxt.http.APICall.invoke(APICall.java:371)
        at nxt.http.APICall.getJsonResponse(APICall.java:340)
        at nxt.http.APICall$Builder.call(APICall.java:229)
        at nxt.tools.ContractManager.main(ContractManager.java:187)
Caused by: java.net.SocketException: Unexpected end of file from server
        at java.base/sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:866)
        at java.base/sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:689)
        at java.base/sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:863)
        at java.base/sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:689)
        at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1615)
        at java.base/sun.net.www.protocol.http.HttpURLConnection$9.run(HttpURLConnection.java:1512)
        at java.base/sun.net.www.protocol.http.HttpURLConnection$9.run(HttpURLConnection.java:1510)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.base/java.security.AccessController.doPrivilegedWithCombiner(AccessController.java:795)
        at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1509)
        at java.base/java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:527)
        at nxt.http.APIRemoteConnector.sendPostRequest(APIRemoteConnector.java:80)
        ... 7 more
2020-12-11 22:12:18 INFO: main ==============================
2020-12-11 22:12:18 INFO: main Contract Manager Shutting Down
2020-12-11 22:12:18 INFO: main ==============================
2020-12-11 22:12:18 INFO: main Shutting down...
2020-12-11 22:12:18 INFO: main Ardor server 2.3.3 stopped.

Could it be an issue with httpS?

Any other ideas how I could check what the issue might be?

Just FYI: this is my first contract upload.

Thanks
Shugo

As you can see at the end of the log it's not working correctly. The Contract Manager log should not print those errors messages and it will log the successful transactions.

I agree with your diagnosis about the problem. Looks like your node is configured to listen on port 31337 with SSL enabled but the contract manager is trying HTTP instead of HTTPS.

Try adding this property to your configuration:

contract.manager.useHttps=true

Thank you, I will try that but now suddenly my node is not starting (I did not change a thing since yesterday):

Fatal error: java.lang.ExceptionInInitializerError
java.lang.ExceptionInInitializerError
        at nxt.dbschema.Db.init(Db.java:53)
        at nxt.configuration.SubSystem$3.init(SubSystem.java:120)
        at java.base/java.util.Arrays$ArrayList.forEach(Arrays.java:4390)
        at nxt.Nxt$Init.init(Nxt.java:434)
        at nxt.Nxt$Init.access$000(Nxt.java:424)
        at nxt.Nxt.init(Nxt.java:409)
        at nxt.Nxt.init(Nxt.java:400)
        at nxt.Nxt.main(Nxt.java:387)
Caused by: java.lang.RuntimeException: org.h2.jdbc.JdbcSQLNonTransientException: General error: "java.lang.IllegalStateException: Unable to read the page at position 236120122076937 [1.4.200/6]" [50000-200]
        at nxt.db.BasicDb.init(BasicDb.java:160)
        at nxt.dbschema.Db$Init.<clinit>(Db.java:64)
        ... 8 more
Caused by: org.h2.jdbc.JdbcSQLNonTransientException: General error: "java.lang.IllegalStateException: Unable to read the page at position 236120122076937 [1.4.200/6]" [50000-200]
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:505)
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:429)
        at org.h2.message.DbException.get(DbException.java:194)
        at org.h2.message.DbException.convert(DbException.java:347)
        at org.h2.engine.Database.openDatabase(Database.java:333)
        at org.h2.engine.Database.<init>(Database.java:301)
        at org.h2.engine.Engine.openSession(Engine.java:74)
        at org.h2.engine.Engine.openSession(Engine.java:192)
        at org.h2.engine.Engine.createSessionAndValidate(Engine.java:171)
        at org.h2.engine.Engine.createSession(Engine.java:166)
        at org.h2.engine.Engine.createSession(Engine.java:29)
        at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:340)
        at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:173)
        at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:152)
        at org.h2.Driver.connect(Driver.java:69)
        at org.h2.jdbcx.JdbcDataSource.getJdbcConnection(JdbcDataSource.java:189)
        at org.h2.jdbcx.JdbcDataSource.getXAConnection(JdbcDataSource.java:352)
        at org.h2.jdbcx.JdbcDataSource.getPooledConnection(JdbcDataSource.java:384)
        at org.h2.jdbcx.JdbcConnectionPool.getConnectionNow(JdbcConnectionPool.java:234)
        at org.h2.jdbcx.JdbcConnectionPool.getConnection(JdbcConnectionPool.java:199)
        at nxt.db.pool.H2ConnectionPool.getConnection(H2ConnectionPool.java:38)
        at nxt.db.BasicDb.getPooledConnection(BasicDb.java:208)
        at nxt.db.BasicDb.init(BasicDb.java:155)
        ... 9 more
Caused by: java.lang.IllegalStateException: Unable to read the page at position 236120122076937 [1.4.200/6]
        at org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:950)
        at org.h2.mvstore.MVStore.readPage(MVStore.java:2213)
        at org.h2.mvstore.MVMap.readPage(MVMap.java:672)
        at org.h2.mvstore.MVMap.readOrCreateRootPage(MVMap.java:688)
        at org.h2.mvstore.MVMap.setRootPos(MVMap.java:682)
        at org.h2.mvstore.MVStore.openMap(MVStore.java:576)
        at org.h2.mvstore.MVStore.openMap(MVStore.java:535)
        at org.h2.mvstore.MVStore.openMap(MVStore.java:516)
        at org.h2.mvstore.MVStore.removeMap(MVStore.java:2742)
        at org.h2.mvstore.db.MVTableEngine$Store.removeTemporaryMaps(MVTableEngine.java:298)
        at org.h2.engine.Database.open(Database.java:765)
        at org.h2.engine.Database.openDatabase(Database.java:307)
        ... 27 more
Caused by: java.lang.IllegalStateException: Unsupported type 17 [1.4.200/3]
        at org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:950)
        at org.h2.mvstore.type.ObjectDataType.newType(ObjectDataType.java:165)
        at org.h2.mvstore.type.ObjectDataType.read(ObjectDataType.java:229)
        at org.h2.mvstore.type.ObjectDataType.read(ObjectDataType.java:114)
        at org.h2.mvstore.Page.read(Page.java:605)
        at org.h2.mvstore.Page.read(Page.java:239)
        at org.h2.mvstore.MVStore.readPage(MVStore.java:2211)
        ... 37 more
2020-12-12 06:55:19 INFO: Thread-0 Shutting down...

Seems to be a Java issue, but how to solve it?

I tried different Java versions from 8 to 11 but the node always stops.

Very strange, since I did not change anything. Last night the node was running, in the morning it wasn't anymore and I cannot start it again.

Can be closed.

I changed to HTTP from HTTPS and now it is working.

Thanks for the help!

1 Like