_User Class objects do not show up on the Parse web browser - heroku

The browser shows the correct no of objects in the _User class (Parse Browser 1) but does not show any data (Parse browser 2). Although the data is there when I check on the mongoLab on Heroku.
I do not know if this is related but querying the _User class is taking unusually long time. Here's a sample log for the _User class -
2016-08-03T18:46:22.110230+00:00 heroku[router]: at=info method=POST path="/parse/classes/_User" host=xxxapp.herokuapp.com request_id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx fwd="xx.xx.xxx.xx" dyno=web.1 connect=1ms service=4187ms status=200 bytes=8287208
Compared to querying some other table -
2016-08-03T18:46:53.665939+00:00 heroku[router]: at=info method=POST path="/parse/classes/Messages" host=xxxapp.herokuapp.com request_id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx fwd="xx.xx.xxx.xx" dyno=web.1 connect=0ms service=74ms status=200 bytes=2087
This excess time taken in querying the _User class started after I was not able to view the objects of the _User class on the browser.

The bug is caused when one attempts to save a PFObject with the wrong value types. In my case I was attempting to save NSData instead of PFFile. The data shows up on the web browser if you delete the faulty PFObject from MongoLab.

Related

Laravel Echo with pusher disconnect after 30 seconds

i have a game project on github:
https://github.com/ynizon/lemming
I m using pusher to send next player or message event.
When i load my browser, it works. But, if i wait 30 seconds, the echo.pusher.connection.state will be disconnected.
On the https://github.com/ynizon/lemming/blob/main/resources/js/app.js
I have added (to fix this):
window.Echo.connector.pusher.connection.bind('state_change', function (states) {
if (states.current === 'disconnected') {
window.Echo.connector.pusher.connect();
}
});
But, i think it s not the good method.
Do you have the same problem than me ? How correct this ?
My env file have
BROADCAST_DRIVER=pusher
QUEUE_CONNECTION=sync
Thanks
In your Pusher dashboard Channels app settings, have you accidentally enabled Enable authorized connections? Enabling it will disconnect the client if it doesn't authorise into a private channel within 30 seconds.

GraphQL subscription from multiple browsers/tabs

I have an react frontend and a python backend (using ariadne==0.13.0, uvicorn==0.15.0, uvicorn[standard]==0.15.0, fastapi==0.68.1) communicationg over graphql subscriptions. Everything works fine as long as I do not reload the page or load the page in a new browser window from same IP. Then the page crashes and takes some time to recover - Depending on the websocket timeout configured in uvicorn. I am experiencing the same issue with both my frontend and the graphql playgorund.
I understand that the different browsers or tabs are identified with the same IP, Port and protocol what possibly messes up the existing connection, but still it should be possible the use the page from different tabs as seen in:
https://fastapi.tiangolo.com/advanced/websockets/
My code:
SCHEMA = load_schema_from_path("schema.graphql")
query = QueryType()
subscription = SubscriptionType()
app = FastAPI()
schema = make_executable_schema(SCHEMA, [query, subscription])
graphql_server = GraphQL(schema, debug=True)
app.add_route("/graphql", graphql_server)
app.add_websocket_route("/graphql", graphql_server)
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_methods=["POST", "GET"],
allow_headers=[
"accept",
"accept-language",
"content-language",
"content-type",
"x-apollo-tracing",
],
)
app.debug = True
uvicorn.run(app, host='0.0.0.0', port=7996)
The default setup for uvicorn is single threaded and the method implementing the subscription was synchronous and blocking. I had to reimplement it in an async manner.

Heroku Error Database when i make the deployment

i have a app, it's make with express and SQL, in localahost the app works perfectly, but when i make the deployment, the app works, but only part of the app.
The app has a Database makes with SQL, with two tables.
App: Database APP
I have access to the first table (alumnos), i can see the full list, show the individual item, and edit it.
But the other table (Empresas) i can see the full list, but when i try to go to edit or show one i have an issue.
Heroku shows me "Internal server error", but in "Views Logs" in Heroku, i can see the data values from the selection, and this error.
2021-06-16T05:39:21.076820+00:00 app[web.1]: Error: Failed tolookup view "empresas/mostrarempresa" in views directory "/app/views"
2021-06-16T05:39:21.076821+00:00 app[web.1]: at Function.render (/app/node_modules/express/lib/application.js:580:17)
2021-06-16T05:39:21.076822+00:00 app[web.1]: at ServerResponse.render (/app/node_modules/express/lib/response.js:1012:7)
2021-06-16T05:39:21.076822+00:00 app[web.1]: at paginadetallesEmpresa (file:///app/controllers/paginasControllers.js:84:9)
2021-06-16T05:39:21.076823+00:00 app[web.1]: at processTicksAndRejections (internal/process/task_queues.js:95:5)

loopback + remote calls + debug

if there is a server error, my XHR will return a 500 error code along with a vague description.
what is the best practice on viewing error logs, debug output, etc?
can this output be sent to my console?
what will work for me now is using the debug object.
var debug = require('debug')('my:debug:string');
then specifying the debug string when launching the app.
DEBUG=my:debug:string node .

Fix error "at=error code=H10 desc "app crashed" method = GET

I am getting an error in my heroku logs that I cannot figure out how to fix.
I read through a thread on stack overflow Heroku + node.js error (Web process failed to bind to $PORT within 60 seconds of launch). This seemed very similar to my problem.
I have developing my app with the express generator. So my bin folder holds the port information
var port = normalizePort(process.env.PORT || '3000');
app.set('port', port);
I know the process.env.PORT is necessary to open my heroku site. I initially assumed this would work well enough as my app.js only had a reference to express.
I could not get the page to open so I added the port information to my app.js file in addition to the bin folder.
app.set('port', (process.env.PORT || 3000));
app.listen(app.get('port'), function() {
console.log('Node app is running on port', app.get('port'));
});
I got this github page https://github.com/heroku/node-js-getting-started/blob/master/index.js#L16.
However, I am still getting the same error. I do not know where else to look. The only additional note I see with an error is
Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch.
These seem to be targeting the same problem.
What else is your app doing?
Note that the error indicates you didn't bind to the socket within 60 seconds. I agree that your app.set('port', (process.env.PORT || 3000)); looks just fine.
Maybe it's something else - maybe you're making a web callout or something before it even gets to that point, and that's what's consuming the time?

Resources