Trouble connecting to SQL Server Express with a C# AWS Lambda function - aws-lambda

I get the following error when trying to connect to my SQL Server Express RDS instance over AWS Lambda using System.Data.SqlClient:
"errorType": "PlatformNotSupportedException",
"errorMessage": "Operation is not supported on this platform.",
"stackTrace": [
"at System.Runtime.InteropServices.OSPlatform.get_Windows()",
"at System.Data.SqlClient.SNI.SNITCPHandle.d__22.MoveNext()"
]
I build the deploy package using Amazon.Lambda.Tools. Running the function and connecting to the database from local works fine, but fails when trying to run it on AWS Lambda.
Here is my project.json:
{
"version": "1.0.0-*",
"description": "AWS lambda Console Application",
"authors": [ "" ],
"packOptions": {
"tags": [],
"projectUrl": "",
"licenseUrl": ""
},
"buildOptions": {
"emitEntryPoint": true
},
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
},
"Newtonsoft.Json": "9.0.1",
"Amazon.Lambda.Core": "1.0.0*",
"Amazon.Lambda.Serialization.Json": "1.0.1",
"Amazon.Lambda.Tools": {
"type": "build",
"version": "1.0.0-preview1"
},
"Dapper": "1.50.2",
"System.Data.SqlClient": "4.3.0"
},
"tools": {
"Amazon.Lambda.Tools": "1.0.0-preview1"
},
"commands": {
"AwsLambda": "run"
},
"frameworks": {
"netcoreapp1.0": {
"imports": "dnxcore50"
}
}
}

Had the same problem and for me just changing
"System.Data.SqlClient": "4.3.0"
to
"System.Data.SqlClient": "4.1.0"
worked for me. I did not have to change the NetCore.App dependencies.

Explicitly add reference to
"System.Data.SqlClient": "4.1.0",
"System.Runtime.InteropServices.RuntimeInformation": "4.0.0"
solves the problem.

Can you try to change
"System.Data.SqlClient": "4.3.0"
to
"System.Data.SqlClient": "4.1.0"
and change
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
},
to
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.1"
},

Related

What is "Exported Binaries" in yarn info

I am trying to understand the output of
yarn info ts-node --json
{
"value": "ts-node#npm:8.5.4",
"children": {
"Instances": 1,
"Version": "8.5.4",
"Exported Binaries": [
"ts-node",
"ts-script"
],
"Dependencies": [
{
"descriptor": "arg#npm:^4.1.0",
"locator": "arg#npm:4.1.3"
},
{
"descriptor": "diff#npm:^4.0.1",
"locator": "diff#npm:4.0.2"
},
{
"descriptor": "make-error#npm:^1.1.1",
"locator": "make-error#npm:1.3.6"
},
{
"descriptor": "source-map-support#npm:^0.5.6",
"locator": "source-map-support#npm:0.5.21"
},
{
"descriptor": "yn#npm:^3.0.0",
"locator": "yn#npm:3.1.1"
}
]
}
}
So far I understand ts-node version 8.5.4 is installed
But what does "Exported Binaries" signify? I thought it would mean direct dependency but I don't have ts-script in my package.json.

Manifest parsing error when trying to test app in Teams

From https://dev.teams.microsoft.com/, whenever I click "Preview in Teams", it shows an error in Teams with these details copied to the clipboard: "Error while reading manifest.json". If I download the app package and "upload a custom app" I get the same error. What can I do to resolve this? If I remove the messaging extension configuration, it works but I configured that part in their app and that's what I want to build.
This is my manifest file:
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.11/MicrosoftTeams.schema.json",
"version": "1.0.0",
"manifestVersion": "1.11",
"id": "3fXXXX",
"packageName": "com.package.name",
"name": {
"short": "Domo Integration",
"full": ""
},
"developer": {
"name": "Domo Inc.",
"mpnId": "",
"websiteUrl": "https://www.domo.com",
"privacyUrl": "https://www.domo.com/company/privacy-policy",
"termsOfUseUrl": "https://www.domo.com/company/service-terms"
},
"description": {
"short": "short",
"full": "full"
},
"icons": {
"outline": "outline.png",
"color": "color.png"
},
"accentColor": "#FFFFFF",
"composeExtensions": [
{
"botId": "deXXXXXXXX",
"commands": [],
"canUpdateConfiguration": true,
"messageHandlers": [
{
"type": "link",
"value": {
"domains": [
"*.domo.com"
]
}
}
]
}
],
"validDomains": [
"*.domo.com"
]
}
#ccnokes In order to use messaging extension in your bot, you need to provide at least one command. commands is required property in composeExtension - see doc.
I was also getting the same error when tried with your manifest but after adding commands it worked totally fine.

Heroku: There was an issue setting up your app environment. Name is invalid

When I try to use this app.json:
{
"stack": "heroku-18",
"repository": "https://github.com/OpenHumans/oh-data-source-template",
"logo": "https://avatars.githubusercontent.com/u/3341265?s=280&v=4",
"scripts": {
"postdeploy": "python manage.py init_proj_config"
},
"env": {
"SECRET_KEY": {
"description": "This is set for you and is used to encrypt data.",
"generator": "secret"
},
"OH_CLIENT_ID": {
"description": "See http://openhumans.org/direct-sharing/projects/manage",
"value": ""
},
"OH_CLIENT_SECRET": {
"description": "See http://openhumans.org/direct-sharing/projects/manage",
"value": ""
},
"OH_ACTIVITY_PAGE": {
"description": "See http://openhumans.org/direct-sharing/projects/manage",
"value": ""
},
"APP_BASE_URL ": {
"description": "e.g. https://your-app-name.herokuapp.com - no trailing slash!",
"value": "https://your-app-name.herokuapp.com"
},
"DEBUG": {
"description": "Displays detailed error info for web requests. Set False in production.",
"value": "false"
},
"HEROKU_APP": {
"description": "If true, ALLOWED_HOSTS is set to all.",
"value": "true"
}
},
"addons": [
"coralogix:free-30mbday",
"heroku-redis:hobby-dev",
{
"plan": "heroku-postgresql",
"options": {
"version": "9.5"
}
}
]
}
to deploy from:
https://dashboard.heroku.com/new?template=https%3A%2F%2Fgithub.com%2Fmikepsinn%2Foh-quantimodo-source
I get the error no matter what I set the name to:
I've tried adding the optional name field to the app.json but that doesn't help either.

Heroku gives wrongly formatted error vs Local is working fine

The application works fine locally. However deploying it in heroku gives the following error without any clue
com.github.dandelion.core.DandelionException: The file
'WEB-INF/classes/dandelion/my-bundle.json' is wrongly formatted.
Please help me on how to resolve this.
Below is the JSON file for reference.
Below is the json file used in the deployment for your reference.
{
"bundle" : "my-bundle",
"assets": [
{
"name": "jquery",
"version": "2.1.1",
"type": "js",
"locations": {
"webapp": "/webjars/jquery/2.1.1/jquery.min.js"
}
},
{
"name": "datatables",
"version": "1.10.5",
"type": "js",
"locations": {
"webapp": "/webjars/datatables/1.10.5/js/jquery.dataTables.js"
}
},
{
"name": "datatables",
"version": "1.10.5",
"type": "css",
"locations": {
"webapp": "/webjars/datatables/1.10.5/css/jquery.dataTables.css"
}
}
]
}
Thanks.

How do I set the correct settings for my composer installer

My current folder structure:
Composer/PluginInstaller.php
The content of composer.json:
{
"name": "zepluf/installer",
"type": "composer-installer",
"description": "Composer installer for ZePLUF addons.",
"homepage": "http://github.com/zepluf/installer",
"license": "custom",
"authors": [
{
"name": "Raine Ng",
"email": "vunguyen#rubikin.com",
"homepage": "http://rubikin.com"
}
],
"autoload": {
"psr-0": {
"Zepluf\\Composer": "Composer"
}
},
"extra": {
"class": "Zepluf\\Composer\\PluginInstaller"
},
"target-dir": "zepluf/Composer"
}
I would like the installer to be put inside:
vendor/zepluf/Composer/PluginInstaller.php
The problem is that I keep getting:
Fatal error: Class 'Zepluf\Composer\PluginInstaller' not found in phar://C:/Prog
ramData/Composer/bin/composer.phar/src/Composer/Installer/InstallerInstaller.php
on line 102
Any pointer will be greatly appreciated
Assuming PluginInstaller.php is at the root of your package, it should be configured like this:
// ...
"autoload": {
"psr-0": {
"Zepluf\\Composer": ""
}
},
"extra": {
"class": "Zepluf\\Composer\\PluginInstaller"
},
"target-dir": "Zepluf/Composer"

Resources