Example breaks when using Mbed OS 6.3.0

Steps to replicate issue:
git clone https://github.com/ARMmbed/mbed-os-example-for-aws.git && cd mbed-os-example-for-aws
 mbed deploy
mbed compile -m detect -t GCC_ARM --flash --sterm --baud 115200

Also build failed in on-line compiler.
It seems relative to threadRoutine(pArgument); in iot_thread.cpp .

This issue is related to https://github.com/ARMmbed/mbed-os/issues/13764
The Mbed OS version deployed is an old version of Mbed OS (5.14.4 when I tried) and gives the compilation error mentioned.
You can try mbed ls to see which version of mbed-os library is used after running the mbed deploy command.
I tried to compile the example with Mbed OS 6.3.0 and it worked.

Yes, it did working thru CLI on OS 6.3.0 .
However, I tried all of newer versions than OS v6.2.1  in on-line compiler, still got the same compiler error.
Is there any way to reflect this symptom to on-line compiler team ?

However, I tried all of newer versions than OS v6.2.1 in on-line compiler, still got the same compiler error.

What versions are newer than 6.2.1 ? The capture above shows feature-wisun (it's 5.15 based, it won't work with this example, same as 5.15). There's just 6.3.0 and now 6.4.0rc1 in preparation.

Is there any way to reflect this symptom to on-line compiler team ?

Use only official releases (mbed-os-6.x.x tags) in the online compiler, same as you would do with mbed-cli .

What versions are newer than 6.2.1 ? The capture above shows feature-wisun (it's 5.15 based, it won't work with this example, same as 5.15). There's just 6.3.0 and now 6.4.0rc1 in preparation.

I tried to switch 4 tags as aa70f68, 0db72d0c(mbed-os-6.3.0), c6d65fe and 8ef0a435b(mbed-os-6.4.0-rc1), all of these 4 tags got the same compile error "No matching member" in Mbed on-line compiler.

Use only official releases (mbed-os-6.x.x tags) in the online compiler, same as you would do with mbed-cli .

Where to report this kind issue to notify no-line compiler team ?

@COTASPAR thank you for raising this issue.Please take a look at the following comments:
Could you add some more detail to the description? A good description should be at least 25 words.
What target(s) are you using?
What toolchain(s) are you using?
What version of Mbed OS are you using (tag or sha)?
It would help if you could also specify the versions of any tools you are using?
How can we reproduce your issue?
NOTE: If there are fields which are not applicable then please just add 'n/a' or 'None'.This indicates to us that at least all the fields have been considered.
Please update the issue header with the missing information, the issue will not be mirroredto our internal defect tracking system or investigated until this has been fully resolved.

This issue was not caused by Mbed OS 6.3.0 but rather by this issue. Therefore I'm closing the current issue.


[Task] Improve JSON Schema to HTML generation

What should be done
Improve the doc generation in order to make it more readable by the users.

[x] Include a ref in the value when it's possible instead of creating a link to it
[x] Do not create page to a ref that is not referenced nor have a mdx page
[x] create a default MDX page at runtime for the components
[x] Add the url to the source code (JSON Schema and MDX file)

:tada: This issue has been resolved in version 1.0.0-beta.71 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:

:tada: This issue has been resolved in version 1.0.0-alpha.1 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:


README: practical example for images and fonts

Current coverage is 98.35% (diff: 100%)

Merging #405 into master will not change coverage

@@             master       #405   diff @@
==========================================
  Files             9          9
  Lines           304        304
  Methods          41         41
  Messages          0          0
  Branches         67         67
==========================================
  Hits            299        299
  Misses            5          5
  Partials          0          0

Powered by Codecov. Last update 9508990...03732c8

@simon04 Please rclose and reopen for CLA

CLA signed.


Fix for click twice to follow links #7812 #7668

I've experienced same issues like #7812 #7668.
I was able to fix it by adding following code to check event was made from mouse or not.
//prevent click twice to follow link for touche enabled PC browsers.
if(e.type === 'click'){
  hasClicked = true;
}

Reviewing this now, do you know if it will affect any other touch browsers, like Mobile Safari or the Android Browser?

Well, I can say definitely no affect on mobile safari, and I confirm no affect on Sony Xperia OS 5.0.2 android browser.
But Android behavior may vary device to device, so if you have wide range of android devices for testing, please double check.

@colin-marshall it looks like you've spent some time in this code, can you take a look at this and see if it seems right?

@kball I just converted the code to ES6, I didn't get into the functionality of the plugin, however I will test this out later today.

@colin-marshall did you end up having a chance to check on this?

@kball sorry I forgot about this one! I can't reproduce this on any of my devices, which is weird because I have definitely seen this before.
@zurb/yetinauts can anybody else test this out?

@colin-marshall
can't reproduce this on a w10 touch notebook in chrome, firefox, Safari
only thing is in edge and IE11 when touching the link (not when clicking) if i touch the first link the menu opens then if i touch the second link i have to touch it twice to follow
but with the PR its worse then the menu opens and close immediately

@designerno1 thanks for checking it out. I'll see if I can reproduce in a Windows VM.

@colin-marshall
i think it's because hasTouch returns false on my device, and thusthe browser emulates a hover event

Unfortunately, there is currently no fix for the TOUCH twice to follow links bug. You have to touch twice on every windows phone and (I suppose) on every windows tablet.

It looks like from @designerno1 this PR breaks at least as much as it fixes, so closing for now.  Please feel free to reopen if you are able to extend it to not break edge/ie11


Not able to import the jirarobot library

While importing jira library in VSCODE editor throwing error message
"  Importing test library 'JiraRobot' failed: SyntaxError: Missing parentheses in call to 'print'. Did you mean print(JIRAUsername)? (JiraRobot.py, line 58)
Traceback (most recent call last):
File "c:\users**\local\programs\python\python37-32\lib\site-packages\JiraRobot_init_.py", line 17, in
from JiraRobot import JiraRobot   ""
Any suggestions  ?

@Ashwin143 this is a Python 3 issue - use Python 2.7


gamma_reg name collision when combining models and trainers

When we specify model-model, trainer-trainer, model-training combination, e.g. https://github.com/marrlab/DomainLab/blob/master/examples/conf/vlcs_diva_mldg_dial.yaml
It can be there are name collisions of the multiplier $\mu$:

https://github.com/marrlab/DomainLab/blob/43d1cda636ba59ed9f2237836aeabf4e0eeb25f0/domainlab/algos/trainers/train_matchdg.py#L39
-https://github.com/marrlab/DomainLab/blob/6126ddeb2df0fe3a07de458cac68e4ad02da3c66/domainlab/algos/trainers/train_mldg.py#L111C19-L111C39
-https://github.com/marrlab/DomainLab/blob/6126ddeb2df0fe3a07de458cac68e4ad02da3c66/domainlab/algos/trainers/train_dial.py#L52
In this case, when i set commandline argument gamma_reg=1.0, it simultaneously set both $\mu$ for MLDG and DIAL to be 1.0.  We need different mechanisms to set different values for the two Trainers.
Further importance of this Issue:
The advantage/one of the major feature for DomainLab is that we can handle training multiple loss terms with multiplier weighting each term,  to circumsvent setting those multipliers mannually,  there are different multiplier schedulers to adapt those multiplier values at each epoch:
This file is the Trainer which could schedue the values of those multipliers at each epoch,
https://github.com/marrlab/DomainLab/blob/master/domainlab/algos/trainers/train_hyper_scheduler.py
Inside the Trainer, a hyper_scheduler has to be specified (In the branch fbopt, we define a fully automatic contoller for scheduling the multipliers, in the main branch, the schedulers are
https://github.com/marrlab/DomainLab/blob/master/domainlab/algos/trainers/hyper_scheduler.py
First, those multipliers (a.k.a. hyperparameters) are initialized
https://github.com/marrlab/DomainLab/blob/a77dad8a34fc54501e8a3282f53eda1551b7134c/domainlab/algos/trainers/train_hyper_scheduler.py#L28
At each epoch, the multipliers (a.k.a. hyperparameters) are updated via the scheduler
https://github.com/marrlab/DomainLab/blob/a77dad8a34fc54501e8a3282f53eda1551b7134c/domainlab/algos/trainers/train_hyper_scheduler.py#L63
All $\mu$ need to be registered at the multiplier scheduling
https://github.com/marrlab/DomainLab/blob/43d1cda636ba59ed9f2237836aeabf4e0eeb25f0/domainlab/models/model_diva.py#L112

https://github.com/marrlab/DomainLab/blob/a77dad8a34fc54501e8a3282f53eda1551b7134c/domainlab/models/a_model.py#L94C8-L96C30


has method in NgHttpCachingBrowserStorage has wrong type checking

In the NgHttpCachingBrowserStorage class, the has method is incorrectly checking the type of the returned value from the getItem method of the storage. When there is no item, it is checking if it is undefined, but checking the API of the Storage interface, this method returns null, causing the method to return true even if the element does not exist.
Evidence:
// lines 139-147 in ng-http-caching-browser-storage.ts
has(key: string): boolean {
  if (!key) {
    return false;
  }
  if (!key.startsWith(KEY_PREFIX)) {
      key = KEY_PREFIX + key;
  }
  return this.storage.getItem(key) !== undefined;
}

Return vale specification of the has method in the Storage interface (from MDN):
Storage: getItem() method - Web APIs | MDN
A string containing the value of the key. If the key does not exist, null is returned.

Hi, just fixed into version 16.0.10


VM

Define VM for common needed components
Initially:

ActiveMQ
hawtio or any other console to admin ActiveMQ

Alternatives :

zeroMQ
rabbitmq

Probably move to docker?


FSL

FSL was not recompiled with Verificarlo, just installed on top of the fuzzy libmath container. It provides an emulation of OS variability, related to @ali4006's work.

Looks great! A minor organizational comment, that's it!


Unpin zeromq

The issue with zeromq 4.2.3 on conda-forge was fixed. We should be able to unpin it.

This is a change to appveyor.yml. The travis build is queue behind repo2docker builds. Merging.


Fix: use mkdirp directly

This PR fixes #31 by using the mkdirp directly, which now supports promises natively.
I also updated the engine field to match the minimum supported by mkdirp. I believe this is not a breaking change because mkdirp-promise has a * dependency on mkdirp so it would have been already using a version of mkdirp that didn't support anything below Node 10.

Until this is merged, the following works:
npx github.com:betaorbust/covenant-generator <youremail@domain>

Thank you, all. Merged, pushed, patched. :)


Yield thread when spinning on Intermediate state

In some cases when there are more threads than physical cores, the thread responsible for transition can be scheduled out while others busy-spin on the state, leading to a significant drop in performance. Calling Thread.Yield() when spinning reduces that overhead.

Investigating if a semaphore is better than spinning


It's not possible to install with Anaconda

When trying to install Marvin toolbox with Python Anaconda an error is being thrown when running the  command mkvirtualenv

Any error log to help?

To solve this problem just set the env variable VIRTUALENVWRAPPER_PYTHON to your own python installation (not provided by anaconda).
If you don't have a diferent python installation then install using sudo apt-get install python2.7-dev python-pip ipython
To set the env variable use:
echo "export VIRTUALENVWRAPPER_PYTHON=/usr/lib/python2.7" >> $HOME/.bash_profile
source $HOME/.bash_profile
and try again...


Improve the way istioctl is downloaded to avoid errors when there are network issues

Signed-off-by: Israel Blancas<EMAIL_ADDRESS>Which problem is this PR solving?

The download of the istioctl fails sometimes due to networking issues

Short description of the changes

Use retries method to make this automation more robust

ping @iblancasa

This branch is out-of-date with the base branch


Adding dbt_packages when dbt_deps is False

Description

Related Issue(s)
resolves #727, resolves #715
Breaking Change?

Checklist

[ ] I have made corresponding changes to the documentation (if required)
[ ] I have added tests that prove my fix is effective or that my feature works

@tatiana Would you be able to help me fix the integration test? I'm trying to add a test that manually install dbt deps beforehand and then runs cosmos with dbt_deps is False which should mean it uses the pre-installed dbt-packages

That's great thanks! We have a release on Thursday would be great to have it in time for that. Thanks for your help @tatiana

@DanMawdsleyBA It's part of 1.3.0a3:
https://pypi.org/project/astronomer-cosmos/1.3.0a3/
Please let us know if you find any issues!


Not working in iPad, Flatlist items are not displayed in alphabet order

Hi @PatilRupaliAress,
Can you please share the code and screenshot.


Build and Upload PAM OAuth RPMs (Inf-794)

The uploads can be found at the bottom of the portion of the Actions summary page. The action checks out the code and from the rpm directory builds the container pamoauth2device-rpm-build. The docker run command creates a volume that maps /data inside the container to the .workspace variable which is the file path of the root directory of the current repo on the github actions runner. There was a permission issue between the user of the container and the github actions user where github actions user could not copy anything from inside the container. Setting the container user as root solved the problem but that may not be the appropriate work around. The upload artifact action pulls the build rpms from the .workspace/RPMS path.

@jtakaki-matc I generally don't love making everything run as root. Instead of dumping the contents of /data from the container into the GHA repo root, how about you create a dir specifically for the build output, make sure that has the correct uid/gid ownership (see below), and mount that dir into the container instead?
$ podman run --rm -it  pamoauth2device-rpm-build:latest id builder
uid=1000(builder) gid=1000(builder) groups=1000(builder)

@brianhlin I've got green check marks for this update, I think that's better??

@brianhlin Updated Dockerfile!


No longer working

Firstly I'd like to add my thanks for creating such a brilliant tool.
It's exactly what I've been looking for however there appears to be an issue.
I've copied the extracted folder "Reverse-master" to "C:\Users<user>\Documents\Fusion 360\My Add-Ins" and added it into Fusion through the green "+" icon under Utilities > Scripts and Add-ins > Add-Ins (Tab).
The problem is that it doesn't appear to load. The circular icon that shows next to correctly loaded add-ins is missing. There is also nothing showing up when I go to SURFACE > CREATE.
I have tried the usual troubleshooting steps such as restarting Fusion and removing/reinstalling the add-in however this didn't work.
I should say that this is my first time trying to use this add-in so it is possible that it is an issue specific to my setup however I don't believe so. I've also noticed recent comments on the reddit thread from others unable to get it to work, although they don't go into much detail. (https://www.reddit.com/r/Fusion360/comments/id8m7j/i_made_an_addin_for_converting_meshes_to_brep/).
If you have time to attempt to rectify this I would be very grateful.

Hello Nico, could you please fix it for the 2022 version of fusion360??
Thanks!

Yes, it does not work on MacOS 13.0.1 (22A400) - Fusion 360 2.0.15050 x86_64.

Can confirm it does not start, installs just fine but wont run . Im a plus 100 for getting this fixed :-).

From my understanding the issue is when Fusion updates python version of fusion also updates and so is it's dependencies. But not all of our Add-in and Script dependencies.
I resolved it by using os command in python to update those dependencies in whenever Fusion360 version has changed.
With try catch if import fails means Fusion360 version has changed and in catch update the dependencies to the latest version.

From my understanding the issue is when Fusion updates python version of fusion also updates and so is it's dependencies. But not all of our Add-in and Script dependencies.
I resolved it by using os command in python to update those dependencies in whenever Fusion360 version has changed.
With try catch if import fails means Fusion360 version has changed and in catch update the dependencies to the latest version.

Can you explain how did you do this? Did you manage to get meshes converted into bodies without having thousands of faces, edges and points?


Can't load test_wiki.json when training FewRel BaseModel

Really appreciate your work.
However, during training FewRel BERT basemodel, it appears that no FewRel/test_wiki.json is given, which is used in code/config/FewRel/BaseModel/BERT_5way1shot.config and other configs.
https://github.com/thunlp/Knowledge-Plugin/blob/master/code/config/FewRel/BaseModel/BERT_5way1shot.config#L17C27-L17C27
Error messages:
11/06/2023 15:14:28 - INFO - tools.gpu_tool -   CUDA available: True
11/06/2023 15:14:28 - INFO - __main__ -   Begin to initialize dataset and formatter...
11/06/2023 15:14:30 - INFO - __main__ -   Begin to initialize models...
11/06/2023 15:14:31 - WARNING - __main__ -   Cannot load checkpoint file with error 'NoneType' object has no attribute 'seek'. You can only torch.load from a file that is seekable. Please pre-load the data into a buffer like io.BytesIO and try to load from it instead.
/home/cfh77/anaconda3/envs/apex/lib/python3.9/site-packages/transformers/optimization.py:411: FutureWarning: This implementation of AdamW is deprecated and will be removed in a future version. Use the PyTorch implementation torch.optim.AdamW instead, or set `no_deprecation_warning=True` to disable this warning
  warnings.warn(
11/06/2023 15:14:33 - INFO - __main__ -   Initialize done.
11/06/2023 15:14:33 - WARNING - tools.train_tool -   Output path exists, check whether need to change a name of model
11/06/2023 15:14:33 - INFO - tools.train_tool -   Training start....
Epoch  Stage  Iterations  Time Usage    Loss    Output Information
Traceback (most recent call last):      398.5589{"micro_f1": 0.273, "micro_precision": 0.273, "micro_recall": 0.273}
  File "/home/cfh77/Documents/Knowledge-Plugin-master/code/run.py", line 129, in <module>
    train(parameters, config)
  File "/home/cfh77/Documents/Knowledge-Plugin-master/code/tools/train_tool.py", line 94, in train
    best_f1 = check(parameters, best_f1, model, current_epoch, optimizer, output_path, config, output_function, global_step)
  File "/home/cfh77/Documents/Knowledge-Plugin-master/code/tools/train_tool.py", line 30, in check
    info = valid(parameters, model, parameters["test_dataset"], current_epoch, config, output_function, mode = "test")[1]
  File "/home/cfh77/Documents/Knowledge-Plugin-master/code/tools/eval_tool.py", line 52, in valid
    data = parameters["Formatter"].process(mode, data)
  File "/home/cfh77/Documents/Knowledge-Plugin-master/code/formatter/FewRel_formatter.py", line 135, in process
    with open(os.path.join(self.data_path, self.config.get("data", "{}_file".format(mode))), "r", encoding = "utf-8") as fin :
FileNotFoundError: [Errno 2] No such file or directory: '../datasets/FewRel/test_wiki.json'

How to train FewRel BERT BaseModel? Seems not a file named test_wiki.json when training FewRel BERT and related models. How to reach this file or this is a bug?
Thank you!

Hi,
Thanks for reaching out! Actually, test_wiki.json has NOT been publicly released. We contacted the authors of FewRel to get this subset.
You could consider submitting the results to the official leaderboard of FewRel. More details are here.

OK. Thank you @Zhiyuan-Zeng .


No such file error when using --data full (gzip: ./train.tsv.gz: No such file or directory)

02/03/2021 16:51:01 - INFO - main -   Downloading and Extracting Data...
make: *** [data/reddit/RC_2011-02.bz2] Error 8
make: *** Waiting for unfinished jobs....
error occurred, b'gzip: ./train.tsv.gz: No such file or directory\n'
Does anyone have the same problem when downloading and extracting the data?

I checked the log files in the data/out/., then I found the reason is that some libraries were not installed (such as nltk). If you have the same problem, I would suggest that checking the log files first to see if there are any problems with your environment.


[Combobox] Add Combobox builder

Summary
This PR creates a Combobox builder which is needed for the 1.0 release (#148)
Changes

Added an ARIA-1.2 compatible combobox + corresponding documentation 🎉
There were a few shared consts/utilities between the Select and Combobox builders. I centralized them in helpers. Specifically:

FIRST_LAST_KEYS and SELECTION_KEYS were replicated in several components. Those have been moved to $lib/internal/helpers/keyboard.
getOptions and getFirstOption were moved into $lib/internal/helpers/list

Keyboard entries for F-keys, Caps Lock, and Alt were added to the kbd map.
The prev array helper ($lib/internal/helpers/array) condition has been changed to return the last item in the list if the given index is less than 0, as well as exactly 0. This is helpful in this Combobox condition:

The loop configuration is set to true
The user expands the menu but doesn't highlight an item (the highlighted index is initially set to -1)
They press the Up Arrow and the last item in the list should now be highlighted.
...without this change, the Up Arrow doesn't do anything.

Out of scope

Setting a default selected item. This should be a quick & easy fast-follow and shouldn't change the underlying architecture at all.
Page Up/Page Down navigation should also probably be added to the select builder. It'll be a case of adding some more array utilities like prev and next that can traverse a variable amount.
"Non-looping items." Right now, interaction with items outside the main loop lack keyboard controls. This is definitely a nice-to-have but IMO not critical to the initial release since it shouldn't introduce breaking changes to the API. Eg:

  {#if $open}
    {#if $filteredItems.length !== 0}
      {#each $filteredItems as book, index (index)}

          {book.title}

      {/each}
    {:else}

No results found

    {/if}
  {/if}

Add some more examples & evaluate how we're going to approach documentation for return types.

Callouts

We're not 100% sold in the updateItems callback function that we introduced to the builder. It seems like a pretty common use case to update the list of items passed to the combobox on the fly, which doesn't play nicely with the internal items store. We decided to explicitly provide an updater instead of:

Requiring args.items to be a writable store instead of T[].
Just telling people to write a function to update $options. This felt too hacky for something that we suspect will be a frequent use case.

@davidwoolf is the best. Thanks for jamming on this with me 🤜💥🤛

@TGlide, Should this be updated to use the new builder(…) when defining the stores and actions? so it gets the data-melt-* attributes?
It also makes for consistent reading when spreading and setting the action on an element
Tags-inputs did this update recently for reference.

It’s also something that can easily be done after merge though 👌
it would be good to create a list of which builders are using the new approach and which are using the older approach so we can update for a consistent API


Adding external participants to a course does not work

Describe the bug
As a course admin, I see an option to add external participants to the course on the admin page by entering a name and an email address.
The input placeholder text indicates that it is possible to add external mail addresses here, and that they should receive an invitation mail.
When I test this with one of my private email addresses, I don't receive an email and there's no indication that anything happened.
To Reproduce
Steps to reproduce the behavior:

Go to the admin page of a course you administrate
Scroll down to the "External Participants" section
Add a name and private email address you know exists (I checked multiple providers)
Click "Submit"
Check every spam folder, observe no invitation mail exists
Klick the "Show Invitations" Link in the "External Participants" section; there are no invitations there either

Expected behavior
I expected an invitation mail to arrive at the email account I tested this with, and maybe some kind of data to appear in the 'invitations' section.
Desktop

OS: Ubuntu 22.10
Browser: Firefox
Version: 111

Additional context
I checked the networking tab using the browser inspection view.
This seems to POST form data to /api/course/{cousrseId}/createUserForCourse and always returns 200 OK.

I'm not able to reproduce this. @joschahenningsen do you know whether you could repro this at the time of self assigning this or not?

Anyways, I'll fix the bug that "show invitation" doesn't actually show anything.

I cannot recall, I remember having implemented a new email queuing table (https://github.com/TUM-Dev/gocast/blob/f4bf9417cb861123a95f3aab0a7076af82577169/dao/email.go#L18) for inviting admins to their lectures, which works reliably. We should use it also for inviting external participants.

We should use it also for inviting external participants.

You already changed the respective functions so external participants are invited via the email queuing table in June of 2023.


.NET Core 3.0 Preview 9 Linux Container MsBuild Errors

Issue Title
.NET Core 3.0 Preview 9 Linux build errors (Win32Exception!)
General
dotnet build can not build console or classlib projects.
Host info:
OS Name:     ubuntu
OS Version:  18.04
OS Platform: Linux
RID:         ubuntu.18.04-x64

Steps to repro
1- docker run --rm -it --entrypoint="/bin/bash" mcr.microsoft.com/dotnet/core/sdk:3.0.100-preview9-bionic
2-

root@ff994da1d1db:/# cd root/
root@# mkdir console
root@# cd console
root@console# pwd
/root/console
root@/console# dotnet new console

Processing post-creation actions...
Running 'dotnet restore' on /root/console/console.csproj...
Restore completed in 47.77 ms for /root/console/console.csproj.

Restore succeeded.

root@/console# dotnet build

Copyright (C) Microsoft Corporation. All rights reserved.

  Restore completed in 11.78 ms for /root/console/console.csproj.
  You are using a preview version of .NET Core. See: https://aka.ms/dotnet-core-preview
/usr/share/dotnet/sdk/3.0.100-preview9-014004/Roslyn/Microsoft.CSharp.Core.targets(59,5): error MSB6004: The specified task executable location "/" is invalid. [/root/console/console.csproj]

Build FAILED.

/usr/share/dotnet/sdk/3.0.100-preview9-014004/Roslyn/Microsoft.CSharp.Core.targets(59,5): error MSB6004: The specified task executable location "/" is invalid. [/root/console/console.csproj]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.54

The error above is reprodicible with other Linux containers too.
Lets try classlib if it is ridiculous to build an exe under Linux

root@# mkdir dll
root@# cd dll
root@/dll# dotnet new classlib

Processing post-creation actions...
Running 'dotnet restore' on /root/dll/dll.csproj...
  Restore completed in 4.03 sec for /root/dll/dll.csproj.

Restore succeeded.

root@/dll# dotnet build

Copyright (C) Microsoft Corporation. All rights reserved.

  Restore completed in 16.94 ms for /root/dll/dll.csproj.
  You are using a preview version of .NET Core. See: https://aka.ms/dotnet-core-preview
/usr/share/dotnet/sdk/3.0.100-preview8-013656/Roslyn/Microsoft.CSharp.Core.targets(59,5): error MSB6004: The specified task executable location "/" is invalid. [/root/dll/dll.csproj]

Build FAILED.

/usr/share/dotnet/sdk/3.0.100-preview8-013656/Roslyn/Microsoft.CSharp.Core.targets(59,5): error MSB6004: The specified task executable location "/" is invalid. [/root/dll/dll.csproj]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.55

root@/dll# dotnet publish -c Release -r linux-x64 -o out

Microsoft (R) Build Engine version 16.3.0-preview-19377-01+dd8019d9e for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restore completed in 82.39 ms for /root/dll/dll.csproj.
  You are using a preview version of .NET Core. See: https://aka.ms/dotnet-core-preview
/usr/share/dotnet/sdk/3.0.100-preview8-013656/Roslyn/Microsoft.CSharp.Core.targets(59,5): error MSB6004: The specified task executable location "/" is invalid. [/root/dll/dll.csproj]

We have a .net core console app which outputs interesting (Win32Exception??) error after build. Removing <OutputType>Exe</OutputType> did not change the result.

RUN dotnet build "My_Console_Project.csproj"

 ---> Running in 38eb6c8af43d
Microsoft (R) Build Engine version 16.3.0-preview-19426-01+faf5e5d75 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restore completed in 19.6 sec for /src/project1/My_Console_Project..csproj.
  Restore completed in 19.6 sec for /src/Entities/Mro.Entities.csproj.
  Restore completed in 19.6 sec for /src/Configuration/Domain/Domain.csproj.
  Restore completed in 19.6 sec for /src/Configuration/Infrastructure/Infrastructure.csproj.

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:20.09
MSBUILD : error MSB1025: An internal failure occurred while running MSBuild.
Microsoft.Build.BackEnd.NodeFailedToLaunchException: The FileName property should not be a directory unless UseShellExecute is set.
 ---> System.ComponentModel.Win32Exception (0x80004005): The FileName property should not be a directory unless UseShellExecute is set.
   at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
   at Microsoft.Build.BackEnd.NodeProviderOutOfProcBase.LaunchNode(String msbuildLocation, String commandLineArgs)
   --- End of inner exception stack trace ---
   at Microsoft.Build.BackEnd.NodeProviderOutOfProcBase.LaunchNode(String msbuildLocation, String commandLineArgs)
   at Microsoft.Build.BackEnd.NodeProviderOutOfProcBase.GetNode(String msbuildLocation, String commandLineArgs, Int32 nodeId, INodePacketFactory factory, Int64 hostHandshake, Int64 clientHandshake, NodeContextTerminateDelegate terminateNode)
   at Microsoft.Build.BackEnd.NodeProviderOutOfProc.CreateNode(Int32 nodeId, INodePacketFactory factory, NodeConfiguration configuration)
   at Microsoft.Build.BackEnd.NodeManager.AttemptCreateNode(INodeProvider nodeProvider, NodeConfiguration nodeConfiguration)
   at Microsoft.Build.BackEnd.NodeManager.CreateNode(NodeConfiguration configuration, NodeAffinity nodeAffinity)
   at Microsoft.Build.Execution.BuildManager.PerformSchedulingActions(IEnumerable`1 responses)
   at Microsoft.Build.Execution.BuildManager.HandleNewRequest(Int32 node, BuildRequestBlocker blocker)
   at Microsoft.Build.Execution.BuildManager.ProcessPacket(Int32 node, INodePacket packet)
   at Microsoft.Build.Execution.BuildManager.<>c__DisplayClass67_0.<Microsoft.Build.BackEnd.INodePacketHandler.PacketReceived>b__0()
   at Microsoft.Build.Execution.BuildManager.ProcessWorkQueue(Action action)
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.Build.Execution.BuildManager.EndBuild()
   at Microsoft.Build.CommandLine.MSBuildApp.BuildProject(String projectFile, String[] targets, String toolsVersion, Dictionary`2 globalProperties, Dictionary`2 restoreProperties, ILogger[] loggers, LoggerVerbosity verbosity, DistributedLoggerRecord[] distributedLoggerRecords, Int32 cpuCount, Boolean enableNodeReuse, TextWriter preprocessWriter, Boolean detailedSummary, ISet`1 warningsAsErrors, ISet`1 warningsAsMessages, Boolean enableRestore, ProfilerLogger profilerLogger, Boolean enableProfiler, Boolean interactive, Boolean isolateProjects, Boolean graphBuild, String[] inputResultsCaches, String outputResultsCache)

MSBUILD : error MSB1025: An internal failure occurred while running MSBuild.
Microsoft.Build.BackEnd.NodeFailedToLaunchException: The FileName property should not be a directory unless UseShellExecute is set.
 ---> System.ComponentModel.Win32Exception (0x80004005): The FileName property should not be a directory unless UseShellExecute is set.
   at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
   at Microsoft.Build.BackEnd.NodeProviderOutOfProcBase.LaunchNode(String msbuildLocation, String commandLineArgs)
   --- End of inner exception stack trace ---
   at Microsoft.Build.CommandLine.MSBuildApp.BuildProject(String projectFile, String[] targets, String toolsVersion, Dictionary`2 globalProperties, Dictionary`2 restoreProperties, ILogger[] loggers, LoggerVerbosity verbosity, DistributedLoggerRecord[] distributedLoggerRecords, Int32 cpuCount, Boolean enableNodeReuse, TextWriter preprocessWriter, Boolean detailedSummary, ISet`1 warningsAsErrors, ISet`1 warningsAsMessages, Boolean enableRestore, ProfilerLogger profilerLogger, Boolean enableProfiler, Boolean interactive, Boolean isolateProjects, Boolean graphBuild, String[] inputResultsCaches, String outputResultsCache)
   at Microsoft.Build.CommandLine.MSBuildApp.Execute(String[] commandLine)
Unhandled exception. Microsoft.Build.BackEnd.NodeFailedToLaunchException: The FileName property should not be a directory unless UseShellExecute is set.
 ---> System.ComponentModel.Win32Exception (0x80004005): The FileName property should not be a directory unless UseShellExecute is set.
   at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
   at Microsoft.Build.BackEnd.NodeProviderOutOfProcBase.LaunchNode(String msbuildLocation, String commandLineArgs)
   --- End of inner exception stack trace ---
   at Microsoft.Build.CommandLine.MSBuildApp.BuildProject(String projectFile, String[] targets, String toolsVersion, Dictionary`2 globalProperties, Dictionary`2 restoreProperties, ILogger[] loggers, LoggerVerbosity verbosity, DistributedLoggerRecord[] distributedLoggerRecords, Int32 cpuCount, Boolean enableNodeReuse, TextWriter preprocessWriter, Boolean detailedSummary, ISet`1 warningsAsErrors, ISet`1 warningsAsMessages, Boolean enableRestore, ProfilerLogger profilerLogger, Boolean enableProfiler, Boolean interactive, Boolean isolateProjects, Boolean graphBuild, String[] inputResultsCaches, String outputResultsCache)
   at Microsoft.Build.CommandLine.MSBuildApp.Execute(String[] commandLine)
   at Microsoft.Build.CommandLine.MSBuildApp.Main(String[] args)
ERROR: Service 'xxx' failed to build: The command '/bin/sh -c dotnet build "My_Console_Project..csproj"' returned a non-zero code: 134

I am not sure whether both errors related but i can not figure out what is wrong.

I thought i'd try to repro this since i'm trying to figure out a different build error but am unable to reproduce this on my machine (windows host with docker desktop)
C:\demos>docker run --rm -v c:/demos:/demos --entrypoint="/bin/bash" -it mcr.microsoft.com/dotnet/core/sdk:3.0.100-preview9-bionic
root@422bc2bf8c65:/# mkdir console                                                                                root@422bc2bf8c65:/# cd console/
root@422bc2bf8c65:/console# dotnet new console
Getting ready...
The template "Console Application" was created successfully.

Processing post-creation actions...
Running 'dotnet restore' on /console/console.csproj...
  Restore completed in 70.99 ms for /console/console.csproj.

Restore succeeded.

root@422bc2bf8c65:/console# dotnet build -bl
Microsoft (R) Build Engine version 16.3.0-preview-19426-01+faf5e5d75 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

/usr/share/dotnet/sdk/3.0.100-preview9-014004/MSBuild.dll -bl -consoleloggerparameters:Summary -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuild                usr/share/dotnet/sdk/3.0.100-preview9-014004/dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,/usr/share/dotnet/sdk/3.0.100-preview9-01                net.dll -maxcpucount -restore -verbosity:m ./console.csproj
  Restore completed in 14.24 ms for /console/console.csproj.
  You are using a preview version of .NET Core. See: https://aka.ms/dotnet-core-preview
  console -> /console/bin/Debug/netcoreapp3.0/console.dll

Build succeeded.
    0 Warning(s)                                                                                0 Error(s)

Time Elapsed 00:00:01.60

If you add -bl to the command, the build will generate an msbuild.binlog file that could give more detailed info about the failure (which is what i tried to get, but it didn't fail for me)

I'm facing exactly same problem with all tested dotnet 2.2 tagged docker images (e.g. mcr.microsoft.com/dotnet/core/sdk:2.2.401-bionic) since yesterday.
I'd tried a lot of other dotnet core images also.
My production application stopped build with MSB1025 error.
MSBUILD : error MSB1025: An internal failure occurred while running MSBuild. Microsoft.Build.BackEnd.NodeFailedToLaunchException: The FileName property should not be a directory unless UseShellExecute is set. ---> System.ComponentModel.Win32Exception: The FileName property should not be a directory unless UseShellExecute is set.    at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)    at System.Diagnostics.Process.Start()    at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)    at Microsoft.Build.BackEnd.NodeProviderOutOfProcBase.LaunchNode(String msbuildLocation, String commandLineArgs)    --- End of inner exception stack trace ---    at Microsoft.Build.BackEnd.NodeProviderOutOfProcBase.LaunchNode(String msbuildLocation, String commandLineArgs)    at Microsoft.Build.BackEnd.NodeProviderOutOfProcBase.GetNode(String msbuildLocation, String commandLineArgs, Int32 nodeId, INodePacketFactory factory, Int64 hostHandshake, Int64 clientHandshake, NodeContextTerminateDelegate terminateNode)    at Microsoft.Build.BackEnd.NodeProviderOutOfProc.CreateNode(Int32 nodeId, INodePacketFactory factory, NodeConfiguration configuration)    at Microsoft.Build.BackEnd.NodeManager.AttemptCreateNode(INodeProvider nodeProvider, NodeConfiguration nodeConfiguration)    at Microsoft.Build.BackEnd.NodeManager.CreateNode(NodeConfiguration configuration, NodeAffinity nodeAffinity)    at Microsoft.Build.Execution.BuildManager.PerformSchedulingActions(IEnumerable1 responses)
at Microsoft.Build.Execution.BuildManager.HandleNewRequest(Int32 node, BuildRequestBlocker blocker)
at Microsoft.Build.Execution.BuildManager.ProcessPacket(Int32 node, INodePacket packet)
at Microsoft.Build.Execution.BuildManager.<>c__DisplayClass67_0.<Microsoft.Build.BackEnd.INodePacketHandler.PacketReceived>b__0()
at Microsoft.Build.Execution.BuildManager.ProcessWorkQueue(Action action)
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.Build.Execution.BuildManager.EndBuild()
at Microsoft.Build.CommandLine.MSBuildApp.BuildProject(String projectFile, String[] targets, String toolsVersion, Dictionary2 globalProperties, Dictionary2 restoreProperties, ILogger[] loggers, LoggerVerbosity verbosity, DistributedLoggerRecord[] distributedLoggerRecords, Int32 cpuCount, Boolean enableNodeReuse, TextWriter preprocessWriter, Boolean detailedSummary, ISet1 warningsAsErrors, ISet1 warningsAsMessages, Boolean enableRestore, ProfilerLogger profilerLogger, Boolean enableProfiler, Boolean interactive, Boolean isolateProjects, Boolean graphBuild, String[] inputResultsCaches, String outputResultsCache)
MSBUILD : error MSB1025: An internal failure occurred while running MSBuild.
Microsoft.Build.BackEnd.NodeFailedToLaunchException: The FileName property should not be a directory unless UseShellExecute is set. ---> System.ComponentModel.Win32Exception: The FileName property should not be a directory unless UseShellExecute is set.
at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at Microsoft.Build.BackEnd.NodeProviderOutOfProcBase.LaunchNode(String msbuildLocation, String commandLineArgs)
--- End of inner exception stack trace ---
at Microsoft.Build.CommandLine.MSBuildApp.BuildProject(String projectFile, String[] targets, String toolsVersion, Dictionary2 globalProperties, Dictionary2 restoreProperties, ILogger[] loggers, LoggerVerbosity verbosity, DistributedLoggerRecord[] distributedLoggerRecords, Int32 cpuCount, Boolean enableNodeReuse, TextWriter preprocessWriter, Boolean detailedSummary, ISet1 warningsAsErrors, ISet1 warningsAsMessages, Boolean enableRestore, ProfilerLogger profilerLogger, Boolean enableProfiler, Boolean interactive, Boolean isolateProjects, Boolean graphBuild, String[] inputResultsCaches, String outputResultsCache)
at Microsoft.Build.CommandLine.MSBuildApp.Execute(String[] commandLine)
Unhandled Exception: Microsoft.Build.BackEnd.NodeFailedToLaunchException: The FileName property should not be a directory unless UseShellExecute is set. ---> System.ComponentModel.Win32Exception: The FileName property should not be a directory unless UseShellExecute is set.
at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at Microsoft.Build.BackEnd.NodeProviderOutOfProcBase.LaunchNode(String msbuildLocation, String commandLineArgs)
--- End of inner exception stack trace ---
at Microsoft.Build.CommandLine.MSBuildApp.BuildProject(String projectFile, String[] targets, String toolsVersion, Dictionary2 globalProperties, Dictionary2 restoreProperties, ILogger[] loggers, LoggerVerbosity verbosity, DistributedLoggerRecord[] distributedLoggerRecords, Int32 cpuCount, Boolean enableNodeReuse, TextWriter preprocessWriter, Boolean detailedSummary, ISet1 warningsAsErrors, ISet1 warningsAsMessages, Boolean enableRestore, ProfilerLogger profilerLogger, Boolean enableProfiler, Boolean interactive, Boolean isolateProjects, Boolean graphBuild, String[] inputResultsCaches, String outputResultsCache)
at Microsoft.Build.CommandLine.MSBuildApp.Execute(String[] commandLine)
at Microsoft.Build.CommandLine.MSBuildApp.Main(String[] args)`
I also used the command RUN TERM=xterm dotnet build -bl ..... in my Dockerfile but no success.

I thought Docker was build to get rid of "works on my machine"? Anyways here is the result.
>docker run --rm  --entrypoint="/bin/bash" -it mcr.microsoft.com/dotnet/core/sdk:3.0.100-preview9-bionic
root@479f77fc5208:/# cd root
root@479f77fc5208:~# mkdir console
root@479f77fc5208:~# cd console/
root@479f77fc5208:~/console# dotnet new console
Getting ready...
The template "Console Application" was created successfully.

Processing post-creation actions...
Running 'dotnet restore' on /root/console/console.csproj...
  Restore completed in 46.74 ms for /root/console/console.csproj.

Restore succeeded.

>root@479f77fc5208:~/console# dotnet build -bl
Microsoft (R) Build Engine version 16.3.0-preview-19426-01+faf5e5d75 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

/usr/share/dotnet/sdk/3.0.100-preview9-014004/MSBuild.dll -bl -consoleloggerparameters:Summary -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,/usr/share/dotnet/sdk/3.0.100-preview9-014004/dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,/usr/share/dotnet/sdk/3.0.100-preview9-014004/dotnet.dll -maxcpucount -restore -verbosity:m ./console.csproj
  Restore completed in 11.83 ms for /root/console/console.csproj.
  You are using a preview version of .NET Core. See: https://aka.ms/dotnet-core-preview
/usr/share/dotnet/sdk/3.0.100-preview9-014004/Roslyn/Microsoft.CSharp.Core.targets(59,5): error MSB6004: The specified task executable location "/" is invalid. [/root/console/console.csproj]

Build FAILED.

/usr/share/dotnet/sdk/3.0.100-preview9-014004/Roslyn/Microsoft.CSharp.Core.targets(59,5): error MSB6004: The specified task executable location "/" is invalid. [/root/console/console.csproj]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.58

Could it be something about Linux hosts? We are using same image but getting different output.

FYI my local environment is Ubuntu 19

Strangely, but the same Dockerfile and project, in an Windows Host and Docker toolbox it's works!

could you fetch out the msbuild.binlog file from the container that was generated when built with the -bl switch? This file can be viewed with  https://github.com/KirillOsenkov/MSBuildStructuredLog (or replayed to text logs) which can help in diagnosing the issue.. (i don't have linux host near me at the moment)

Sorry, attached already in previous comment. I will try to generate another binlog for Win32Exception.

 AFAIK This should only happen when the Csc task is successfully loaded but then generates wrong paths..

Interestingly, docker environments seem to differ in the DOTNET_HOST_PATH environment variable wich is / on the failing containsers and /usr/share/dotnet/dotnet my one. But the build still works if i change it to /

Another interesting behavior, two of my projects which teams use windows machines and VS2019 had this issue.
In another particular project, always coded under Linux environment, the same image works fine.

Generated binlog file for Win32Exception under Linux was not contain any exception info. So i build our internal project with

dotnet build "mySolution.ConsoleProject1.csproj" -bl -c Release -o out -f netcoreapp3.0 -r linux-x64 -v d

and output file attached. Why MsBuild messing something that causes Win32Exception under Linux??
Microsoft.Build.BackEnd.NodeFailedToLaunchException: The FileName property should not be a directory unless UseShellExecute is set.
 ---> System.ComponentModel.Win32Exception (0x80004005): The FileName property should not be a directory unless UseShellExecute is set.
   at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)

output.zip

Win32Exception ist used for any error involving native methods, not just windows. It was not renamed for .NET core since it would have broken a lot of code.

@dasMulli are you changing it inside or outside the dotnet build invocation? I believe that gets set in the CLI, and I think it being set and respected would explain this problem.

I was changing it outside, so that could explain it.. maybe csc trying to start vbcscompiler then causes this issue.
Question is why this gets set to / on some hosts.

This started just started happening for me. I'm running Ubuntu 19.04 with kernel 5.0.0-27-generic. Was working perfectly fine until I upgraded a couple of packages and rebooted the system.

Reverting to kernel 5.0.0-25-generic fixes the problem for me.

Looping in @livarcocc, too.
The CLI passes DOTNET_HOST_PATH to MSBuild bsed on the value Process.GetCurrentProcess().MainModule.FileName. I have no idea why that would be reported incorrectly in some situations. I'm more inclined to suspect a .NET change than the kernel, but that's an interesting data point above . . .

FYI in my MacOS with Docker v<IP_ADDRESS> I didn't get this error. Here's the log:
root@5292389adda3:~# cd root/
bash: cd: root/: No such file or directory
root@5292389adda3:~# dir
root@5292389adda3:~# ls -a
.  ..  .bashrc  .dotnet  .nuget  .profile
root@5292389adda3:~# mkdir console
root@5292389adda3:~# cd console/
root@5292389adda3:~/console# pwd
/root/console
root@5292389adda3:~/console# dotnet new console
Getting ready...
The template "Console Application" was created successfully.

Processing post-creation actions...
Running 'dotnet restore' on /root/console/console.csproj...
  Restore completed in 97.49 ms for /root/console/console.csproj.

Restore succeeded.

root@5292389adda3:~/console# dotnet build
Microsoft (R) Build Engine version 16.3.0-preview-19426-01+faf5e5d75 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restore completed in 20.56 ms for /root/console/console.csproj.
  You are using a preview version of .NET Core. See: https://aka.ms/dotnet-core-preview
  console -> /root/console/bin/Debug/netcoreapp3.0/console.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:02.27
root@5292389adda3:~/console#

@rainersigwald Have a look at https://stackoverflow.com/questions/57790510/msbuild-unhandled-exception-the-filename-property-should-not-be-a-directory-unl . Folks on that thread state the issue started in the last 24 hours, those able to resolve it did so by reverting their kernel. Further, reports the container works just fine on MacOS support the hypthesis that it's kernel-related.

In my case, downgrade to Kernlk 5.0.25 solved my problem! Now its work like a charm

I'd sugget to dupe against https://github.com/dotnet/core/issues/3312 and wait for coreclr/corefx to figure out why this happens, seems like the broken main module filename determination causes lots of different symptoms. (MSBuild not being able to start nodes, csc not being able to start vbcscompiler)

Duplicate of #3312

There's a bug report over at Ubuntu Launchpad:  https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1843018 . You can upvote the bug report by clicking the "This bug affects me too" link just below the issue title.

Adding an FYI here for reference because reverting to previous kernel fixed a seemingly unrelated  issue I started encountering trying to attach to the vsdbg debugger in a .net core process in a container.  In short, the debugger was never finding any PDB files to load symbols presumably due to Process.GetCurrentProcess().MainModule.FileName returning an incorrect value.

I workaround it by upgrade the Ubuntu Kernel as below
$ sudo add-apt-repository ppa:teejee2008/ppa
$ sudo apt-get update
$ sudo apt-get install ukuu

Then I use ukuu to upgrade as following
$ sudo ukuu --list
$ sudo ukuu --install v5.0.21

Then run the docker build again. Hope this help

Create the Ubuntu 18.04 LTS in Azure Portal, and we would get the error
root@lab01:/home/workshop/SimplAds# docker build -f  webapi/src/SimplAdsAPI/Dockerfile -t simpleadsapi:v1 .
Sending build context to Docker daemon  760.3kB
Step 1/16 : FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build
 ---> 6b6086a5fb0e
Step 2/16 : WORKDIR /src
 ---> Using cache
 ---> e3abda56fe26
Step 3/16 : COPY ["/webapi/src/SimplAdsAPI/SimplAdsAPI.csproj", "src/SimplAdsAPI/"]
 ---> Using cache
 ---> 8e275fe1b5db
Step 4/16 : RUN dotnet restore "src/SimplAdsAPI/SimplAdsAPI.csproj"
 ---> Using cache
 ---> e90db442beca
Step 5/16 : COPY ["/webapi/src/SimplAdsAPI/.", "src/SimplAdsAPI/"]
 ---> Using cache
 ---> bb73baebd2b4
Step 6/16 : WORKDIR "/src/src/SimplAdsAPI"
 ---> Using cache
 ---> 1ac4c837412f
Step 7/16 : RUN dotnet build "SimplAdsAPI.csproj" -c Release -o /app/build --no-restore
 ---> Running in 6387090a2d03
Microsoft (R) Build Engine version 16.3.0-preview-19426-01+faf5e5d75 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  You are using a preview version of .NET Core. See: https://aka.ms/dotnet-core-preview
/usr/share/dotnet/sdk/3.0.100-preview9-014004/Roslyn/Microsoft.CSharp.Core.targets(59,5): error MSB6004: The specified task executable location "/" is invalid. [/src/src/SimplAdsAPI/SimplAdsAPI.csproj]

Build FAILED.

/usr/share/dotnet/sdk/3.0.100-preview9-014004/Roslyn/Microsoft.CSharp.Core.targets(59,5): error MSB6004: The specified task executable location "/" is invalid. [/src/src/SimplAdsAPI/SimplAdsAPI.csproj]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:01.76
The command '/bin/sh -c dotnet build "SimplAdsAPI.csproj" -c Release -o /app/build --no-restore' returned a non-zero code: 1

I work-around it by upgrade the Ubuntu Kernel as below
$ sudo add-apt-repository ppa:teejee2008/ppa
$ sudo apt-get update
$ sudo apt-get install ukuu

Then I use ukuu to upgrade as following
Current Ubuntu Kernel version
root@lab01:/tmp# ukuu
ukuu v18.9.3
Distribution: Ubuntu 18.04.3 LTS
Architecture: amd64
Running kernel: 5.0.0-1018-azure
Kernel version: <IP_ADDRESS>

List out all kernels and upgrade it
$ sudo ukuu --list
$ sudo ukuu --install v5.0.21

Then run the docker build again
root@lab01:/home/workshop/SimplAds# docker build -f  webapi/src/SimplAdsAPI/Dockerfile -t simpleadsapi:v1 .
Sending build context to Docker daemon  760.3kB
Step 1/16 : FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build
 ---> 6b6086a5fb0e
Step 2/16 : WORKDIR /src
 ---> Using cache
 ---> e3abda56fe26
Step 3/16 : COPY ["/webapi/src/SimplAdsAPI/SimplAdsAPI.csproj", "src/SimplAdsAPI/"]
 ---> Using cache
 ---> 8e275fe1b5db
Step 4/16 : RUN dotnet restore "src/SimplAdsAPI/SimplAdsAPI.csproj"
 ---> Using cache
 ---> e90db442beca
Step 5/16 : COPY ["/webapi/src/SimplAdsAPI/.", "src/SimplAdsAPI/"]
 ---> Using cache
 ---> bb73baebd2b4
Step 6/16 : WORKDIR "/src/src/SimplAdsAPI"
 ---> Using cache
 ---> 1ac4c837412f
Step 7/16 : RUN dotnet build "SimplAdsAPI.csproj" -c Release -o /app/build --no-restore
 ---> Running in e29c0d7fa6b4
Microsoft (R) Build Engine version 16.3.0-preview-19426-01+faf5e5d75 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  You are using a preview version of .NET Core. See: https://aka.ms/dotnet-core-preview
  SimplAdsAPI -> /app/build/SimplAdsAPI.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:05.42
Removing intermediate container e29c0d7fa6b4
 ---> 8cd3b5029dce
Step 8/16 : FROM build AS publish
 ---> 8cd3b5029dce
Step 9/16 : RUN dotnet publish "SimplAdsAPI.csproj" -c Release -o /app/publish --no-restore
 ---> Running in eb248ec54c9f
Microsoft (R) Build Engine version 16.3.0-preview-19426-01+faf5e5d75 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  You are using a preview version of .NET Core. See: https://aka.ms/dotnet-core-preview
  SimplAdsAPI -> /src/src/SimplAdsAPI/bin/Release/netcoreapp3.0/SimplAdsAPI.dll
  SimplAdsAPI -> /app/publish/
Removing intermediate container eb248ec54c9f
 ---> 9e3e249a515f
Step 10/16 : FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim AS final
3.0-buster-slim: Pulling from dotnet/core/aspnet
1ab2bdfe9778: Already exists
6719d95d5b26: Pull complete
d84fcef13e65: Pull complete
c0a615c59dab: Pull complete
48ef12583529: Pull complete
Digest: sha256:74f6eab6e1a190e99f50fd22aa849623e54ce3c06b9425c281e75ca92fe7f74b
Status: Downloaded newer image for mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim
 ---> ae6b2b9380c1
Step 11/16 : WORKDIR /app
 ---> Running in f7b4de6b6a03
Removing intermediate container f7b4de6b6a03
 ---> e44db3c2c220
Step 12/16 : ENV ASPNETCORE_URLS http://*:80
 ---> Running in 1216e5d73588
Removing intermediate container 1216e5d73588
 ---> 8f984d2a3f90
Step 13/16 : COPY --from=publish /app/publish .
 ---> f17e7342b37a
Step 14/16 : EXPOSE 80
 ---> Running in 29ca83c00e45
Removing intermediate container 29ca83c00e45
 ---> ba439a83fcbf
Step 15/16 : EXPOSE 443
 ---> Running in c518b711d134
Removing intermediate container c518b711d134
 ---> 3e5fa1d82904
Step 16/16 : ENTRYPOINT ["dotnet", "SimplAdsAPI.dll"]
 ---> Running in ebf9f1a2aad2
Removing intermediate container ebf9f1a2aad2
 ---> 05340b5090ba
Successfully built 05340b5090ba
Successfully tagged simpleadsapi:v1

Hope this help

this work around works for me 👍

I'm trying to build a asp.net 2.2, on a 5.0.0-1020-azure #21~18.04.1-Ubuntu.
And I get the exception (NodeFailedToLaunchException: The FileName property should not be a directory unless UseShellExecute is set.)
I intalled ukuu:
ukuu v18.9.3
Distribution: Ubuntu 18.04.3 LTS
Architecture: amd64
Running kernel: 5.0.0-1020-azure
Kernel version: <IP_ADDRESS>
And I still get the exception (NodeFailedToLaunchException: The FileName property should not be a directory unless UseShellExecute is set.)
Then I updated the kernel to 5.1.21 and the exception didn't occur anymore.

Similar problems here. Using ubuntu 18.04, kernel v<IP_ADDRESS>, fresh install, fully updated: "NodeFailedToLaunchException" errors happening at every docker build run. Same Dockerfile works on various other computers, from Debian to Windows to MacOS.
After installing the latest kernel version (5.3.1), released just hours ago, the issue disappeared.

I was having the same error on Ubuntu 19.04. The kernel update to 5.3.1 also fixed my problem

it's affecting building with github actions as well. Can't upgrade their kernel on my own ;)

same problem, updating kernel worked as suggested, thanks guys!

it's affecting building with github actions as well. Can't upgrade their kernel on my own ;)

To make it work with github action, you can use
runs-on: ubuntu-16.04

in place of
runs-on: ubuntu-latest


build-constraints.yaml: add new distribution-nixpkgs package

Uploaded to Hackage a moment ago.

Thank you!


Why does STATE_PARAMETER is always False ?

Hi. I am having troubles to make a GitHub OAuth2 workflow working. I always get the same error: social_core.exceptions.AuthFailed: Authentication failed: The code passed is incorrect or expired.
I am not sure it is related, but I noticed that STATE_PARAMETER (although being set as True for GitHub), is always set to False by this library. Why ? And what the comment is actually implying ? I couldn't find any documentation about it.
        # skip checking state by setting following params to False
        # it is responsibility of front-end to check state
        # TODO: maybe create an additional resource, where front-end will
        # store the state before making a call to oauth provider
        # so server can save it in session and consequently check it before
        # sending request to acquire access token.
        # In case of token authentication we need a way to store an anonymous
        # session to do it.
        self.request.backend.REDIRECT_STATE = False
        self.request.backend.STATE_PARAMETER = False

My workflow is the following:

a frontend SPA has a button pointing to https://github.com/login/oauth/authorize with correct parameters (including state built on page loading).
once authorized, it is redirected by GitHub to frontend, with code and state, where I can make a post with all code, provider, state.
POST request is made to /auth/social/token/
Django backend receives request, and says: Authentication failed: The code passed is incorrect or expired. (in the auth_complete method of BaseOAuth2 class inside social_core.

Thanks!

My mistake, I forgot to update the client secret in my .env file after playing around.
Indeed, it is the frontend responsability of checking state consistency, I understand that.
What strucked me was that I wondered whether I should create an application in the oauth2_provider Django admin, for GitHub, and with what kind of parameters etc. The similar library of yours drf-social-auth2 requires to create such app before going further.


tf.print() mixes up the keys and values in a nested dictionary, leading to incorrect representation of the object content

System information

Have I written custom code (as opposed to using a stock example script provided in TensorFlow): Yes
OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Colab
Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: -
TensorFlow installed from (source or binary): pip binary
TensorFlow version (use command below): 2.6.0
Python version: 3.7.11
Bazel version (if compiling from source): n/a
GCC/Compiler version (if compiling from source): n/a
CUDA/cuDNN version: n/a
GPU model and memory: n/a

Describe the current behavior
tf.print mixes up the order of dictionary keys and values when printing a dict which is nested inside a namedtuple. See example below, tf.print claims that the key 'a' has the value 2, when in fact it has the value 1.
Describe the expected behavior
tf.print represents the content of the object correctly.
Standalone code to reproduce the issue
https://colab.research.google.com/gist/Andreas5739738/d8abda0605692c3a37c28ba94da510d6/notebook.ipynb
import tensorflow as tf
from collections import namedtuple

# create a dict inside a namedtuple
X = namedtuple('X', ['x', 'y'])
data = X(x=tf.constant([0]), y={'b': tf.constant([2]), 'a': tf.constant([1])})

dataset = tf.data.Dataset.from_tensor_slices(data)
output_item = list(dataset)[0]

print(f'Actual tensor content:\n{output_item}\n')

print('tf.print mixes up the order of the keys and values in the dict:')
tf.print(output_item)

Output:
Actual tensor content:
X(x=<tf.Tensor: shape=(), dtype=int32, numpy=0>, y={'b': <tf.Tensor: shape=(), dtype=int32, numpy=2>, 'a': <tf.Tensor: shape=(), dtype=int32, numpy=1>})

tf.print mixes up the order of the keys and values in the dict:
X(x=0, y={'b': 1, 'a': 2})

@Andreas5739738 I am not pretty sure what it is exactly but I could find out that tf.print kernels do get into an issue when we define tensors inside nested python sets.
Do you have any inputs from your end?
Here's the link: Exceptions
Specifically these points :

The nested structure I am using (namedtuple and dict) seems well supported by tf.nest otherwise, at least I haven't observed any problems anywhere in my data pipeline so far. tf.print seems to be the only operator that has issues with this setup.

Hi! @Andreas5739738 ! I followed  tf.dataset documentation , replacedoutput_item = list(dataset)[0] with output_item = list(dataset.as_numpy_iterator())[0]and was able to replicate and resolve this issue in 2.6. please find the gist for reference. Thanks!

Hi, I don't think as_numpy_iterator this is a viable workaround, since it will not work in graph mode, for example.

Hi!@Andreas5739738 , Could you please try the fix and update whether fix is working or not in graph mode?

Hi, tf.print is the only option I know of that can print output in graph mode. Neither print() nor tensor.to_numpy() are available in graph mode. So this is not a workaround that can be used in graph mode.

Hi! @sanatmpa1 ,Could you please look into this issue , providing gist for reference.

Hi,
Thank you for opening this issue. Since this issue has been open for a long time, the code/debug information for this issue may not be relevant with the current state of the code base.
The Tensorflow team is constantly improving the framework by fixing bugs and adding new features. We suggest you try the latest TensorFlow version with the latest compatible hardware configuration which could potentially resolve the issue. If you are still facing the issue, please create a new GitHub issue with your latest findings, with all the debugging information which could help us investigate.
Please follow the release notes to stay up to date with the latest developments which are happening in the Tensorflow space.


is it possible to parsing the mail date by using the boost?

is there any plans that the boost would give us a solution or a lib to parsing the mail message from the server?
There are so few projects that could parsing the mail messages.

This is a great question for the boost-users mailing list<EMAIL_ADDRESS>Subscribe here: https://lists.boost.org/mailman/listinfo.cgi/boost-users


Codable support for APIGateway V2 request and response payloads

Hi there!
I'm trying to update APIGateway.V2 request/response so their body can be any payload conforming to Codable.
Since API requests can be many formats other than JSON, I've added APIGateway.V2.JSONRequest and APIGateway.V2.JSONResponse as separate, generic, types that can be used on Lambda function handlers as In/Out. These are basically a copy of APIGateway.V2.Request and APIGateway.V2.Response, but made generic with a Codable body property.
For example, given the following Request and Response payloads:
struct Request: Codable {
    let name: String
}

struct Response: Codable {
    let message: String
}

We could use them with AWS API Gateway V2 as follows:
// MARK: - Run Lambda

Lambda.run(APIGatewayProxyLambda())

// MARK: - Handler, Request and Response

struct APIGatewayProxyLambda: EventLoopLambdaHandler {
    typealias In = APIGateway.V2.JSONRequest<Request>
    typealias Out = APIGateway.V2.JSONResponse<Response>

    func handle(context: Lambda.Context, event: In, callback: @escaping (Result<Out, Error>) -> Void) {
        let message: String
        if let name = event.body?.name {
            message = "Hello, \(name)!"
        } else {
            message = "Hello, World!"
        }
        let payload = Response(message: message)
        callback(.success(APIGateway.V2.Response(statusCode: .ok, body: payload)))
    }
}

This code, while it compiles fine, is giving me an error when invoking the function. Here is what I see in CloudWatch:
2020-06-14T15:17:36+0000 warning: lifecycleIteration=0 lambda handler returned an error: requestDecoding(Swift.DecodingError.typeMismatch(Swift.Dictionary<Swift.String, Any>, Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "body", intValue: nil)], debugDescription: "Expected to decode Dictionary<String, Any> but found a string/data instead.", underlyingError: nil)))

Thoughts? I think having Codable support for API Gateway V2 payloads is a big plus.
Hopefully we can get it to work, any help would be appreciated.

Hi @eneko, thanks for bringing this up and providing a PR.

This code, while it compiles fine, is giving me an error when invoking the function.

The problem you're running into is the following. The body is by default encoded as un utf8 string, even if it contains json. That mean's you can not decode the whole structure in one go anyway.
The json you receive looks like this:
{
  "otherProperty": "foo",
  "body": "{\"some\":\"json\"}",
  "otherProperty": "bar"
}

As you can see the body is a String in which another json struct is encoded. You need to read the String first, create a new json data blob Data(body.utf8) and only then you can use a new or the existing JSONDecoder to decode your Payload.
While you raise a valid point, I'm unsure if copy and pasting the existing APIGateway.V2.Request and APIGateway.V2.Response is the best approach here.
Personally I'd prefer to see extensions on the original event types that provide such functionality. If the original event types need to be open up for those extensions I'm all for it.

Oh, that makes total sense, thank you @fabianfett!
I agree 100%. Knowing how the data is structure, providing a Codable getter for APIGateway.V2.Request, and a Codable initializer for APIGateway.V2.Response as extensions seem a much cleaner approach.
I've updated this PR with this changes, let me know what you think.

I've added some unit tests and inline documentation. If this looks like a good approach, I'll move the PR to "Ready for Review"

@swift-server-bot test this please

Hi @eneko,
if I understand you correctly, your primary goad is to have a one liner to get the json payload out of the APIGateway.V2.Request. To be honest we also have the same problem with SQS.Message, SNS.Message and APIGateway.Request.
The real issue imho is that people can't just use the JSONDecoder to decode strings right away. One thing that would solve this is to make the request decoding a one liner, could be an approach like this:
// MARK: - Run Lambda

Lambda.run(APIGatewayProxyLambda())

// MARK: - Handler, Request and Response

struct APIGatewayProxyLambda: EventLoopLambdaHandler {
    typealias In = APIGateway.V2.JSONRequest
    typealias Out = APIGateway.V2.JSONResponse

    struct Request: Codable {
        let name: String
    }

    struct Response: Codable {
        let message: String
    }

    func handle(context: Lambda.Context, event: In, callback: @escaping (Result<Out, Error>) -> Void) {
        do {
            let jsonRequest = try self.decoder.decode(Request.self, from: event.body)
            // ^-- magic here
        } catch {
            return .success(.init(status: .badRequest))
        }
        // unimportant right now
    }
}

There are other JSON libraries out there with which you can do this out of the box, since they use Collections of UInt8 as the input.
Please also note that we use the default decoder of the lambda handler to increase performance.
So I propose the following we add an extension to JSONDecoder in the AWSLambdaRuntime target. AWSLambdaRuntime is the place for all Foundation JSON stuff anyway.
extension JSONDecoder {
    func decode<T: Decodable>(_ type: T.Type, from string: String) throws -> T {
        guard let data = Data(from.utf8) else {
            preconditionFailure("must never happen")
        }
        return try self.decode(type, from: data)
    }
}

This way we would add more convenience to JSONDecoder without moving the implementation of AWSLambdaEvents into a more Foundation biased direction.
For the encoder we could go into a similar direction with the encoder supporting encoding into a String.
@eneko would this work for you?
@tomerd @ktoso wdyt?

Hi @fabianfett,
From what I see, that solution could work well. I agree using the default encoder/decoder form AWSLambdaRuntime would be great. Whether it uses Foundation or something else, it shouldn't matter to the end user.
Before getting further down this path, let's take a step back. I think it is important to clarify the goal, so we can find the best solution.

if I understand you correctly, your primary goad is to have a one liner to get the json payload out of the APIGateway.V2.Request

I have a bit higher expectations: the real goal, in my opinion, would be to have a zero-liner solution. Let me explain.
This is the most basic Codable example, from @tomerd blog post:
private struct Request: Codable {
  let name: String
}

private struct Response: Codable {
  let message: String
}

// In this example we are receiving and responding with JSON using Codable
Lambda.run { (context, request: Request, callback) in
  callback(.success(Response(message: "Hello, \(request.name)")))
}

The simplicity of this code is great. Codable lets users focus on their data transfer models, instead of manually having to deal with encoding, decoding.
We should be able to provide the same level of simplicity when working with any type from AWSLambdaEvents, as long as the payload is JSON.

To be honest we also have the same problem with SQS.Message, SNS.Message and APIGateway.Request

I'm not sure about SQS.Message and SNS.Message. However, for APIGateway and APIGateway.V2 we should be able to look at the request headers. Then, if the content-type of the request is application/json, automatically decode the body to a given Body type using generics.
I'm hoping I'm making sense here. The goal, to summarize, would be to automatically decode the body payload, when content type is JSON, and provide this decoded body to the lambda handler method, so users do not have to worry about it.
Rewriting the code above using APIGateway.V2, this is what I would want the API to look like:
private struct Request: Codable {
  let name: String
}

private struct Response: Codable {
  let message: String
}

// In this example we are receiving and responding with JSON using Codable
Lambda.run { (context, event: APIGateway.V2.Request<Request>, callback: @escaping (Result<APIGateway.V2.Response<Response>, Error>) -> Void) in
  let body = Response(message: "Hello, \(event.body.name)")
  callback(.success(APIGateway.V2.Response(statusCode: .ok, body: body)))
}

This code would need some tweaks, probably to handle encoding/decoding errors, but maybe we could abstract that too.
Again, the goal would be to have a fully decoded body prior to invocation of the handler.
This should be viable. It might require exposing AWSLambdaRuntime encoder/decoder, so they can be used by AWSLambdaEvents. Or maybe, as suggested, AWSLambdaEvents could use a generic interface provided by the runtime module, that abstracts this encoding/decoding. In any case, the runtime module would have to expose an API for encoding/decoding JSON (or other types of payload encoders/decoders, like XML).
Let me know if the makes sense. I appreciate each comment on this review, great feedback, I'm learning a lot.

So I propose the following we add an extension to JSONDecoder in the AWSLambdaRuntime target. AWSLambdaRuntime is the place for all Foundation JSON stuff anyway.

I think this would be a useful and nice addition

Again, the goal would be to have a fully decoded body prior to invocation of the handler.

I tend to agree this would be the optimal user experience

@eneko

Again, the goal would be to have a fully decoded body prior to invocation of the handler.

@tomerd

I tend to agree this would be the optimal user experience

I'm sure such an EventType could be build. I'm not sure though if this should be part of the more general focused AWSLambdaEvents in such a case.

@enemo just fyi: not forgotten this PR, hope to share a proposal soon

Hi  @eneko, thank you for you patience. @fabianfett and myself discussed and experimented with various alternatives, and would like to bring up some of the ideas and potential future directions for wider discussion.
The desire to have a strongly typed lambda function clearly resonates. Being able to define a Request<Body> and Response<Body> in API Gateway handlers as an example and have the system take care of the encoding/decoding is clearly a nice user experience. The challenge, of course, is in the implementation details.
As you mention, several AWS event payloads provide a free-from body: e.g. API Gateway, SNS, and SQS.
Those payloads do not say much about the serialization of that body - they  provide the content as a String and an isBase64Encoded flag so that the consumer can decode based on the expected format.
The body could be JSON, and its often is, but it could also be any other format e.g. XML, or a binary blob encoded as base64. As such, in order for the lambda runtime library to utility for body encoding/decoding it's not enough to know the expected type, but we also need to know the expected encoder/decoder. Of course, we can default to JSON to make the API easier, but we need to allow extension points to configure alternatives.
Following this line of thinking, the only generic implementation option we could come up with would be to define a new type that represents the body and provide easy-to-use encoding/decoding APIs that default to JSON. For example (illustration purposes only):
public struct AWSBody: RawRepresentable, Equatable {
    public let rawValue: String
    public init?(rawValue: String) {
        self.rawValue = rawValue
    }
}

extension AWSBody {
    public func decode<Body: Decodable>(_ type: Body.Type, decoder: (String) throws -> Body = Self.defaultDecoder) throws -> Body {
        try decoder(self.rawValue)
    }
    public static func defaultDecoder<Body: Decodable>(string: String) throws -> Body {
        return try Lambda.defaultJSONDecoder.decode(Body.self, from: string.data(using: .utf8)!) // safe since String.data should never return nil
    }
}

extension AWSBody {
    public init<Body: Encodable>(_ body: Body, encoder: (Body) throws -> String = Self.defaultEncoder) throws {
        self.init(rawValue: try encoder(body))! // safe since AWSBody::init never returns nil
    }
    public static func defaultEncoder<Body: Encodable>(body: Body) throws -> String {
        return try String(data: Lambda.defaultJSONDecoder.encode(body), encoding: .utf8)! // safe since String(data:) from JSON should never return nil
    }
}

This means the API will not end up being the desired Request<Body> and Response<Body> but rather payload.body.decode(Body.self) which arguably is nicer than JSONDecoder().decode(body, Body.self) but does not reduce the number of lines of code compared to what we have right now. On the other hand,  this approach does enable us to add additional utility around base64 handling and users could extend it further to their use case.
Another approach could be to create a dedicated LambdaHandler that takes in the body type an associatedtype and has injection points for the encoder/decoder. For example (illustration purposes only):
protocol APIGatewayLambdaHandler: EventLoopLambdaHandler {
    associatedtype Request: Decodable
    associatedtype Response: Encodable
    func handle(context: Lambda.Context, request: Request?) -> EventLoopFuture<Response>
    func encode(response: Response) throws -> String?
    func decode(request: String) throws -> Request
}

extension APIGatewayLambdaHandler {
    func handle(context: Lambda.Context, event: APIGateway.V2.Request) -> EventLoopFuture<APIGateway.V2.Response> {
        let requestBody: Request?
        do {
            requestBody = try event.body.map(self.decode)
        } catch {
            return context.eventLoop.makeFailedFuture(error)
        }
        return self.handle(context: context, request: requestBody).flatMapThrowing { response in
            let responseBody = try self.encode(response: response)
            return APIGateway.V2.Response(statusCode: .ok, body: responseBody)
        }
    }
}

extension APIGatewayLambdaHandler {
    func encode(response: Response) throws -> String? {
        try String(data: Lambda.defaultJSONEncoder.encode(response), encoding: .utf8)
    }
    func decode(request: String) throws -> Request {
        try Lambda.defaultJSONDecoder.decode(Request.self, from: request.data(using: .utf8)!)
    }
}

This approach is much more heavy weight but has the advantage of setting the foundation for providing additional functionality around certain event types. Its especially compelling for api-gateway integration where its common to need other middleware-like functionality such as routing. The challenge with this approach is how far we want to extend the runtime library, or IOW should we leave this kind of more opinionated functionality to libraries that the community builds on top of the runtime library?
Of course the approaches are not mutually exclusive - the second can be built on top of the first.
WDYT?

This is great, @tomerd, thanks for getting back. Personally, I like the second approach, with associated types. It looks pretty similar to other code I've worked with, were we have Payload, Response and ErrorResponse associated types for network requests.
Probably at this point, the best option is to make this a separate Swift Package. Then, we could merge it into this one if it had enough support and met all needs/requirements. I'd be happy to work on that, but might take some time.

Closing in favor: https://github.com/swift-server/swift-aws-lambda-runtime/pull/144


Maximum recursion depth exceeded while calling a Python object

Some of our users are reporting recursion error when building python packages after upgrading to setuptools-34.0.2. Any tips on how we can figure out what is happening here?
https://bugs.gentoo.org/show_bug.cgi?id=607164
  File "/var/tmp/portage/dev-python/setuptools-34.0.2-r1/work/setuptools-34.0.2-python2_7/setuptools/dist.py", line 386, in finalize_options
    ep.require(installer=self.fetch_build_egg)
  File "/var/tmp/portage/dev-python/setuptools-34.0.2-r1/work/setuptools-34.0.2-python2_7/pkg_resources/__init__.py", line 2318, in require
    items = working_set.resolve(reqs, env, installer, extras=self.extras)
  File "/var/tmp/portage/dev-python/setuptools-34.0.2-r1/work/setuptools-34.0.2-python2_7/pkg_resources/__init__.py", line 851, in resolve
    dist = best[req.key] = env.best_match(req, ws, installer)
  File "/var/tmp/portage/dev-python/setuptools-34.0.2-r1/work/setuptools-34.0.2-python2_7/pkg_resources/__init__.py", line 1123, in best_match
    return self.obtain(req, installer)
  File "/var/tmp/portage/dev-python/setuptools-34.0.2-r1/work/setuptools-34.0.2-python2_7/pkg_resources/__init__.py", line 1135, in obtain
    return installer(requirement)
  File "/var/tmp/portage/dev-python/setuptools-34.0.2-r1/work/setuptools-34.0.2-python2_7/setuptools/dist.py", line 417, in fetch_build_egg
    dist = self.__class__({'script_args': ['easy_install']})
  File "/var/tmp/portage/dev-python/setuptools-34.0.2-r1/work/setuptools-34.0.2-python2_7/setuptools/dist.py", line 320, in __init__
    _Distribution.__init__(self, attrs)
  File "/usr/lib64/python2.7/distutils/dist.py", line 287, in __init__
    self.finalize_options()
  File "/var/tmp/portage/dev-python/setuptools-34.0.2-r1/work/setuptools-34.0.2-python2_7/setuptools/dist.py", line 386, in finalize_options
    ep.require(installer=self.fetch_build_egg)
  File "/var/tmp/portage/dev-python/setuptools-34.0.2-r1/work/setuptools-34.0.2-python2_7/pkg_resources/__init__.py", line 2318, in require
    items = working_set.resolve(reqs, env, installer, extras=self.extras)
  File "/var/tmp/portage/dev-python/setuptools-34.0.2-r1/work/setuptools-34.0.2-python2_7/pkg_resources/__init__.py", line 844, in resolve
    env = Environment(self.entries)
  File "/var/tmp/portage/dev-python/setuptools-34.0.2-r1/work/setuptools-34.0.2-python2_7/pkg_resources/__init__.py", line 1051, in __init__
    self.scan(search_path)
  File "/var/tmp/portage/dev-python/setuptools-34.0.2-r1/work/setuptools-34.0.2-python2_7/pkg_resources/__init__.py", line 1080, in scan
    for dist in find_distributions(item):
  File "/var/tmp/portage/dev-python/setuptools-34.0.2-r1/work/setuptools-34.0.2-python2_7/pkg_resources/__init__.py", line 2010, in find_on_path
    path_item_entries = _by_version_descending(os.listdir(path_item))
  File "/var/tmp/portage/dev-python/setuptools-34.0.2-r1/work/setuptools-34.0.2-python2_7/pkg_resources/__init__.py", line 1994, in _by_version_descending
    return sorted(names, key=_by_version, reverse=True)
  File "/var/tmp/portage/dev-python/setuptools-34.0.2-r1/work/setuptools-34.0.2-python2_7/pkg_resources/__init__.py", line 1992, in _by_version
    return [packaging.version.parse(part) for part in parts]
  File "/usr/lib64/python2.7/site-packages/packaging/version.py", line 31, in parse
    return Version(version)
RuntimeError: maximum recursion depth exceeded while calling a Python object

@floppym See here: https://github.com/pypa/setuptools/issues/944#issuecomment-275238738 I found a temporary solution to this; I demoed the upgrade in new docker containers with a very old setuptools (3.3) upgrading to 34.0.2

The issue here appears to be that something is calling easy_install to fetch_build_eggs. It's difficult to tell when or why this issue is triggered without more information, like which commands cause this error and what output happens prior. If I had to guess, though, the issue is that setuptools is missing its (new) dependencies and is trying to resolve them itself.
Please dig into the build scripts in Gentoo and distill the steps that you need to enact in a clean environment to replicate the error, at which point we should be able to describe the cause.

A build log is here: https://bugs.gentoo.org/attachment.cgi?id=461384
I cannot reproduce the problem myself, so giving you "distilled" steps to reproduce it is difficult. At a high level, the source tarball is unpacked, and we run /usr/bin/python2.7 setup.py build.
The build dependencies stated in the package metadata are below.
    >=dev-python/packaging-16.8
    >=dev-python/six-1.10.0
    >=dev-python/appdirs-1.4.0-r1

It is worth noting that the build process is being run in a private network namespace, with no access to outside systems. Fetching packages from pypi should fail in this case (not produce an infinite recursion).

The issue begins when at setuptools.dist:386, when setuptools is resolving the entry points for distutils.setup_keywords, which should resolve immediately without attempting to install anything. It's hard to be certain, but the entrypoint is likely referring to one of the setuptools entry points, and so it's the installer that's detecting that setuptools or one of its dependencies isn't installed.
Since you say the dependencies are installed, perhaps it's the case that they're installed in a way that's not recognized by pkg_resources.
Are you able to inject commands into the process? What happens if before setup.py build, you invoke -c "import pkg_resources; print(pkg_resources.require('setuptools'))"?

That's doable. I have asked that someone perform this test on the Gentoo bug report.

@jaraco I just started to get almost the same problem but with a different stack trace.
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 870, in obtain
    return installer(requirement)
  File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 292, in fetch_build_egg
    dist = self.__class__({'script_args':['easy_install']})
  File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 243, in __init__
    _Distribution.__init__(self,attrs)
  File "/usr/lib/python2.7/distutils/dist.py", line 287, in __init__
    self.finalize_options()
  File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 276, in finalize_options
    ep.require(installer=self.fetch_build_egg)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2100, in require
    working_set.resolve(self.dist.requires(self.extras),env,installer)))
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 620, in resolve
    dist = best[req.key] = env.best_match(req, ws, installer)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 858, in best_match
    return self.obtain(req, installer) # try and download/install
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 870, in obtain
    return installer(requirement)
  File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 292, in fetch_build_egg
    dist = self.__class__({'script_args':['easy_install']})
  File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 243, in __init__
    _Distribution.__init__(self,attrs)
  File "/usr/lib/python2.7/distutils/dist.py", line 287, in __init__
    self.finalize_options()
  File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 276, in finalize_options
    ep.require(installer=self.fetch_build_egg)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2100, in require
    working_set.resolve(self.dist.requires(self.extras),env,installer)))
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 620, in resolve
    dist = best[req.key] = env.best_match(req, ws, installer)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 858, in best_match
    return self.obtain(req, installer) # try and download/install
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 870, in obtain
    return installer(requirement)
  File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 292, in fetch_build_egg
    dist = self.__class__({'script_args':['easy_install']})
  File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 243, in __init__
    _Distribution.__init__(self,attrs)
  File "/usr/lib/python2.7/distutils/dist.py", line 287, in __init__
    self.finalize_options()
  File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 276, in finalize_options
    ep.require(installer=self.fetch_build_egg)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2100, in require
    working_set.resolve(self.dist.requires(self.extras),env,installer)))
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 613, in resolve
    env = Environment(self.entries)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 782, in __init__
    self.scan(search_path)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 811, in scan
    for dist in find_distributions(item):
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1773, in find_distributions
    importer = get_importer(path_item)
  File "/usr/lib/python2.7/pkgutil.py", line 394, in get_importer
    importer = ImpImporter(path_item)
RuntimeError: maximum recursion depth exceeded while calling a Python object

I run the following command inside a docker container
easy_install -U setuptools>=11.3

With the following setup/tools installed when executing the command
root@5577db2d4278:/# easy_install --version
setuptools 3.3
root@5577db2d4278:/# python --version
Python 2.7.6
root@5577db2d4278:/# pip --version
pip 9.0.1 from /usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg (python 2.7)
root@5577db2d4278:/# pip freeze
chardet==2.0.1
colorama==0.2.5
html5lib==0.999
pycurl==7.19.3
python-apt===<IP_ADDRESS>ubuntu1
requests==2.2.1
six==1.5.2
urllib3==1.7.1

When trying to install through pip there is no problem

Setuptools 34 specifically drops support for upgrading itself. I wouldn't expect easy_install -U setuptools to work unless six>=1.6 and late appdirs and packaging are already installed (see setup.py for specific dependencies. Before 34.0.3, it required six>=1.10.0. Using pip is the best approach.

pip install -u setuptools pip - helped me

Setuptools 36 restores support for self install by vendoring dependencies again.


godef-jump fail for my own library code

I got a minimum setup to repro this issue at https://github.com/ximyu/godef_fail. So the basic code structure is like:
// $GOPATH/src/github.com/ximyu/godef_fail/lib/lib.go

package lib

func MyLibFunc() {}

// $GOPATH/src/github.com/ximyu/godef_fail/main.go

package godef_fail

import (
	"github.com/ximyu/godef_fail/lib"
	"time"
)

func main() {
	t := time.Now()  // godef works here
	lib.MyLibFunc()  // godef won't work here
}

With this setup, godef-jump works fairly well for system built-in libraries such as time.Now.  But won't work with my own library code, complain godef: no declaration found for lib.MyLibFunc in Emacs.  But when I switched to call godef binary directly from my cmd it worked very well:
>>> cd $GOPATH/src/github.com/ximyu/godef_fail
>>> godef -debug -t -f=./main.go lib.MyLibFunc
2015/08/11 17:26:40 exprType tuple:false pkg: *ast.SelectorExpr lib.MyLibFunc [
2015/08/11 17:26:40 exprType tuple:false pkg: *ast.Ident lib [
2015/08/11 17:26:40 exprType tuple:false pkg: *ast.ImportSpec "github.com/ximyu/godef_fail/lib" [
2015/08/11 17:26:40 ] -> 0x0, Type{package "" *ast.ImportSpec "github.com/ximyu/godef_fail/lib"}
2015/08/11 17:26:40 ] -> 0xc20800b040, Type{package "" *ast.ImportSpec "github.com/ximyu/godef_fail/lib"}
2015/08/11 17:26:40 member Type{package "" *ast.ImportSpec "github.com/ximyu/godef_fail/lib"} 'MyLibFunc' {
2015/08/11 17:26:40 } -> &{func MyLibFunc 0xc20803ce40 <nil> <nil>}
2015/08/11 17:26:40 exprType tuple:false pkg: *ast.Ident MyLibFunc [
2015/08/11 17:26:40 exprType tuple:false pkg: *ast.FuncType func() [
2015/08/11 17:26:40 ] -> 0x0, Type{type "" *ast.FuncType func()}
2015/08/11 17:26:40 ] -> 0xc20800af00, Type{func "" *ast.FuncType func()}
2015/08/11 17:26:40 ] -> 0xc20800af00, Type{func "github.com/ximyu/godef_fail/lib" *ast.FuncType func()}
/Users/yu/gocode/src/github.com/ximyu/godef_fail/lib/lib.go:3:6
MyLibFunc func()

I verified that I am using the same godef binary from both terminal and Emacs. I installed go-mode through melpa and the version I'm using is go-mode-20150709.1243.

What's the result of running M-: (getenv "GOPATH") in Emacs?

Ah, that does the magic!  After (setenv "GOPATH" "xxxx") it's working now.  Thanks a ton!


Create Snowflake Masking Policies in Terraform also set table column masking policies

Is your feature request related to a problem? Please describe.
would like to be able to create and apply masking policies this would probably involve two resources
snowflake_masking_policy based of https://docs.snowflake.com/en/user-guide/security-column-ddm-intro.html#dynamic-data-masking-ddl
we would another resource type to do the command
alter table empl_info modify column empl_id set masking policy mask_empl_id;

as shown here https://docs.snowflake.com/en/sql-reference/sql/alter-table-column.html#examples
Describe the solution you'd like
I would like to be able create masking policies in terraform them and set the table columns which the masking policy should apply
Describe alternatives you've considered
I am also looking to see if I can get dbt (data build tool) to create and apply masking these policies
currently I am using dbt jinja2 macro to create  views that either return masked PII data or the real data based on roles
Additional context
none

Looks like a PR has been merged for this https://github.com/chanzuckerberg/terraform-provider-snowflake/commit/20e62ab7f18299e9aecfd1fcdc5e49a8852435ae but not yet released will close this when it gets into a release

Looks like a PR has been merged for this https://github.com/chanzuckerberg/terraform-provider-snowflake/commit/20e62ab7f18299e9aecfd1fcdc5e49a8852435ae but not yet released will close this when it gets into a release

@ryanking @alldoami Should snowflake_masking_policy resource generate this sql? Or should be separate resource?
alter table empl_info modify column empl_id set masking policy mask_empl_id;

Masking policy can be applied to multiple table columns so it should be separate resource.

So far you can create the masking policy and grant the privilege to apply it but you can actually apply it on table columns yet that is the missing link might be nice if there was a table data source and you use it in in an alter table resource to apply the masking.

Looks like #387 has been merged

Valid issue by @tjtaill, the disconnect between the masking policy and using the masking policy to table columns is missing.  Currently solution is outside of Terraform to run the sample query provided above by @yohei1126

I've made a PR to tackle this issue: https://github.com/chanzuckerberg/terraform-provider-snowflake/pull/796

+1 on this issue - we will definitely use this once it's available! Thanks @brewerdaniel-IW for taking it on 👍

I believe this resource helps us to attach masking policies on tables, Is there any resource to attach masking policies on views?


when I use hyperledger explorer connect to the network, the channels show [] and the nodes show 2

@maheshwarishikha
when I use hyperledger explorer connect to the network, the channels show [] and the nodes show 2,.
the right result should be channels = ['channel1'] and nodes number = 4?

get channels
/api/channels/info ->

{
"status": 200,
"channels": []   // should be ['channel1']
}
2)get nodes number
api/status/ ->
{
"chaincodeCount": "1",
"txCount": "2",
"latestBlock": "2",
"peerCount": "2" // should be 4
}

I do not see any updates here. Hope it is working now for you. Hence closing the issue, feel free to reopen or open a new issue. Thanks.


Getting an Error while manually building container

seems to be related to create-react-app not supporting latest version of typescript, requiring an overrides section into the code:
https://github.com/facebook/create-react-app/issues/13080
this same issues points out create-react-app is no longer officially supported by the React docs and points out vite as the alternative (which also appears to have its own problems)
there's also a vulnerability support that is a little bit weird because it tries to install an older version of react-scripts when we already have 5.0.1 installed:
https://github.com/advisories/GHSA-rp65-9cf3-cjxr


How do you do live preview with tinymist in neovim?

The GitHub repo for https://github.com/Enter-tainer/typst-preview says the live server preview functionality has been incorporated into tinymist.
I haven't been able to find this option on any of the docs.
Any help would be much appreciated. Thank you.

https://github.com/chomosuke/typst-preview.nvim

Ah, I see!
Just curious, Does this mean there will be two separate instances of tinymist running? One for tinymist, and one for the typst-preview?

Does this mean there will be two separate instances of tinymist running? One for tinymist, and one for the typst-preview?

Yes, since there is no client-side language plugin, some editor-dependent features, e.g. the preview feature are limited. typst-preview.nvim just uses tinymist as a cli rather than a language server.
If one is going to make such a plugin for neovim, they can check editors/vscode/src/features/preview.ts, which holds preview state and communicate with the language server on behalf of the editor for preview panel reactions.


File version (Linux) crashes when opening the Select Data window.

From backlog item:228
Run SCI from the command line (./start_sci),
select a File Project. Opening the Select Data dialog causes a crash.

Remove access to gui from input tree.
GUI lifecycle now managed  the same as other 'Process' plugins. A new instance of the user control is made eahc time the 'ods plugin' option is chosen. It is non-modal.

TEST: Dialog is modeless and can only be posted from processes tree.
PASS: daf4c014f7fd


Fix

Coverage remained the same at 100.0% when pulling 5f81486b970ffd006746e80f1dd7de617892fe6f on fix into fa2e92d6dc40fa9dee6d2a662a3af664e1a6453b on master.

Coverage remained the same at 100.0% when pulling ba3c7820c671b84aca9c0878c8db85a0c24b671f on fix into fa2e92d6dc40fa9dee6d2a662a3af664e1a6453b on master.