Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

put default value '0' for 'accounted' field in block table #533

Closed
frndxyz opened this issue Oct 4, 2014 · 21 comments
Closed

put default value '0' for 'accounted' field in block table #533

frndxyz opened this issue Oct 4, 2014 · 21 comments
Labels
Milestone

Comments

@frndxyz
Copy link

frndxyz commented Oct 4, 2014

server give error when saving blocks in sql table because 'accounted' field not have default value.

@frndxyz
Copy link
Author

frndxyz commented Oct 4, 2014

and also set default value for 'rewards' field..

@bonesoul
Copy link
Owner

bonesoul commented Oct 4, 2014

can you paste the exact logs please?

@bonesoul bonesoul added the bug label Oct 4, 2014
@frndxyz
Copy link
Author

frndxyz commented Oct 4, 2014

i actually solve it my self. i edit block table in mysql and set default value of field 'accounted' and 'reward' to value '0'. and now its work fine.

@artbatista
Copy link

I have seen this happen in Lottocoin:

17:06:46 [Error] [HybridStorage] [Lottocoin] An exception occured while adding block; Field 'Accounted' doesn't have a default value

@artbatista
Copy link

Blocks are showing up in the daemon, but coinium is not accounting for them.

Crap, I dont want to go back to have to use MPOS, but coinium is simply not accounting for ANY block found.

Orbitcoin fails with a bad hash #501, lottocoin with the above error.

@bonesoul
Copy link
Owner

bonesoul commented Oct 4, 2014

I'll be checking the issue.

Meanwhile can you set the default value manually using a tool like HeidiSQL.

@bonesoul bonesoul added this to the 0.2.1 - bugfix release milestone Oct 4, 2014
@bonesoul
Copy link
Owner

bonesoul commented Oct 4, 2014

seems to only happen when you upgrade from 0.1.5 to 0.2.0
workaround until i get a fix is manually setting the default value with http://www.heidisql.com/ or so

@artbatista
Copy link

I changed it manually, as per the above instructions. Waiting for a new block to see if it worked.

This worked for me:

use dogecoin;
alter table block alter column accounted set default 0;
alter table block alter column reward set default 0;

@artbatista
Copy link

OK, no more error after the manual fix, but there are other errors popping up now, similar to this:
#537 and #538

@ghost
Copy link

ghost commented Oct 23, 2014

So here is how i reproduce this error under windows:

manual install CoiniumServ v0.2.3 - Aurora

( is there no script btw? )

  • Install git for windows
  • Install Visual Studio 2013
  • download redis-2.8 , compile with Visual Studio 2013, start redis-server.exe ( without further options)
  • download mysql-server, set root-password, start without further otions
  • mysql-client:
    create table coin1;
    create table coin2;
    ...etc
  • cmd:
    git clone https://github.com/CoiniumServ/CoiniumServ.git
    cd CoiniumServ
    git submodule init
    git submodule update
  • compile CoiniumServ with Visual Studio 2013
  • edit config/config.json
  • edit config/pools/default.json
    {
    "daemon": {
    "host": "127.0.0.1",
    "timeout": 5
    },
    "meta": {
    "motd": "Welcome to CoiniumServ pool, enjoy your stay! - http://www.coiniumserv.com",
    "txMessage": "http://www.coiniumserv.com/"
    },
    "payments": {
    "enabled": true,
    "interval": 60,
    "minimum": 1
    },
    "miner": {
    "validateUsername": true,
    "timeout": 72000
    },
    "job": {
    "blockRefreshInterval": 1000,
    "rebroadcastTimeout": 55
    },
    "stratum": {
    "enabled": true,
    "bind": "0.0.0.0",
    "diff": 128,
    "vardiff": {
    "enabled": true,
    "minDiff": 1,
    "maxDiff": 524288,
    "targetTime": 15,
    "retargetTime": 90,
    "variancePercent": 30
    }
    },
    "banning": {
    "enabled": false,
    "duration": 600,
    "invalidPercent": 50,
    "checkThreshold": 100,
    "purgeInterval": 300
    },
    "storage": {
    "hybrid": {
    "enabled": true,
    "redis": {
    "host": "127.0.0.1",
    "port": 6379,
    "password": "",
    "databaseId": 0
    },
    "mysql": {
    "host": "127.0.0.1",
    "port": 3306,
    "user": "root",
    "password": "mypwd"
    }
    },
    "mpos": {
    "enabled": false,
    "mysql": {
    "host": "127.0.0.1",
    "port": 3306,
    "user": "root",
    "password": ""
    }
    }
    }
    }
  • edit config/pools/coin1.json
    {
    "enabled": true,
    "coin": "casinocoin.json",
    "daemon": {
    "port": 1234,
    "username": "user",
    "password": "pw"
    },
    "wallet": {
    "address": "CYFSxixAmLNcfbfMkH9jG3jTSDDRVWWUMM"
    },
    "rewards": [
    {
    "CYFSxixAmLNcfbfMkH9jG3jTSDDRVWWUMM": 0
    }
    ],
    "stratum": {
    "port": 12345
    },
    "storage": {
    "hybrid": {
    "mysql": {
    "database": "coin1"
    }
    }
    }
    }

now everthing seems to work - but solved blocks appear only in csc client, not in coiniumserv:

10/23/2014 11:10:12 +02:00 [Information] [ShareManager] [Casinocoin] Found block [690332] with hash [b8a1c3b8ca45324206815b9f239afbec599f3f63dfc3322b5dc4284ceec1ace1]
10/23/2014 11:10:12 +02:00 [Information] [JobManager] [Casinocoin] Broadcasted new job 0x16 to 2 subscribers as network found a new block
10/23/2014 11:10:12 +02:00 [Error] [HybridStorage] [Casinocoin] An exception occured while adding block; Field 'Accounted' doesn't have a default value

Change 1

mysql-client:
use coin1;
alter table block alter column accounted set default 0;
alter table block alter column reward set default 0;
use coin2;
alter table block alter column accounted set default 0;
alter table block alter column reward set default 0;
...etc

Result: Blocks show up in coiniumserv - but now error at payout:

10/23/2014 12:04:02 +02:00 [Error] [HybridStorage] [Casinocoin] An exception occured while committing payment; Field 'Completed' doesn't have a default value

Change 2

use coin1;
alter table payment alter column completed set default 0;
use coin2;
alter table payment alter column completed set default 0;

now payouts will work!

Proper MySQL install script

http://pastebin.com/S4QSdm57

@bonesoul
Copy link
Owner

@buechling did u upgrade from developer tree to lastest 0.2.x series?

@ghost
Copy link

ghost commented Oct 23, 2014

no, fresh v0.2.3 with new database..

@bonesoul
Copy link
Owner

@ghost
Copy link

ghost commented Oct 30, 2014

Still error for me.. i fetched the newest version from github today.. compiled it.. created new empty database.. then CoiniumServ created tables.. but:

10/30/2014 20:46:48 +01:00 [Information] [ShareManager] [Megacoin] Found block [300709] with hash [cd6d548ada2b651aec60587437e96233d07bfb52b7f964a6462cdbacb5ee522f]
10/30/2014 20:46:48 +01:00 [Information] [JobManager] [Megacoin] Broadcasted new job 0x12 to 1 subscribers as network found a new block
10/30/2014 20:46:48 +01:00 [Error] [HybridStorage] [Megacoin] An exception occured while adding block; Field 'Accounted' doesn't have a default value

@bonesoul
Copy link
Owner

What does your version table contain?

And which version you compiled?

@ghost
Copy link

ghost commented Oct 30, 2014

i am not sure where to look it up..
File-Details of CoiniumServ.exe says "0.2.3.33063"

mysql> SELECT * FROM VERSIONINFO;
+----------+---------------------+-----------------------+
| Version | AppliedOn | Description |
+----------+---------------------+-----------------------+
| 20140901 | 2014-10-30 19:17:10 | M001CreateBlocksTable |
| 20140908 | 2014-10-30 19:17:19 | M002Payments |
+----------+---------------------+-----------------------+

@bonesoul
Copy link
Owner

Latest is 0.2.4.

@ghost
Copy link

ghost commented Oct 30, 2014

ah okay i am sorry.. this is offtopic, but how can i get the new verion?

i did

git clone https://github.com/CoiniumServ/CoiniumServ.git
cd CoiniumServ
git fetch

@bonesoul
Copy link
Owner

just download the zip?

@ghost
Copy link

ghost commented Oct 31, 2014

ah "git pull" is the magical command ^^ ( better than looking up always the newest version )

now i have 0.2.4.14233 , deleted database and created empty database..

mysql> SELECT * FROM versioninfo;
+----------+---------------------+-----------------------+
| Version | AppliedOn | Description |
+----------+---------------------+-----------------------+
| 20140901 | 2014-10-31 09:24:12 | M001CreateBlocksTable |
| 20140908 | 2014-10-31 09:24:22 | M002Payments |
| 20141024 | 2014-10-31 09:24:22 | M003FixDefaults |
+----------+---------------------+-----------------------+

but unfortunately, i have the same error:

10/31/2014 10:42:17 +01:00 [Information] [ShareManager] [Fortytwo] Found block [447163] with hash [b97f577e3c19909b658dca7e9c37a46d8cf6f57c738ab83e5e6df3944350d8bf]
10/31/2014 10:42:17 +01:00 [Information] [JobManager] [Fortytwo] Broadcasted new job 0x19 to 1 subscribers as network found a new block
10/31/2014 10:42:17 +01:00 [Error] [HybridStorage] [Fortytwo] An exception occured while adding block; Field 'Reward' doesn't have a default value

@ghost
Copy link

ghost commented Nov 7, 2014

so the error is still there by the way..

workaround:

  1. create every database
  2. start coiniumserv: it will create tables
  3. go into every database and change tables:

use coin1;
alter table block alter column accounted set default 0;
alter table block alter column reward set default 0;
alter table payment alter column completed set default 0;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants