Gcloud::Datastore::ApiError - Api call runQuery is not working - ruby-on-rails

When i run on local. Everything is going okay.
But my appication is not running on cloud provide url
https://<your-project-id>.appspot.com
But working Great on locally.
When first time i deploy its work for me https://<your-project-id>.appspot.com but when i add class and apply add, delete, edit operation its not work on https://<your-project-id>.appspot.com but still working on local.
After deploy
"response": {
"betaSettings": {
"has_docker_image": "True"
},
"name": "apps/trial-project-1103/modules/default/versions/20151021t211200",
"handlers": [
{
"securityLevel": "SECURE_NEVER",
"authFailAction": "AUTH_FAIL_ACTION_REDIRECT",
"urlRegex": ".*",
"login": "LOGIN_OPTIONAL",
"script": {
"scriptPath": "PLACEHOLDER"
}
}
],
"manualScaling": {
"instances": 1
},
"vm": true,
"#type": "type.googleapis.com/google.appengine.v1beta4.Version",
"runtime": "custom",
"id": "20151021t211200",
"resources": {
"diskGb": 10,
"cpu": 0.5,
"memoryGb": 1.2999999523162842
},
"threadsafe": true
},
"done": true,
"name": "apps/trial-project-1103/operations/e302b28c-6984-4362-a823-891f8806e10d",
"metadata": {
"target": "apps/trial-project-1103/modules/default/versions/20151021t211200",
"insertTime": "2015-10-21T16:14:55.935Z",
"method": "google.appengine.v1beta4.Versions.CreateVersion",
"user": "sajjadmurtaza.nxb#gmail.com",
"operationType": "create_version",
"endTime": "2015-10-21T16:17:44.649Z",
"#type": "type.googleapis.com/google.appengine.v1beta4.OperationMetadata"
}
}
Please guide me why this is happening.?

It's impossible to answer your first question without knowing a lot more about your app.
To answer your second, logs are found in the Google Cloud Platform Developers Console. Select your project, then navigate to Monitoring > Logs. You'll be able to see all of the logs for your project.

Have you successfully followed this tutorial?
https://cloud.google.com/ruby/getting-started/hello-world

if you can't ssh into the machine & see the production.log. then, you can enable logging by adding the following to config/environments/production.rb & deploy again
config.consider_all_requests_local = true
This will show the error in the browser itself

Be sure that you've enabled Datastore API in the Developer Console. Also, double check your Project ID and your Dataset ID (which should be the same as the project ID).
In my experience, these are the most common reasons for this error.

Related

Google Workspace Marketplace addon present in Gmail Web and Android but missing in Gmail iOS

We have developed a Google Workspace Addon which uses Alternate Runtimes. It works fine on the WEB and ANDROID platforms, but not on iOS. No addon icon is present at the bottom when opening an email in the Gmail iOS app.
To clarify, the addon is entirely missing from the account, so there might be an interpretation issue with the manifest file. No logging is being created in Cloud Console's Logs Explorer, so no details there.
Opened a support ticket with Google which escalated it to the engineering team and they said:
"We received an update today and we have been able to reproduce this scenario on our end and it seems the problem is related to the add on and not the way it was deployed to Marketplace.
In this case since the issue is related to the Add on deployment we will not be able to further investigate on our end but if you believe it is related to a bug on our end you can submit a bug by accessing the following link https://developers.google.com/gmail/api/support#bug or you can also visit Stack Overflow as we have hundreds of developers and Google engineers that can provide you some insight about the issue that you are experiencing."
What is wrong with this deployment? I thought the Workspace addons were unified across all platforms. Manifest file below.
{
"oauthScopes": ["https://www.googleapis.com/auth/gmail.send", "https://www.googleapis.com/auth/gmail.addons.execute", "https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/userinfo.profile", "https://www.googleapis.com/auth/script.locale", "https://www.googleapis.com/auth/gmail.addons.current.message.readonly", "https://www.googleapis.com/auth/gmail.addons.current.action.compose", "https://www.googleapis.com/auth/gmail.addons.current.message.metadata"],
"addOns": {
"common": {
"name": "***",
"logoUrl": "***",
"useLocaleFromApp": true,
"universalActions": [{
"label": "My Emails",
"openLink": "***"
}, {
"label": "Frequently Asked Questions",
"openLink": "***"
}, {
"label": "Mobile Help",
"openLink": "***"
}, {
"label": "Contact us",
"openLink": "***"
}, {
"label": "My Account",
"openLink": "***"
}]
},
"gmail": {
"contextualTriggers": [{
"unconditional": {
},
"onTriggerFunction": "redacted"
}],
"composeTrigger": {
"selectActions": [{
"text": "redacted",
"runFunction": "redacted"
}],
"draftAccess": "METADATA"
},
"homepageTrigger": {
"runFunction": "redacted"
}
}
}
}
For anyone else down the rabbit hole I've been down in the last few hours.
The Google Workspace instructions on Set up an Apple push certificate might have helped.
However I still couldn't get the add-on to appear deploying as an alternative runtime from Node JS. Instead I refactored the UI in App Scripts and just fetched data that required more work from a server hosted on Cloud Run.

Can't add Teams bot to a channel

This was originally a support ticket to Microsoft. However they told they don't do dev support without paying for it. They directed me to Stack Overflow, so here goes nothing.
I'm developing a Bot for Microsoft Teams. I have registered my bot with Azure Active Directory, & Bot Framework. I have uploaded my app to Team, without any errors. My bot is currently able to send direct messages to Teams users. However, when I try to add my bot to a Teams channel, I get unhelpful errors.
I click the dropdown under my app in the Apps tab:
I click "Add to a Team", then select a channel:
After clicking the button "Set up a bot", I get the following error message:
I have checked & rechecked my webApplicationInfo.id & webApplicationInfo.applicationPermissions numerous times, and I'm at a loss for what could be amiss. I don't see how either of these fields could be wrong given, I can authenticate with both the Microsoft Graph & Bot Framework apis using these values. Here's a slightly redacted version of my Teams app manifest:
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.8/MicrosoftTeams.schema.json",
"manifestVersion": "1.8",
"version": "1.0.15",
"id": "<TEAMS_APP_ID>",
"packageName": "ambition",
"developer": {
"name": "Ambition",
"websiteUrl": "https://ambition.com",
"privacyUrl": "https://ambition.com/privacy",
"termsOfUseUrl": "https://ambition.com/pages/terms"
},
"icons": {
"color": "logo_opaque_192x192.png",
"outline": "logo_transparent_32x32.png"
},
"name": {
"short": "Ambition",
"full": ""
},
"description": {
"short": "Motivate & Recognize",
"full": "Ask Marketing"
},
"accentColor": "#FFFFFF",
"permissions": [
"identity",
"messageTeamMembers"
],
"validDomains": [
"ambition.com"
],
"bots": [
{
"botId": "<AZURE_ACTIVE_DIRECTORY_CLIENT_ID>",
"scopes": [
"team",
"personal",
"groupchat"
],
"isNotificationOnly": true
}
],
"webApplicationInfo": {
"id": "<AZURE_ACTIVE_DIRECTORY_CLIENT_ID>",
"resource": "https://ambition.com",
"applicationPermissions": [
"Channel.ReadBasic.All",
"ChannelMessage.Send",
"Group.Read.All",
"Notifications.ReadWrite.CreatedByApp",
"Team.ReadBasic.All",
"User.Read",
"User.ReadBasic.All"
]
}
}
The webApplicationInfo section is really only for two things: Tab SSO, and Resource-Specific Consent. Are you trying to implement either one of those? If not, removing it is definitely the best option, as you've noted in your answer.
In addition, I see that the resource values you've put in there are Microsoft Graph Scopes, whereas the applicationPermissions section is expecting a different list of options (they look kind of similar, but their not the same thing). See here for more: https://learn.microsoft.com/en-gb/microsoftteams/platform/graph-api/rsc/resource-specific-consent#resource-specific-permissions
Don't really know why this works, but I compared my app manifest to the one generated by going through this tutorial: https://learn.microsoft.com/en-us/microsoftteams/platform/build-your-first-app/build-bot.
Removing the webApplicationInfo property from my manifest fixed the issue. Don't really understand why it was causing a problem in the first place.
https://learn.microsoft.com/en-us/microsoftteams/platform/resources/schema/manifest-schema#webapplicationinfo

Make electron app smaller?

I just recently built an electron app and packaged it using electron-packager. The .exe file is 55,000kb and the rest of the folder is quite bulky as well. Is there any way to take down the size of this application at all?
Here's a github issue on it.
The comment I'm emphasizing is:
That's the expected size, there is no way to make it smaller.
The reason why it's so big is because electron is loading most of chromium inside that 50mb file.
So no unfortunately there is no way to make it smaller sorry.
A somewhat helpful post from that github thread suggests removing unnecessary node modules via electron-packager. It also offers a bit more explanation on why files are so large.
You can zip your app and if you're using electron-packager you can ignore some node modules that you don't need when the app is running, this makes it a bit smaller. For instance I have a 37MB zipped Electron app (Note Windows version is much larger as it contains a copy of Git). But Electron will always have a large part of Chrome in it so there is only so much that can be done. Electron itself right now is ~33MB.
There is a way to reduce Electron size drastically (up to 99%, depending how big is your app), by using native browser, available in each OS, instead of loading webkit. BUT as built in browsers don't have the system API's, you will also be drastically limited in what you can do. But, if you need basic web ui app, this might be the best solution out there, though, it must be mentioned, that it might have some unexpected issues, as you will need to test your app on different OS'es browsers..
The method i'm talking about is available in awesome post Put your Electron app on a diet with Electrino by Pauli Olavi Ojala
If you are using Electron Builder https://www.electron.build you should use the various methods listed to remove files and folders for specific platforms.
Example
{
"name": "Example",
"version": "1.1.2",
"description": "",
"main": "main.js",
"scripts": {},
"build": {
"appId": "com.example",
"afterSign": "notarize.js",
"fileAssociations": [{
"ext": [
"mp4"
],
"name": "Media File",
"role": "Viewer"
}],
"dmg": {
"sign": true
},
"mac": {
"hardenedRuntime": true,
"gatekeeperAssess": false,
"entitlements": "build/entitlements.mac.plist",
"entitlementsInherit": "build/entitlements.mac.plist",
"icon": "build/icon.png",
"category": "public.app-category.video",
"extraFiles": [{
"from": "resources/bin/mac",
"to": "Resources/bin/mac",
"filter": [
"**/*"
]
},
{
"from": "node_modules/platforms/darwin-x64/bin",
"to": "Resources/bin/mac",
"filter": [
"**/*"
]
}
],
"files": [
"!gruntfile.js",
"!README.md",
"!notarize.js",
"!.env",
"!minify.js",
"!src/*",
"!.git/*",
"!resources/*"
]
},
"win": {
"target": "nsis",
"signingHashAlgorithms": [
"sha1"
],
"certificateFile": "",
"certificatePassword": "",
"files": [
"!gruntfile.js",
"!README.md",
"!notarize.js",
"!.env",
"!minify.js",
"!.git/*",
"!resources/mac/*"
]
}
},
"author": "Example",
"license": "ISC",
"devDependencies": {
},
"dependencies": {
}
}

How to see or debug chrome content script in firefox nightly (webextensions)

Trying to port a working chrome extension to Firefox Nightly 46.0a1 and have a simple question! How do I get the content script to execute or see it at all?
Everything else but the content script seam to be running OK as the background script execute and the popup box is visible. I am able to debug these part of the code.
But the content script do not seam to run in any way!
As far as I understand it is supposed to be part of the normal page javascript environment and visible in the debugger - but it is not. Unable to see any error messages anywhere etc.
Might have used some unsupported API by mistake, but still strange that I get no warnings and are unable to see anything.
Any proposal about how to proceed?
Manifest file below:
{
"name": "Bla Bla",
"version": "0.0.1",
"manifest_version": 2,
"description": "A description",
"homepage_url": "https://aaa.org",
"icons":
{
"16": "icons/lock_red16.png",
"48": "icons/lock_red48.png",
"128": "icons/lock_red128.png"
},
"default_locale": "en",
"background":
{
"scripts":
[
"js/lib/jserror/jserror.js",
"js/lib/lang/languagedb.js",
"js/lib/lz77.js",
"js/lib/pcrypt.js",
"js/lib/pcryptapi.js",
"js/lib/forge.bundle.js",
"js/lib/elliptic.js",
"js/lib/srp6a/biginteger.js",
"js/lib/srp6a/isaac.js",
"js/lib/srp6a/random.js",
"js/lib/srp6a/sha256.js",
"js/lib/srp6a/thinbus-srp6client.js",
"js/lib/srp6a/thinbus-srp-config.js",
"js/lib/srp6a/thinbus-srp6a-config-sha256.js",
"js/pcrypt_shared.js",
"js/pcrypt_extension.js",
"src/bg/background.js"
],
"persistent": true
},
"browser_action":
{
"default_icon":
{
"16": "icons/lock_red16.png",
"48": "icons/lock_red48.png",
"128": "icons/lock_red128.png"
},
"default_title": "Password Crypt",
"default_popup": "src/browser_action/popup.html"
},
"permissions":
[
"clipboardWrite",
"storage"
],
"content_scripts":
[
{
"matches":
[
"http://*/*",
"https://*/*"
],
"js":
[
"js/pcrypt_extension.js",
"src/inject/inject.js"
]
}
],
"externally_connectable":
{
"matches":
[
"https://*.aaa.dk/*",
"https://*.aaa.org/*"
]
},
"web_accessible_resources":
[
"icons/*.png"
],
"applications":
{
"gecko":
{
"id": "benny#aaa.dk",
"strict_min_version": "40.0.0",
"strict_max_version": "50.*",
"update_url": "https://aaa.org/addon"
}
}
}
As far as I understand it is supposed to be part of the normal page javascript environment and visible in the debugger - but it is not.
No, they're not. They run in slightly more privileged contexts separate from the page environment so they can access the webextension APIs.
If you have e10s off you can use the browser toolbox. If it is on you need to use the browser content toolbox instead. You can also try about:debugging, although i'm not sure whether that already works for webextensions.
MDN docs have everything you need to know about debugging WebExt, including content scripts.

Visual Studio error when trying to create MVC application on Azure

I want to create a new MVC application with Visual Studio Community 2015. I've followed this tutorial on how to do this and I've gone as far as creating the application, but after I click 'Create' to create the application, the error message below is displayed.
Is this message referring to the Azure API version for Visual Studio? If so, how should I resolve this? I've looked online and I can't seem to find anything about this error. I'm a newbie at this, so I'm not sure if I've overlooked anything, but I don't seem to according to the tutorial. Any help is greatly appreciated!
UPDATE
The image below shows the SQL API version I've found. It's odd thought, because it does not match the version shown in the error message.
As the error message says the API have to be in correct format yyyy-MM-dd.
API version I was using recently was 2014-04-01 or 2014-04-01-preview. Try any of these when defining SqlServer resouce.
Also have a look at resources.azure.com if you have any SqlServers created and double check the API version from there..
This does not relate to the Azure Sdk version for Visual Studio. It relates to the (in your case) API version used to create SqlServer instance using Azure Resource Manager
Sample SqlServer and database resource node:
"resources": [
{
"name": "[parameters('sqlServerName')]",
"type": "Microsoft.Sql/servers",
"location": "[resourceGroup().location]",
"apiVersion": "2014-04-01-preview",
"dependsOn": [ ],
"tags": {
"displayName": "SqlServer"
},
"properties": {
"administratorLogin": "[parameters('sqlDatabaseUserName')]",
"administratorLoginPassword": "[parameters('sqlDatabasePassword')]",
"version": "12.0"
},
"resources": [
{
"name": "AllowAllWindowsAzureIps",
"type": "firewallrules",
"location": "[resourceGroup().location]",
"apiVersion": "2014-04-01-preview",
"dependsOn": [
"[concat('Microsoft.Sql/servers/', parameters('sqlServerName'))]"
],
"properties": {
"startIpAddress": "0.0.0.0",
"endIpAddress": "255.255.255.255"
}
},
{
"name": "[parameters('databaseName')]",
"type": "databases",
"location": "[resourceGroup().location]",
"apiVersion": "2014-04-01-preview",
"kind": "v12.0",
"dependsOn": [
"[parameters('sqlServerName')]"
],
"tags": {
"displayName": "SqlDatabase"
},
"properties": {
"collation": "[parameters('sqlDatabaseUriNameCollation')]",
"edition": "[parameters('sqlDatabaseUriNameEdition')]",
"maxSizeBytes": "10737418240"
//10 gigs currently
}
}
]
}
Also as #Robert McKee pointed make sure you have latest Azure SDK (2.7.1 or 2.8 released recently)
I'm not sure how, but this evening when I went to try it again, it worked. Thank you all for your answers!

Resources