Skip to content
This repository was archived by the owner on Mar 18, 2021. It is now read-only.
This repository was archived by the owner on Mar 18, 2021. It is now read-only.

"RangeError: Invalid value: Not in range 0..1114111, inclusive: -1" When connecting to postgresql 12 #844

Open
@pratibhashali

Description

@pratibhashali

dart --version
Dart VM version: 2.8.2 (stable) (Mon May 11 15:06:42 2020 +0200) on "windows_x64"

aqueduct --version
Aqueduct CLI version: 3.3.0+1

Problem:
Following this tutorial: https://www.youtube.com/watch?v=sXk9nkdSVq4
I am trying to connect to PostgreSQL using

final persistentModel = PostgreSQLPersistentStore.fromConnectionInfo(
      'sumit',
      'qwerty',
      'localhost',
      5432,
      'testdb',
    );

I have an endpoint at "profile" which will retrieve the list from the database.
When I try to consume API at http://localhost:8888/profile

I get this stack trace

[INFO] aqueduct: PostgreSQL connecting, sumit@localhost:5432/testdb.
RangeError: Invalid value: Not in range 0..1114111, inclusive: -1
[SEVERE] aqueduct: GET /profile 135ms 500 {user-agent : Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36\nconnection : keep-alive\ncache-control : no-cache\naccept : /\naccept-language : en-US,en;q=0.9,hi;q=0.8\nsec-fetch-dest : empty\nsec-fetch-mode : cors\naccept-encoding : gzip, deflate, br\npostman-token : b23e93a2-8378-d22f-f3ab-bbed9601741a\nhost : localhost:8888\nsec-fetch-site : none\n} NoSuchMethodError: The getter
'hasExplicitlySetContentType' was called on null.
Receiver: null
Tried calling: hasExplicitlySetContentType #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:53:5)
#1 ResourceController._process (package:aqueduct/src/http/resource_controller.dart:372:19)

#2 ResourceController.handle (package:aqueduct/src/http/resource_controller.dart:138:14)

#3 Controller.receive (package:aqueduct/src/http/controller.dart:174:30)
#4 _ControllerRecycler.receive (package:aqueduct/src/http/controller.dart:402:17)
#5 Controller.receive (package:aqueduct/src/http/controller.dart:206:28)

#6 Router.receive (package:aqueduct/src/http/router.dart:139:18)
#7 _RootZone.runUnaryGuarded (dart:async/zone.dart:1374:10)
#8 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#9 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:266:7)
#10 _ForwardingStreamSubscription._add (dart:async/stream_pipe.dart:134:11)
#11 _MapStream._handleData (dart:async/stream_pipe.dart:234:10)
#12 _ForwardingStreamSubscription._handleData (dart:async/stream_pipe.dart:166:13)
#13 _RootZone.runUnaryGuarded (dart:async/zone.dart:1374:10)
#14 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#15 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:266:7)
#16 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:779:19)
#17 _StreamController._add (dart:async/stream_controller.dart:655:7)
#18 _StreamController.add (dart:async/stream_controller.dart:597:5)
#19 _HttpServer._handleRequest (dart:_http/http_impl.dart:2837:19)
#20 new _HttpConnection. (dart:_http/http_impl.dart:2596:19)
#21 _RootZone.runUnaryGuarded (dart:async/zone.dart:1374:10)
#22 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#23 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:266:7)
#24 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:779:19)
#25 _StreamController._add (dart:async/stream_controller.dart:655:7)
#26 _StreamController.add (dart:async/stream_controller.dart:597:5)
#27 _HttpParser._headersEnd (dart:_http/http_parser.dart:399:19)
#28 _HttpParser._doParse (dart:_http/http_parser.dart:739:15)
#29 _HttpParser._parse (dart:_http/http_parser.dart:328:7)
#30 _HttpParser._onData (dart:_http/http_parser.dart:850:5)
#31 _RootZone.runUnaryGuarded (dart:async/zone.dart:1374:10)
#32 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#33 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:266:7)
#34 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:779:19)
#35 _StreamController._add (dart:async/stream_controller.dart:655:7)
#36 _StreamController.add (dart:async/stream_controller.dart:597:5)
#37 _Socket._onData (dart:io-patch/socket_patch.dart:1982:41)
#38 _RootZone.runUnaryGuarded (dart:async/zone.dart:1374:10)
#39 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#40 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:266:7)
#41 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:779:19)
#43 _StreamController.add (dart:async/stream_controller.dart:597:5)
#45 _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:1019:14)
#46 _microtaskLoop (dart:async/schedule_microtask.dart:43:21)
#47 _startMicrotaskLoop (dart:async/schedule_microtask.dart:52:5)
#48 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
#49 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:169:5)

Can anyone help me out? What am I missing here?

Thanks,

Regards,
Sumit Sharma

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions