PayloadTooLargeError: request entity too large react native - node.js

Android Running app on sdk_gphone_x86
Sentry Logger [log]: Unhandled promise rejections will be caught by Sentry.
Sentry Logger [log]: Integration installed: ReactNativeErrorHandlers
Sentry Logger [log]: Integration installed: Release
Sentry Logger [log]: Integration installed: InboundFilters
Sentry Logger [log]: Integration installed: FunctionToString
Sentry Logger [log]: Integration installed: Breadcrumbs
Sentry Logger [log]: Integration installed: LinkedErrors
Sentry Logger [log]: Integration installed: Dedupe
Sentry Logger [log]: Integration installed: HttpContext
Sentry Logger [log]: Integration installed: EventOrigin
Sentry Logger [log]: Integration installed: SdkInfo
Sentry Logger [log]: Integration installed: DebugSymbolicator
Sentry Logger [log]: Integration installed: RewriteFrames
Sentry Logger [log]: Integration installed: ExpoManagedIntegration
device
false
PayloadTooLargeError: request entity too large
at readStream (C:\Users\hassn\AppData\Roaming\npm\node_modules\expo-cli\node_modules\raw-body\index.js:155:17)
at getRawBody (C:\Users\hassn\AppData\Roaming\npm\node_modules\expo-cli\node_modules\raw-body\index.js:108:12)
at read (C:\Users\hassn\AppData\Roaming\npm\node_modules\expo-cli\node_modules\body-parser\lib\read.js:77:3)
at jsonParser (C:\Users\hassn\AppData\Roaming\npm\node_modules\expo-cli\node_modules\body-parser\lib\types\json.js:135:5)
at call (D:\personal\teleMed-master\node_modules\connect\index.js:239:7)
at next (D:\personal\teleMed-master\node_modules\connect\index.js:183:5)
at remoteDevtoolsCorsMiddleware (C:\Users\hassn\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\dev-server\src\middleware\remoteDevtoolsCorsMiddleware.ts:31:3)
at call (D:\personal\teleMed-master\node_modules\connect\index.js:239:7)
at next (D:\personal\teleMed-master\node_modules\connect\index.js:183:5)
at serveStatic (D:\personal\teleMed-master\node_modules\serve-static\index.js:75:16)
I get this after expo start as soon as I run my app from iPhone. What is extra weird is that it's running code I've commented out, and is also running in some sort of infinite loop.
I'm unable to solve in react native can some one please help me out this issue enter image description here

Related

Serverless | I can’t create a new project using AWS NodeJs template

Running serverless create --template aws-nodejs --path test in the terminal, I found an error:
C:\Users\p????>serverless create --template aws-nodejs --path test
(node:25984) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
(Use `node --trace-warnings ...` to show where the warning was created)
Environment: win32, node 17.9.0, framework 3.12.0, plugin 6.2.1, SDK 4.3.2
Docs: docs.serverless.com
Support: forum.serverless.com
Bugs: github.com/serverless/serverless/issues
Error:
Could not download template. Ensure that you are using the latest version of Serverless Framework: EPERM: operation not permitted, open 'C:\Users\P????\AppData\Local\Temp\examples\aws-node-env-variables-encrypted-in-a-file\secrets.dev.yml.encrypted'

Sentry error logging with express does not send any errors

When I am trying to send errors to Sentry for a simple node.js Express server, I don't get any errors logged in Sentry itself. There are no inbound filters set up and it does not report anything filtered in the past 30 days. Allowed domains is set to *, which is I think the default. The code that I use is more or less the same as the example code in the documentation. However, when calling the endpoint nothing appears in Sentry and the debug lines do not show anything about an error even being sent.
How do I get Sentry to properly capture errors?
This is test.js
'use strict';
const express = require('express');
const Sentry = require('#sentry/node');
const app = express();
// TODO dotenv setting
const SENTRY_NODE_DSN = process.env.SENTRY_NODE_DSN || 'the ingest url from settings > client keys';
console.log(`Started logging errors at sentry on DSN ${SENTRY_NODE_DSN}`);
// Sentry
Sentry.init({
dsn: SENTRY_NODE_DSN,
debug: true,
});
// The request handler must be the first middleware on the app
app.use(Sentry.Handlers.requestHandler());
const port = process.argv[2];
if (port === undefined) {
console.log(`Please specify a port as first argument`);
process.exit(0);
}
app.get('/test', () => {
throw new Error('test');
});
// The error handler must be before any other error middleware and after all controllers
app.use(Sentry.Handlers.errorHandler({
shouldHandleError(error) {
return true;
}
}));
app.listen(port);
We start it with node ./test.js 3000
Then from a different window we execute wget -- localhost:3000/test which gives the following output.
--2021-07-29 14:03:01-- http://localhost:3000/test
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:3000... connected.
HTTP request sent, awaiting response... 500 Internal Server Error
2021-07-29 14:03:01 ERROR 500: Internal Server Error.
The output from the express server is this:
$ node ./test.js 3000
Started logging errors at sentry on DSN same url as in the code above
Sentry Logger [Log]: Integration installed: InboundFilters
Sentry Logger [Log]: Integration installed: FunctionToString
Sentry Logger [Log]: Integration installed: Console
Sentry Logger [Log]: Integration installed: Http
Sentry Logger [Log]: Integration installed: OnUncaughtException
Sentry Logger [Log]: Integration installed: OnUnhandledRejection
Sentry Logger [Log]: Integration installed: LinkedErrors
Error: test
at /var/www/vhosts/myproject/test.js:28:8
at Layer.handle [as handle_request] (/var/www/vhosts/myproject/node_modules/express/lib/router/layer.js:95:5)
at next (/var/www/vhosts/myproject/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/var/www/vhosts/myproject/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/var/www/vhosts/myproject/node_modules/express/lib/router/layer.js:95:5)
at /var/www/vhosts/myproject/node_modules/express/lib/router/index.js:281:22
at Function.process_params (/var/www/vhosts/myproject/node_modules/express/lib/router/index.js:335:12)
at next (/var/www/vhosts/myproject/node_modules/express/lib/router/index.js:275:10)
at Domain.<anonymous> (/var/www/vhosts/myproject/node_modules/#sentry/node/dist/handlers.js:321:13)
at Domain.run (domain.js:370:15)
In my case this code was correct, but the issue was that I was running this script in wsl while on a VPN, and the request was being sent, but hang. Experimentally it appears that Sentry does not log anything when trying to send errors when in debug mode, so you can't infer anything from that.
To test if Sentry does actually send anything, try the even simpler version
const Sentry = require('#sentry/node');
const SENTRY_NODE_DSN = 'the ingest url';
Sentry.init({
dsn: SENTRY_NODE_DSN,
debug: true,
});
Sentry.captureException(new Error('test exception'));
If the script hangs (does not terminate), it means that the http-request to the sentry servers is not being completed. This is likely due to a network issue on your side.

Hello Folks: I am having problem in starting sails app in nodejs. can anyone put forth their insights on that?

I tried running the latest version of node and postgresql, but was having problem i deprecated node to 13.12.0 and sails-postgresql to 1.0.2 as mentioned in one of the blog. still the error is coming. Stack trace is as below:
sails lift
info: Starting app...
(node:10460) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use node --trace-warnings ... to show where the warning was created)
info: Initializing apianalytics hook... (requests to monitored routes will be logged!)
info: ·• Auto-migrating... (alter)
info: Hold tight, this could take a moment.
error:
error: Error: Sails is taking too long to load.
Troubleshooting tips:
-• Were you still reading/responding to an interactive prompt?
(Whoops, sorry! Please lift again and try to respond a bit more quickly.)
-• Do you have a lot of stuff in assets/? Grunt might still be running.
(Try increasing the hook timeout. Currently it is 40000.
e.g. sails lift --hookTimeout=80000)
-• Is blueprints a custom or 3rd party hook?
(If initialize() is using a callback, make sure it's being called.)
at Timeout.tooLong [as _onTimeout] (C:\Users\dearm\OneDrive\Desktop\my work\sails-logrocket\myapp\node_modules\sails\lib\app\private\loadHooks.js:191:21)
at listOnTimeout (internal/timers.js:554:17)
at processTimers (internal/timers.js:497:7)
error: Could not load Sails app.
error:
error: Tips:
error: • First, take a look at the error message above.
error: • Make sure you've installed dependencies with npm install.
error: • Check that this app was built for a compatible version of Sails.
error: • Have a question or need help? (http://sailsjs.com/support)
complete code is here https://github.com/mannawar/sails_app
Try using Node version 10 and sails-postgresql version 2.0.0

Kerberos SASL authentication using node-rdkafka

I am having an issue trying to connect to a Kafka instance that uses Kerberos SASL authentication using the node-rdkafka npm module, and the lack of documentation and examples out there are making things very difficult to solve the issue. I am using the Alpine setup found here
to pull in all of the necessary librdkafka and node-rdkafka dependencies and create an image. I am trying to run my container with the following configuration object for a node-rdkafka producer to connect to Kafka instance:
'debug': 'all',
'client.id': 'kafka',
'metadata.broker.list': KAFKA_DOMAINS,
'sasl.kerberos.principal': '<id>#<REALM>',
'sasl.kerberos.keytab': '/path/to/<id>.keytab',
'sasl.kerberos.service.name': 'kafka',
'security.protocol': 'sasl_plaintext',
'sasl.kerberos.kinit.cmd': 'kinit -kt /path/to/<id>.keytab <id>#<REALM>',
'dr_cb': true,
'event_cb': true
When I try to run the container, it hangs up and then throws the following error:
[2019-02-05T17:09:59.637Z] ERROR: kafka/7 on 95c927d11411: broker transport failure (err.code=-195)
Error: Local: Broker transport failure
at Function.createLibrdkafkaError [as create] (/opt/rdkafka/node_modules/node-rdkafka/lib/error.js:261:10)
at /opt/rdkafka/node_modules/node-rdkafka/lib/client.js:339:28
Here is the output from the features and libkafkaversion log statements:
[2019-02-05T17:09:29.519Z] INFO: kafka/7 on 95c927d11411:
[ 'gzip',
'snappy',
'ssl',
'sasl',
'regex',
'lz4',
'sasl_gssapi',
'sasl_plain',
'sasl_scram',
'plugins' ]
[2019-02-05T17:09:29.521Z] INFO: kafka/7 on 95c927d11411: 0.11.5
What am I missing that I am unable to connect? Am I missing some environment variables? I know that the Java implementation of librdkafka involves passing the REALM, KDC_HOST, and some .conf files (krb5 and jaas). Do I have to set up some kind of environment variable? I can find no examples or solutions.

TIBCO MDM 9 : log4j:WARN No appenders could be found for logger (RulebaseCustomFunction)

Getting below error while I am trying to print MqLog to elink.log via RulebaseCustomFunction (MDM 9)\
ERROR [stderr] (TIBCO EMS Session Dispatcher (895)) log4j:WARN No appenders could be found for logger (RulebaseCustomFunction).
ERROR [stderr] (TIBCO EMS Session Dispatcher (895)) log4j:WARN Please initialize the log4j system properly.
How to Configure in order to avoid above error?
Can somebody help me, please?
Default log4j configuration provided out-of-box does not have appender defined for RulebaseCustomFunction. However, you can always add new appender to ConfigValues.xml
Try adding below in "Logging" category-
<ConfValue description="The debugging logging level CustomRulebaseFunction" name="Logging Level for CustomRulebaseFunction" propname="log4j.logger.RulebaseCustomFunction" sinceVersion="8.0" visibility="All" isHotDeployable="true" isHidden="false">
<ConfString default="DEBUG,elink,error" value="DEBUG,elink,error"/>
</ConfValue>

Resources