Skip to content
New issue

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

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

Already on GitHub? # to your account

CustomError [ProtocolError]: missing required 'header' #1986

Open
ragavendra opened this issue Apr 26, 2024 · 0 comments
Open

CustomError [ProtocolError]: missing required 'header' #1986

ragavendra opened this issue Apr 26, 2024 · 0 comments

Comments

@ragavendra
Copy link

ragavendra commented Apr 26, 2024

protobuf.js version: 7.2.6

I have this issue which happens intermittently.

fetch("url").then(res => {
                if (!res.ok) {
                    console.error("Error - " + JSON.stringify(res));
                    throw error;
                }

                response.arrayBuffer().then(arryBuff => {
                                const feed = GtfsRealtimeBindings.transit_realtime.FeedMessage.decode(new Uint8Array(arryBuff);

                                                }, (rsn) => {
                                                   console.error("Err rsn - " + rsn);

                                                });

                                res();
                                }, (rsn) => {
                                   console.error("Err fetch rsn - " + rsn);
                                });
Error - {}
⨯ unhandledRejection: CustomError [ProtocolError]: missing required 'header'
        at Object.CustomError [as ProtocolError] (/run/media/user/96242da8-b37a-4597-9b64-uuidstr/repos/appName/node_modules/protobufjs/src/util/minimal.js:266:20)
at Function.decode (/run/media/user/96242da8-b37a-4597-9b64-uuidstr/repos/appName/node_modules/gtfs-realtime-bindings/gtfs-realtime.js:155:29)
        at eval (webpack-internal:///(api)/./lib/gtfsTripUpdate.ts:81:117)
        at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
instance: FeedMessage { entity: [] }
        }

or some other times.

RangeError: index out of range: 229376 + 1 > 229376
        at indexOutOfRange (/run/media/user/96242da8-b37a-4597-9b64-uuidstr/repos/appName/node_modules/gtfs-realtime-bindings/node_modules/protobufjs/src/reader.js:13:12)
        at Reader.readLongVarint (/run/media/user/96242da8-b37a-4597-9b64-uuidstr/repos/appName/node_modules/gtfs-realtime-bindings/node_modules/protobufjs/src/reader.js:144:23)
        at Reader.read_int64 [as int64] (/run/media/user/96242da8-b37a-4597-9b64-uuidstr/repos/appName/node_modules/gtfs-realtime-bindings/node_modules/protobufjs/src/reader.js:396:35)
        at Function.decode (/run/media/user/96242da8-b37a-4597-9b64-uuidstr/repos/appName/node_modules/gtfs-realtime-bindings/gtfs-realtime.js:1370:51)
        at Function.decode (/run/media/user/96242da8-b37a-4597-9b64-uuidstr/repos/appName/node_modules/gtfs-realtime-bindings/gtfs-realtime.js:1671:95)
        at Function.decode (/run/media/user/96242da8-b37a-4597-9b64-uuidstr/repos/appName/node_modules/gtfs-realtime-bindings/gtfs-realtime.js:1042:102)
        at Function.decode (/run/media/user/96242da8-b37a-4597-9b64-uuidstr/repos/appName/node_modules/gtfs-realtime-bindings/gtfs-realtime.js:716:80)
at Function.decode (/run/media/user/96242da8-b37a-4597-9b64-uuidstr/repos/appName/node_modules/gtfs-realtime-bindings/gtfs-realtime.js:132:79)
        at eval (webpack-internal:///(api)/./lib/gtfsTripUpdate.ts:81:117)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
        ⨯ unhandledRejection: RangeError: index out of range: 229376 + 1 > 229376
        at indexOutOfRange (/run/media/user/96242da8-b37a-4597-9b64-uuidstr/repos/appName/node_modules/gtfs-realtime-bindings/node_modules/protobufjs/src/reader.js:13:12)
        at Reader.readLongVarint (/run/media/user/96242da8-b37a-4597-9b64-uuidstr/repos/appName/node_modules/gtfs-realtime-bindings/node_modules/protobufjs/src/reader.js:144:23)
        at Reader.read_int64 [as int64] (/run/media/user/96242da8-b37a-4597-9b64-uuidstr/repos/appName/node_modules/gtfs-realtime-bindings/node_modules/protobufjs/src/reader.js:396:35)
        at Function.decode (/run/media/user/96242da8-b37a-4597-9b64-uuidstr/repos/appName/node_modules/gtfs-realtime-bindings/gtfs-realtime.js:1370:51)
        at Function.decode (/run/media/user/96242da8-b37a-4597-9b64-uuidstr/repos/appName/node_modules/gtfs-realtime-bindings/gtfs-realtime.js:1671:95)
        at Function.decode (/run/media/user/96242da8-b37a-4597-9b64-uuidstr/repos/appName/node_modules/gtfs-realtime-bindings/gtfs-realtime.js:1042:102)
        at Function.decode (/run/media/user/96242da8-b37a-4597-9b64-uuidstr/repos/appName/node_modules/gtfs-realtime-bindings/gtfs-realtime.js:716:80)
at Function.decode (/run/media/user/96242da8-b37a-4597-9b64-uuidstr/repos/appName/node_modules/gtfs-realtime-bindings/gtfs-realtime.js:132:79)
        at eval (webpack-internal:///(api)/./lib/gtfsTripUpdate.ts:81:117)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
        ⨯ unhandledRejection: RangeError: index out of range: 229376 + 1 > 229376
        at indexOutOfRange (/run/media/user/96242da8-b37a-4597-9b64-uuidstr/repos/appName/node_modules/gtfs-realtime-bindings/node_modules/protobufjs/src/reader.js:13:12)
        at Reader.readLongVarint (/run/media/user/96242da8-b37a-4597-9b64-uuidstr/repos/appName/node_modules/gtfs-realtime-bindings/node_modules/protobufjs/src/reader.js:144:23)
        at Reader.read_int64 [as int64] (/run/media/user/96242da8-b37a-4597-9b64-uuidstr/repos/appName/node_modules/gtfs-realtime-bindings/node_modules/protobufjs/src/reader.js:396:35)
        at Function.decode (/run/media/user/96242da8-b37a-4597-9b64-uuidstr/repos/appName/node_modules/gtfs-realtime-bindings/gtfs-realtime.js:1370:51)
        at Function.decode (/run/media/user/96242da8-b37a-4597-9b64-uuidstr/repos/appName/node_modules/gtfs-realtime-bindings/gtfs-realtime.js:1671:95)
        at Function.decode (/run/media/user/96242da8-b37a-4597-9b64-uuidstr/repos/appName/node_modules/gtfs-realtime-bindings/gtfs-realtime.js:1042:102)
        at Function.decode (/run/media/user/96242da8-b37a-4597-9b64-uuidstr/repos/appName/node_modules/gtfs-realtime-bindings/gtfs-realtime.js:716:80)
at Function.decode (/run/media/user/96242da8-b37a-4597-9b64-uuidstr/repos/appName/node_modules/gtfs-realtime-bindings/gtfs-realtime.js:132:79)
        at eval (webpack-internal:///(api)/./lib/gtfsTripUpdate.ts:81:117)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)


Proto file - https://github.com/MobilityData/gtfs-realtime-bindings/blob/master/gtfs-realtime.proto

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

No branches or pull requests

1 participant