Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Peers insert failed due smallint out of range #2496

Closed
ManuGowda opened this issue Oct 24, 2018 · 3 comments · Fixed by #2507
Closed

Peers insert failed due smallint out of range #2496

ManuGowda opened this issue Oct 24, 2018 · 3 comments · Fixed by #2507

Comments

@ManuGowda
Copy link
Contributor

Expected behavior

Since the maximum value allowed for port is 65536, the peers insert should allow values until range 65536

Actual behavior

When the wsPort is set to 50001 the peers insert fails due to smallint out of range error, however the port can be assigned upto maximum value of 65536.

[ERR] 2018-10-23 09:48:18 | error: smallint out of range
    at Connection.parseE (/Users/manu/lisk_ecosystem/lisk-2/node_modules/pg/lib/connection.js:545:11)
    at Connection.parseMessage (/Users/manu/lisk_ecosystem/lisk-2/node_modules/pg/lib/connection.js:370:19)
    at Socket.<anonymous> (/Users/manu/lisk_ecosystem/lisk-2/node_modules/pg/lib/connection.js:113:22)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at Socket.Readable.push (_stream_readable.js:208:10)
    at TCP.onread (net.js:601:20)
11:48:18 error: smallint out of range
         tx(modules:peers:dbSave): INSERT INTO "peers"("ip","wsPort","state","height","os","version","clock","broadhash") VALUES('127.0.0.1',50001,2,20,'darwin17.6.0','1.1.0',null,'\x717d22d7c576de6b7089305c004221449c8435d1178f093d5a138ec858dd55d8'),('127.0.0.1',5001,1,null,null,null,null,null)

Steps to reproduce

  1. Update wsPort value to 50001 and start the node, it will throw smallint out of range error.

Which version(s) does this affect? (Environment, OS, etc...)

@4miners
Copy link
Contributor

4miners commented Dec 12, 2018

Reopened due to the migration file name.

@4miners 4miners reopened this Dec 12, 2018
@pablitovicente
Copy link
Contributor

@4miners could you provide more details about the migration file name issue so I can issue a new PR for this one?

@4miners
Copy link
Contributor

4miners commented Dec 12, 2018

@pablitovicente Date in migration file name needs to be greater than last migration, in this case, PR was created before other PR that contains other (newer) migrations was merged (20181106000005...), so this migration will be never executed.

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

Successfully merging a pull request may close this issue.

4 participants