I have a java GAE application running, in which i make several log statements.
I log the statements like this:
Logger log = Logger.getLogger(...class.getName());
log.info("status: " + status);
and have set the logginlevel to .level = INFO in the loggin.properties.xml.
This is an example of what i se the the console:
{
metadata: {…}
protoPayload: {…}
insertId: "2016-09-27|07:52:50.372995-07|10.106.9.209|-787832401"
log: "appengine.googleapis.com/request_log"
httpRequest: {
status: 200
}
operation: {
id: 064be687375a060001737e6c61676b61676568757365742d636c69636b2d616e642d636f6c6c6563 74000131000100"
producer: "appengine.googleapis.com/request_id"
}
}
Sadly i cant see the logstatements in the console.cloud.google.com/logs/viewer.
Am i missing something? Thx in advance.
Are you using AE Flexible? Try looking at the "All logs" or specifically in "app" log.
Related
Starting LWC Local Development.
Username: test-lgcvzacysqx3#example.com
Api Version: 49.0
[HPM] Proxy created: / -> https://ability-customization-2906-dev-ed.my.salesforce.com
[HPM] Subscribed to http-proxy events: [ 'proxyReq', 'error', 'close' ]
cp: no such file or directory: /Users/admin/Desktop/suman/force-app/main/default/staticresources/*
cp: no such file or directory: /Users/admin/Desktop/suman/force-app/main/default/contentassets/*
LWR6003: Listening on :3333
Server up on http://localhost:3333
LWR6000: Created version hash "f5aff7264b"
LWR6001: Writing /Users/admin/Desktop/suman/.localdevserver/webruntime/custom-component/f617504cf1/dev/en-GB/c/myfirstLwc.js...
LWR6001: Writing /Users/admin/Desktop/suman/.localdevserver/webruntime/custom-component/f617504cf1/dev/en-GB/c/myfirstLwc.js...
CLIError: timed out
at Object.error (/Users/admin/.local/share/sfdx/client/7.163.0-ea5a9c6/node_modules/#oclif/core/lib/errors/index.js:28:15)
at /Users/admin/.local/share/sfdx/client/7.163.0-ea5a9c6/node_modules/#oclif/core/lib/cli-ux/index.js:25:66
at async flush (/Users/admin/.local/share/sfdx/client/7.163.0-ea5a9c6/node_modules/#oclif/core/lib/cli-ux/index.js:121:9) {
oclif: { exit: 2 },
code: undefined
}
CLIError: timed out
at Object.error (/Users/admin/.local/share/sfdx/client/7.163.0-ea5a9c6/node_modules/#oclif/core/lib/errors/index.js:28:15)
at /Users/admin/.local/share/sfdx/client/7.163.0-ea5a9c6/node_modules/#oclif/core/lib/cli-ux/index.js:25:66
at async flush (/Users/admin/.local/share/sfdx/client/7.163.0-ea5a9c6/node_modules/#oclif/core/lib/cli-ux/index.js:121:9) {
oclif: { exit: 2 },
code: undefined
}
LWR6004: Server is shutdown
Error: timed out
at Object.error (/Users/admin/.local/share/sfdx/client/7.163.0-ea5a9c6/node_modules/#oclif/core/lib/errors/index.js:28:15)
at /Users/admin/.local/share/sfdx/client/7.163.0-ea5a9c6/node_modules/#oclif/core/lib/cli-ux/index.js:25:66
at async flush (/Users/admin/.local/share/sfdx/client/7.163.0-ea5a9c6/node_modules/#oclif/core/lib/cli-ux/index.js:121:9)
10:01:49.554 sfdx force:lightning:lwc:start
ended with exit code 1
Error: The local development server exited unexpectedly with code 1.
I faced the similar error today
But somehow made it running using the below solution
Open the below path
C:/Users/UserName/AppData/Local/sfdx/client/7.163.0-ea5a9c6/node_modules/#oclif/core/lib/cli-ux
And edit the async flush() method in the index.js file
from 10000 to 600000
await timeout(flush(), 600000);
Hope this helps.
found some articles here for help
I've inherited a simple site with staging and production projects living on Google App Engine. Yesterday made a simple deploy to staging (using CircleCI), the first deploy since January. Since then the site won't load and the logs show an exception we haven't had before:
"Cannot read property 'parsePath' of undefined" when trying to go to the home page at: /
Our code does not make any call to 'parsePath', so it must be some underlying machinery.
I reverted the code change and re-pushed the staging branch with the code that's been live since January (and is live and error-free right now in production), deploy was successful, but the same symptom is there still in staging! (Needless to say, we can't deploy anything to production until we know what the heck is going on)
I've been looking through the circleCI deploy logs for clues- one difference is during the "gcloud auth activate-service-account" step, it wasn't able to update the compute/zone property (but the build still succeeded):
Updated property [core/project].
WARNING: You do not appear to have access to project [veryloudstatic] or it does not exist.
Updated property [compute/zone].
What should I be looking at on the GAE side? Has anyone seen this exception before, or know enough about how GAE works to suggest places to troubleshoot? We haven't made any changes to these GAE projects in the past few months, so I'm wondering if some internal updates could be the issue?
Cannot read property 'parsePath' of undefined
Expand all | Collapse all {
insertId: "owonpfihz4box5kp7"
labels: {
appengine.googleapis.com/instance_name: "aef-default-20190620t195308-lsn2"
compute.googleapis.com/resource_id: "2700574583511472701"
compute.googleapis.com/resource_name: "b6282fd5dc84"
compute.googleapis.com/zone: "us-central1-f"
}
logName: "projects/veryloudstatic/logs/appengine.googleapis.com%2Fstderr"
receiveTimestamp: "2019-06-21T13:53:47.746443513Z"
resource: {
labels: {
module_id: "default"
project_id: "veryloudstatic"
version_id: "20190620t195308"
}
type: "gae_app"
}
textPayload: "Cannot read property 'parsePath' of undefined
"
timestamp: "2019-06-21T13:53:45Z"
}
35.233.167.246 - "GET /" 500 148 "-" "GoogleStackdriverMonitoring-UptimeChecks(https://cloud.google.com/monitoring)"
Expand all | Collapse all {
httpRequest: {
latency: "0.166s"
referer: "-"
remoteIp: "35.233.167.246"
requestMethod: "GET"
requestUrl: "/"
responseSize: "148"
status: 500
userAgent: "GoogleStackdriverMonitoring-UptimeChecks(https://cloud.google.com/monitoring)"
}
insertId: "28alo0fexgmee"
jsonPayload: {…}
labels: {…}
logName: "projects/veryloudstatic/logs/appengine.googleapis.com%2Fnginx.request"
receiveTimestamp: "2019-06-21T13:53:47.746443513Z"
resource: {…}
timestamp: "2019-06-21T13:53:45.536Z"
trace: "projects/veryloudstatic/traces/5190f7942330e15370ff65d1c79c5963"
}
Without more of a stack trace its hard to tell, but check your dependency versions if there are any. An underlying dependency may have updated. Make sure to check both your app code and the CircleCI base image.
I'm creating an AppEngine application with python3.7 standard environment. The application works ok locally, but when uploaded it throws a 500 error in the browser it shows:
"Internal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application."
Debugging is not enabled for python3.7 (it tells me that when viewing the debugger). And the log entries don't have the hint of an error message within them against the 500 response.
How do I proceed to debug and understand what's happening to the application?
I should note that I'm attempting to use a Selenium webdriver to run headless chrome and I'm not 100% sure this is compatible with this environment, I was just trying to give it a go.
Adding in log as suggested
https://console.cloud.google.com/logs/viewer?project={project-id}&resource=gae_app%2Fmodule_id%2Fdefault%2Fversion_id%2F20180916t193009&minLogLevel=0&expandAll=false×tamp=2018-09-17T18%3A18%3A21.295000000Z&customFacets&limitCustomFacetWidth=true&interval=PT1H&scrollTimestamp=2018-09-17T18%3A16%3A59.235127000Z&advancedFilter=resource.type%3D%22gae_app%22%0Aresource.labels.zone%3D%22us-west2-3%22%0Aresource.labels.project_id%3D%22{project-id}%22%0Aresource.labels.version_id%3D%2220180916t193009%22%0Aresource.labels.module_id%3D%22default%22%0Atimestamp%3D%222018-09-17T18%3A16%3A57.883459000Z%22%0AinsertId%3D%225b9fef9e0005ebc57890705d%22&dateRangeUnbound=both
{
httpRequest: {
status: 500
}
insertId: "5b9fef9e0005ebc57890705d"
labels: {
clone_id: "00c61b117c38b726d0ba73ce89f222fe10b9b189fae907de84b949ab7a3b88ec4bdc4484"
}
logName: "projects/{project-id}/logs/appengine.googleapis.com%2Frequest_log"
operation: {
first: true
id: "5b9fef9900ff0d7b03fbff00a7c100016d7e7370656e642d6d6f6e69746f720001323031383039313674313933303039000100"
last: true
producer: "appengine.googleapis.com/request_id"
}
protoPayload: {
#type: "type.googleapis.com/google.appengine.logging.v1.RequestLog"
appEngineRelease: "1.9.64"
appId: "m~{project-id}"
cost: 4.7272999999999996e-8
endTime: "2018-09-17T18:17:02.387819Z"
finished: true
first: true
host: "{project-id}.appspot.com"
httpVersion: "HTTP/1.1"
instanceId: "00c61b117c38b726d0ba73ce89f222fe10b9b189fae907de84b949ab7a3b88ec4bdc4484"
instanceIndex: -1
ip: "80.195.185.178"
latency: "4.504360s"
line: [
0: {
logMessage: "This request caused a new process to be started for your application, and thus caused your application code to be loaded for the first time. This request may thus take longer and use more CPU than a typical request for your application."
severity: "INFO"
time: "2018-09-17T18:17:02.387649Z"
}
]
megaCycles: "6127"
method: "GET"
requestId: "5b9fef9900ff0d7b03fbff00a7c100016d7e7370656e642d6d6f6e69746f720001323031383039313674313933303039000100"
resource: "/"
responseSize: "423"
startTime: "2018-09-17T18:16:57.883459Z"
status: 500
traceId: "37cee4aaaa0b14fbaa6d57b7842527dc"
traceSampled: true
urlMapEntry: "auto"
userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36"
versionId: "20180916t193009"
wasLoadingRequest: true
}
receiveTimestamp: "2018-09-17T18:17:02.563417716Z"
resource: {
labels: {
module_id: "default"
project_id: "{project-id}"
version_id: "20180916t193009"
zone: "us-west2-3"
}
type: "gae_app"
}
severity: "INFO"
timestamp: "2018-09-17T18:16:57.883459Z"
trace: "projects/{project-id}/traces/37cee4aaaa0b14fbaa6d57b7842527dc"
traceSampled: true
}
In order to debug this further I inserted a try/catch block like so:
try:
{application code}
except Exception as e:
return str(e)
This lands the top level error message in the browser when the application fails.
When I'm testing my website locally everything works. But in production, I get the following error: Couldn't lease a task: API error 1 (taskqueue: UNKNOWN_QUEUE)
I'm pretty sure my code is correct since it works locally. My best guess is that there is something wrong with the queue.yaml file, but it's dead simple:
queue:
- name: daemonQueue
mode: pull
What could I be doing wrong?
EDIT:
Turns out enqueueing fails as well: TickTask enqueue error: Failed to insert task: API error 1 (taskqueue: UNKNOWN_QUEUE)
Here is how I'm enqueueing the task.
// Add the task to the queue.
func EnqueueWithName(c sessions.Context, task interface{}, tag string, name string) (err error) {
buffer := new(bytes.Buffer)
err = gob.NewEncoder(buffer).Encode(task)
if err != nil {
return
}
newTask := &taskqueue.Task{
Method: "PULL",
Payload: buffer.Bytes(),
Tag: tag,
Name: name}
newTask, err = taskqueue.Add(c, newTask, "daemonQueue")
return err
}
You don't have the queue configured in production. Make sure you are deploying your whole app directory so queue.yaml get uploaded. Point goapp deploy or appcfg.py at the directory holding app.yaml and queue.yaml, not at app.yaml directly.
I would like to stock my logs into files:
Here is how I declare my appenders in Config.groovy:
log4j = {
appenders {
// console name:'stdout', layout:pattern(conversionPattern: '%c{2} %m%n')
file name: "scraperServiceDetailedLogger",
file: "target/scraperServiceDetailed.log"
file name: "scraperServiceLogger",
file: "target/scraperService.log"
file name: "filterLogger",
file: "target/filter.log"
}
error 'org.codehaus.groovy.grails.web.servlet', // controllers
'org.codehaus.groovy.grails.web.pages', // GSP
'org.codehaus.groovy.grails.web.sitemesh', // layouts
'org.codehaus.groovy.grails.web.mapping.filter', // URL mapping
'org.codehaus.groovy.grails.web.mapping', // URL mapping
'org.codehaus.groovy.grails.commons', // core / classloading
'org.codehaus.groovy.grails.plugins', // plugins
'org.codehaus.groovy.grails.orm.hibernate', // hibernate integration
'org.springframework',
'org.hibernate',
'net.sf.ehcache.hibernate'
error scraperServiceDetailedLogger: "grails.app.service.personalcreditcomparator.ScraperService"
info scraperServiceLogger: "grails.app.jobs.personalcreditcomparator.ScraperJob"
info filterLogger: "grails.app.conf.personalcreditcomparator.AdministratorInterfaceProtectorFilters"
}
The 3 files are created properly but only scraperServiceDetailedLogger stores the logs properly. The other two files remain empty.
The level of logging is respected while calling the log.
What am I missing ?
Thank you for any help provided.
For quartz jobs try the Logger prefix of 'grails.app.task'
info scraperServiceLogger: "grails.app.task.personalcreditcomparator.ScraperJob"
And for filters try the Logger prefix of 'grails.app.filters'
info filterLogger: "grails.app.filters.personalcreditcomparator.AdministratorInterfaceProtectorFilters"