Giter VIP home page Giter VIP logo

samples-typescript's Introduction

samples-typescript

Each directory in this repo is a sample Temporal project built with the TypeScript SDK (see docs and API reference).

Running

In browser

The fastest way to try out these samples is running them in the browser:

Locally

Run Temporal Server:

brew install temporal
temporal server start-dev

(or use a different installation method)

Use Node version 16+:

Run the hello-world sample:

git clone https://github.com/temporalio/samples-typescript.git
cd samples-typescript/hello-world
npm i
npm start

and in another terminal:

npm run workflow

Scaffold

To scaffold a new project from one of these samples, run:

npx @temporalio/create@latest my-project --sample sample-name

or:

npx @temporalio/create@latest my-project

and you'll be given the list of sample options.

Samples

Basic

API demos

Activity APIs and design patterns

  • Activities Examples:
    • makeHTTPRequest: Make an external HTTP request in an Activity (using axios).
    • cancellableFetch: Make a cancellable HTTP request with cancellationSignal.
    • doSomethingAsync: Complete an Activity async with AsyncCompletionClient.
  • Activity Cancellation and Heartbeating: Heartbeat progress for long running activities and cancel them.
  • Dependency Injection: Share dependencies between activities (for example, when you need to initialize a database connection once and then pass it to multiple activities).
  • Worker-Specific Task Queues: Use a unique task queue per Worker to have certain Activities only run on that specific Worker. For instance for a file processing Workflow, where the first Activity is downloading a file, and subsequent Activities need to operate on that file. (If multiple Workers were on the same queue, subsequent Activities may get run on different machines that don't have the downloaded file.)

Workflow APIs

  • Timers:

    • The progress example demonstrates how to use the sleep function from @temporalio/workflow.
    • Timer Examples:
      • Send a notification to the customer if their order is taking longer than expected (using a Promise.race between the order activity and sleep).
      • Create an UpdatableTimer that can be slept on, and at the same time, have its duration updated via Signals.
  • Signals and Triggers:

    • The Signals and Queries example demonstrates the usage of Signals, Queries, and Workflow Cancellation.
    • Mutex: Workflows send Signals to each other in this example of lockWorkflow acting as a mutex.
    • State: The Workflow maintains state in a Map<string, number>, and the state can be updated and read via a Signal and a Query.
    • Async activity completion: Example of an Expense reporting Workflow that communicates with a server API. Shows how to kick off a Workflow and manually complete it at an arbitrarily later date.
  • Schedules: Schedule Workflows.

  • Cron Workflows: Schedule a cron job. DEPRECATED: use Schedules instead.

  • Child Workflows: Start and control Child Workflows.

  • Infinite Workflows: Use the continueAsNew API for indefinitely long running Workflows.

  • Search Attributes: Create, set, upsert, and read Search Attributes.

  • Subscriptions

Production APIs

  • Production Build: Build code in advance for faster Worker startup times.
  • Debugging: The vscode-debugger sample shows how to use the Temporal VS Code plugin to debug a running or completed Workflow Execution.
  • Patching: Patch in new Workflow code when making updates to Workflows that have executions in progress in production.
  • Custom Logger: Use a winston logger to get logs out of all SDK components.
  • Sinks: Use Sinks to extract data out of Workflows for alerting/logging/metrics/tracing purposes.
  • Worker Versioning: Version Workers with Build IDs in order to deploy incompatible changes to Workflow code.
  • Protobufs: Use Protobufs.
  • Custom Payload Converter: Customize data serialization by creating a PayloadConverter that uses EJSON to convert Dates, binary, and regexes.
  • Monorepos:
    • /monorepo-folders: yarn workspace with packages for a web frontend, API server, Worker, and Workflows/Activities.
    • psigen/temporal-ts-example: yarn workspace containerized with tilt. Includes temporalite, parcel, and different packages for Workflows and Activities.
  • Polyglot: Use TS alongside other languages

Advanced APIs

  • Interceptors:
    • OpenTelemetry: Use the Interceptors feature to add OpenTelemetry metrics reporting to your workflows.
    • Query Subscriptions: Use Redis Streams, Immer, and SDK Interceptors to subscribe to Workflow state.
  • gRPC calls: Make raw gRPC calls for advanced queries not covered by the WorkflowClient API.

Test APIs

Full-stack apps

  • Next.js:
    • One-click e-commerce: Buy an item with one click, and the Workflow will wait 5 seconds to see if the user cancels before it executes the order.
    • Food delivery: Multi-step business process with Signals, Queries, Activities, timeouts, and List Workflow API. Turborepo monorepo with 2 Next.js apps and a tRPC API.

External apps & libraries

The below projects are maintained outside this repo and may not be up to date.

Contributing

External contributions are very welcome! 🤗 (Big thank you to those who have already contributed 🙏)

Before submitting a major PR, please find consensus on it in Issues.

To get started developing, run:

git clone https://github.com/temporalio/samples-typescript.git
cd samples-typescript
npm install
npm run prepare
npm run bootstrap

Prettier and ESLint are run on each commit, but you can also run them manually:

npm run format
npm run lint

Dependencies

  • The docs and tutorials depend on SNIPSTART and SNIPEND comments in samples. Make sure to search through the docs and learn repos to make sure a snippet is unused before removing it.
  • There are blog posts and a PDF that depend on the file structure of the food-delivery/ sample.

Updating to latest SDK version

lerna exec -- npm update

Upgrading the SDK version in package.jsons

npx zx .scripts/upgrade-versions.mjs 'VERSION_STRING_HERE'
npm run format

Config files

Also on each commit, config files from .shared/ are copied into each sample directory, overwriting the sample directory's config files (with a few exceptions listed in .scripts/copy-shared-files.mjs). So if you're editing config files, you usually want to be editing the versions in .shared/.

The .post-create file is a chalk template that is displayed in the command line after someone uses npx @temporalio/create. If you're adding a sample that requires different instructions from the default message, then add your sample name to POST_CREATE_EXCLUDE and your message template to your-sample/.post-create.

samples-typescript's People

Contributors

angelazhou32 avatar bergundy avatar dandavison avatar djsanti avatar edgji avatar feedmeapples avatar guychouk avatar halfdanj avatar jbreiding avatar joshspicer avatar joshuakgoldberg avatar kenfdev avatar lorensr avatar mend-for-github-com[bot] avatar mjameswh avatar mnichols avatar mrturck avatar msjaber avatar napcs avatar nurkiewicz avatar rachfop avatar redpanda avatar robholland avatar sjwarner avatar sushisource avatar swyxio avatar taonic avatar tdeebswihart avatar todd-zarla avatar vkarpov15 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

samples-typescript's Issues

zx-4.2.0.tgz: 1 vulnerabilities (highest severity is: 6.1) - autoclosed

Vulnerable Library - zx-4.2.0.tgz

Path to dependency file: /package.json

Path to vulnerable library: /node_modules/node-fetch/package.json

Found in HEAD commit: 2fe5a211069f374e81470f3eac2dfa6ae7af1a75

Vulnerabilities

CVE Severity CVSS Dependency Type Fixed in Remediation Available
CVE-2022-0235 Medium 6.1 node-fetch-2.6.1.tgz Transitive 4.3.0

Details

CVE-2022-0235

Vulnerable Library - node-fetch-2.6.1.tgz

A light-weight module that brings window.fetch to node.js

Library home page: https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz

Path to dependency file: /package.json

Path to vulnerable library: /node_modules/node-fetch/package.json

Dependency Hierarchy:

  • zx-4.2.0.tgz (Root Library)
    • node-fetch-2.6.1.tgz (Vulnerable Library)

Found in HEAD commit: 2fe5a211069f374e81470f3eac2dfa6ae7af1a75

Found in base branch: main

Vulnerability Details

node-fetch is vulnerable to Exposure of Sensitive Information to an Unauthorized Actor

Publish Date: 2022-01-16

URL: CVE-2022-0235

CVSS 3 Score Details (6.1)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: Required
    • Scope: Changed
  • Impact Metrics:
    • Confidentiality Impact: Low
    • Integrity Impact: Low
    • Availability Impact: None

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: GHSA-r683-j2x4-v87g

Release Date: 2022-01-16

Fix Resolution (node-fetch): 2.6.7

Direct dependency fix Resolution (zx): 4.3.0

⛑️ Automatic Remediation is available for this issue


⛑️ Automatic Remediation is available for this issue.

frontend-ui-0.1.0.tgz: 1 vulnerabilities (highest severity is: 5.3) - autoclosed

Vulnerable Library - frontend-ui-0.1.0.tgz

Path to dependency file: /monorepo-folders/package.json

Path to vulnerable library: /monorepo-folders/node_modules/@adobe/css-tools/package.json

Found in HEAD commit: 3b9bae980eb794fab08e5addef96e9ace5acb327

Vulnerabilities

CVE Severity CVSS Dependency Type Fixed in (frontend-ui version) Remediation Possible**
CVE-2023-48631 Medium 5.3 css-tools-4.3.1.tgz Transitive N/A*

*For some transitive vulnerabilities, there is no version of direct dependency with a fix. Check the "Details" section below to see if there is a version of transitive dependency where vulnerability is fixed.

**In some cases, Remediation PR cannot be created automatically for a vulnerability despite the availability of remediation

Details

CVE-2023-48631

Vulnerable Library - css-tools-4.3.1.tgz

Library home page: https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.3.1.tgz

Path to dependency file: /monorepo-folders/package.json

Path to vulnerable library: /monorepo-folders/node_modules/@adobe/css-tools/package.json

Dependency Hierarchy:

  • frontend-ui-0.1.0.tgz (Root Library)
    • jest-dom-5.17.0.tgz
      • css-tools-4.3.1.tgz (Vulnerable Library)

Found in HEAD commit: 3b9bae980eb794fab08e5addef96e9ace5acb327

Found in base branch: main

Vulnerability Details

@adobe/css-tools versions 4.3.1 and earlier are affected by an Improper Input Validation vulnerability that could result in a denial of service while attempting to parse CSS.

Publish Date: 2023-12-14

URL: CVE-2023-48631

CVSS 3 Score Details (5.3)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: None
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: None
    • Integrity Impact: None
    • Availability Impact: Low

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: @adobe/css-tools

Release Date: 2023-12-14

Fix Resolution: @adobe/css-tools - 4.3.2

[Bug] progress is not a function

I think this used to work for me, not sure what happened. workflowsPath and the export looks right. When we figure it out, let's also improve error messages.

Describe the bug

When I run timer-progress, the worker logs this:

2021-11-07T06:06:09.780Z [WARN] [temporal_sdk_core::worker] Task not found when completing: status: NotFound, message: "Workflow executionsRow not found.  WorkflowId: tutorial, RunId: 8e997415-ed60-4467-bead-2c44b3bed03a", details: [8, 5, 18, 100, 87, 111, 114, 107, 102, 108, 111, 119, 32, 101, 120, 101, 99, 117, 116, 105, 111, 110, 115, 82, 111, 119, 32, 110, 111, 116, 32, 102, 111, 117, 110, 100, 46, 32, 32, 87, 111, 114, 107, 102, 108, 111, 119, 73, 100, 58, 32, 116, 117, 116, 111, 114, 105, 97, 108, 44, 32, 82, 117, 110, 73, 100, 58, 32, 56, 101, 57, 57, 55, 52, 49, 53, 45, 101, 100, 54, 48, 45, 52, 52, 54, 55, 45, 98, 101, 97, 100, 45, 50, 99, 52, 52, 98, 51, 98, 101, 100, 48, 51, 97, 26, 66, 10, 64, 116, 121, 112, 101, 46, 103, 111, 111, 103, 108, 101, 97, 112, 105, 115, 46, 99, 111, 109, 47, 116, 101, 109, 112, 111, 114, 97, 108, 46, 97, 112, 105, 46, 101, 114, 114, 111, 114, 100, 101, 116, 97, 105, 108, 115, 46, 118, 49, 46, 78, 111, 116, 70, 111, 117, 110, 100, 70, 97, 105, 108, 117, 114, 101], metadata: MetadataMap { headers: {"content-type": "application/grpc"} } 

and the client throws:

$ nr workflow

> [email protected] workflow
> ts-node src/execute-workflow.ts

Error: 4 DEADLINE_EXCEEDED: context deadline exceeded
    at Object.callErrorFromStatus (/Users/me/gh/samples-typescript/timer-progress/node_modules/@grpc/grpc-js/src/call.ts:81:24)
    at Object.onReceiveStatus (/Users/me/gh/samples-typescript/timer-progress/node_modules/@grpc/grpc-js/src/client.ts:343:36)
    at /Users/me/gh/samples-typescript/timer-progress/node_modules/@grpc/grpc-js/src/call-stream.ts:182:27
    at Object.onReceiveStatus (/Users/me/gh/samples-typescript/timer-progress/node_modules/@temporalio/client/src/grpc-retry.ts:106:15)
    at InterceptingListenerImpl.onReceiveStatus (/Users/me/gh/samples-typescript/timer-progress/node_modules/@grpc/grpc-js/src/call-stream.ts:178:19)
    at Object.onReceiveStatus (/Users/me/gh/samples-typescript/timer-progress/node_modules/@grpc/grpc-js/src/client-interceptors.ts:430:34)
    at Object.onReceiveStatus (/Users/me/gh/samples-typescript/timer-progress/node_modules/@grpc/grpc-js/src/client-interceptors.ts:392:48)
    at /Users/me/gh/samples-typescript/timer-progress/node_modules/@grpc/grpc-js/src/call-stream.ts:299:24
    at processTicksAndRejections (node:internal/process/task_queues:78:11) {
  code: 4,
  details: 'context deadline exceeded',
  metadata: Metadata {
    internalRepr: Map(1) { 'content-type' => [Array] },
    options: {}
  }
}

and the UI shows:

image

[Feature Request] OTel interceptors sample should illustrate how to actually use a collector or other exporters

What our users care about here is not just spitting traces out to the console, but actually running in production.

Our sample shows how to hook up the interceptors but don't show how to meaningfully export the results.

We should :

  • Emphasize that, for complete tracing, you need to point core/node at the same place (an otel collector), which means using an exporter node side which points at the collector and setting the collector URL in core options

mocha-8.4.0.tgz: 1 vulnerabilities (highest severity is: 5.5) - autoclosed

Vulnerable Library - mocha-8.4.0.tgz

Path to dependency file: /activities-examples/package.json

Path to vulnerable library: /activities-examples/node_modules/nanoid/package.json

Found in HEAD commit: 3b9bae980eb794fab08e5addef96e9ace5acb327

Vulnerabilities

CVE Severity CVSS Dependency Type Fixed in Remediation Available
CVE-2021-23566 Medium 5.5 nanoid-3.1.20.tgz Transitive 9.1.4

Details

CVE-2021-23566

Vulnerable Library - nanoid-3.1.20.tgz

A tiny (108 bytes), secure URL-friendly unique string ID generator

Library home page: https://registry.npmjs.org/nanoid/-/nanoid-3.1.20.tgz

Path to dependency file: /activities-examples/package.json

Path to vulnerable library: /activities-examples/node_modules/nanoid/package.json

Dependency Hierarchy:

  • mocha-8.4.0.tgz (Root Library)
    • nanoid-3.1.20.tgz (Vulnerable Library)

Found in HEAD commit: 3b9bae980eb794fab08e5addef96e9ace5acb327

Found in base branch: main

Vulnerability Details

The package nanoid from 3.0.0 and before 3.1.31 are vulnerable to Information Exposure via the valueOf() function which allows to reproduce the last id generated.

Publish Date: 2022-01-14

URL: CVE-2021-23566

CVSS 3 Score Details (5.5)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Local
    • Attack Complexity: Low
    • Privileges Required: Low
    • User Interaction: None
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: High
    • Integrity Impact: None
    • Availability Impact: None

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: ai/nanoid#328

Release Date: 2022-01-14

Fix Resolution (nanoid): 3.1.31

Direct dependency fix Resolution (mocha): 9.1.4

⛑️ Automatic Remediation is available for this issue


⛑️ Automatic Remediation is available for this issue.

[Feature Request] Production ready NextJS integration that scales

Is your feature request related to a problem? Please describe.

First, to clarify. All examples in this repo are perfect for what they were created to demonstrate, that is most minimalistic implementation of specific feature and is very high value for us all. I am just proposing that we add one more advanced example that will make easier for developers to jump into Temporal fully configured and just start using it. Many developers just give up because setting up stuff for NextJS/Temporal is not within reach of all devs out there.

Figuring out state machines is hard. Figuring out that Temporal workflow instance is a "living statemachine" inside Temporal server is hard. Figuring out Temporal is hard. Figuring out how to integrate Temporal into NextJS properly is hard. Then figuring out how to compile TS to JS so that independent worker can use it is another step to do. Your brain will melt during your voyage thru the matter.

Describe the solution you'd like

Add Temporal integration based on existing "One Click Buy" but one that allows user to easily add more workflows and queues without brain damage during the process.

Additional context

Steps to create tight integration with NextJS that scales:

  1. use this example as starting point https://github.com/temporalio/samples-typescript/tree/main/nextjs-ecommerce-oneclick (then just rewire 2 api calls to use new folder structure proposed below, and all should worK)

  2. look at screenshot to get better understanding of folder structure that is being proposed. all files (almost) live in ./workflows directory only inside nextjs app

Screenshot 2022-01-26 at 02 36 50

  1. read explanation why this folder structure is choosen, then get source code for each file below
  • ./workflows/ - all files for Temporal are only here (except single dynamic API endpoint that maps to actions)
    • ./tsconfig.json - typescript compiler config that will be used to convert .ts to .js as source code for worker instance
    • ./__worker_source__ - here we compile .ts to .js and this is folder that will worker directly use to start itselft, pure .js files
    • ./queue1/ is sample naming for first queue, inside it we have 3 files that will be directly consumed by worker instance
      • ./activities - exports all activities for worker to import
      • ./workflows - exports all workflows for worker to import
      • ./worker - actual code that represents worker instance (the file that will be run as worker)
      • ./oneClickBuy/ - folders are only used for defining workflows that contain this file structure
        • ./_workflow-1.ts - first version of workflow definition
        • ./_workflow-2.ts - second revision of workflow definition
        • ./_workflow-current.ts - current revision of workflow definition (we are creating revisions of the same workflow during time, we need to keep all previous versions of workflow definitions that still have at least 1 instance running inside temporal server, so that we can compare old and new workflow definition and make change in latest current so that older workflow instances can work. if no instances of previous revisions exists, they are deleted or after implementation of new)
        • ./CANCEL_act.ts - code that will worker execute against external internet resources if needed
        • ./CANCEL_api.ts - processes request that we got from /api/workflows/queue1/oneClickBuy/CANCEL request
        • ./GETSTATE_api.ts - processes request that we got from /api/workflows/queue1/oneClickBuy/GETSTATE request
        • ./START_act.ts - code that will worker execute against external internet resources if needed
        • ./START_api.ts - processes request that we got from /api/workflows/queue1/oneClickBuy/START request
  1. find out about reasons behind choosing names for files

Anyone familiar with state machines (ie. Xstate) and used it in production systems both front and backend or has used Redux as concept to simplify state management, will be able to recognize pattern here.

With UPPERCASE letters we write "events" that interact with our workflow instance. The workflow instance template is in _workflow-current.ts file and START_api.ts will be responsible to create instance of that workflow in temporal server.

Now reasoning about the code is much much easier. We define workflow and we define events that interact with the instance of workflow that lives in Temporal server, very easy. Each interaction with any queue / workflow / event is as easy as triggering /api/workflows/queue1/oneClickBuy/START and that is it, it can be consumed from nextjs app or from external system.

  1. look at the list of commands to execute after all is set then move to next steps
  • docker-compose -f ./docker-compose-temporal.yml up -d to start temporal server on local machine
  • npm run temporaldev - to start typescript compiler that will read ./workflows and create .js
  • npm run temporalworkerqueue1 - to start instance of worker
  • npm run dev - to run nextjs dev server
  • then goto localhost:3000 and goto page to click on products to order
  • when you click to buy item, then goto http://localhost:8088 Temporal web interface and check if all works
  1. copy paste code into nextjs app

./package.json in scripts segment

    "temporaldev": "tsc --build --watch ./workflows/tsconfig.json",
    "temporalbuild": "tsc --build ./workflows/tsconfig.json",
    "temporalworkerqueue1": "node ./workflows/__worker_source__/queue1/worker.js",

/pages/api/workflows/[[...slug]].ts

// file with this contents, which will be universal endpoint for all actions that we will define in /workflows directory later.
import { NextApiRequest, NextApiResponse } from 'next';

// This dynamic api endpoint will use path provided to hit specific queue/workflow/activity file
// ie. https://SITENAME.com/api/workflows/queue1/oneClickBuy/CANCEL

export default async (req: NextApiRequest, res: NextApiResponse): Promise<any> => {
  const { slug } = req.query || {};
  const [queue, workflow, activity] = slug ? (Array.isArray(slug) ? slug : [slug]) : [];
  const DynamicAPILoader = await import(`@/workflows/${queue}/${workflow}/${activity}_api.ts`);
  if (DynamicAPILoader.default) {
    const [ERRreturnJSON, returnJSON] = await DynamicAPILoader.default({ req, res })
      .then((r: any) => [null, r])
      .catch((e: any) => [e]);
    if (ERRreturnJSON) {
      return res.status(500).json({ errors: [{ error: ERRreturnJSON }] });
    }
    return res.status(200).json(returnJSON);
  }
  return res.status(500).json({ error: 'No API endpoint!' });
};

./workflows/tsconfig.json

{
  "extends": "@tsconfig/node16/tsconfig.json",
  "version": "4.4.2",
  "compilerOptions": {
    "declaration": false,
    "declarationMap": false,
    "sourceMap": true,
    "rootDir": "./",
    "outDir": "./__worker_source__",
    "noImplicitAny": false
  },
  "include": ["**/*.ts"]
}

./workflows/workflows.ts

import { oneClickBuy } from './oneClickBuy/_workflow-current';

export { oneClickBuy };

./workflows/activities.ts

import { oneClickBuy_CANCEL_act } from './oneClickBuy/CANCEL_act';
import { oneClickBuy_START_act } from './oneClickBuy/START_act';

export {
  oneClickBuy_CANCEL_act,
  oneClickBuy_START_act,
};

./workflows/worker.ts

import { Worker } from '@temporalio/worker'; //eslint-disable-line
import * as workerActivities from './activities';

async function run() {
  const worker = await Worker.create({
    taskQueue: `queue1`,
    workflowsPath: require.resolve('./workflows'),
    activities: workerActivities,
  });
  await worker.run();
}
run().catch((err) => {});

./workflows/queue1/_workflow-current.ts

// DEFAULT WORKFLOW DISABLE ESLINT RULES
/* eslint-disable no-void */
/* eslint-disable no-return-assign */
/* eslint-disable no-return-await */
// eslint-disable-next-line
import * as wf from '@temporalio/workflow';

// ACTIVITIES
import type * as activities from '../activities';
// activity configuratino and exporting variables
const { oneClickBuy_CANCEL_act, oneClickBuy_START_act } = wf.proxyActivities<typeof activities>({
  startToCloseTimeout: '1 minute',
});

// STATES
type PurchaseState = 'PURCHASE_PENDING' | 'PURCHASE_CONFIRMED' | 'PURCHASE_CANCELED';

// SIGNALS
export const cancelPurchase = wf.defineSignal('cancelPurchase');
export const purchaseStateQuery = wf.defineQuery<PurchaseState>('purchaseState');

// WORKFLOW
export async function oneClickBuy(props) {
  const { itemId } = props || {};
  const itemToBuy = itemId;
  let purchaseState: PurchaseState = 'PURCHASE_PENDING';

  // ADD HANDLERS < called with: await workflow.signal('cancelPurchase');
  wf.setHandler(cancelPurchase, () => void (purchaseState = 'PURCHASE_CANCELED'));
  wf.setHandler(purchaseStateQuery, () => purchaseState);

  // WORKFLOW CODE
  if (await wf.condition(() => purchaseState === 'PURCHASE_CANCELED', '5s')) {
    return await oneClickBuy_CANCEL_act(itemToBuy);
  }
  purchaseState = 'PURCHASE_CONFIRMED';
  return await oneClickBuy_START_act(itemToBuy);
}

./workflows/queue1/CANCEL_act.ts

export async function oneClickBuy_CANCEL_act(itemId: string): Promise<string> {
  return `canceled purchase ${itemId}!`;
}

./workflows/queue1/CANCEL_api.ts

// eslint-disable-next-line
import { Connection, WorkflowClient } from '@temporalio/client';

export default async function oneClickBuy_CANCEL_api({ req, res }) {
  const { id } = req?.query || {};
  if (!id) {
    res.status(405).send({ message: 'must send workflow id to cancel' });
    return;
  }

  try {
    const connection = new Connection({ address: process?.env?.TEMPORAL_SERVER || 'http://localhost:7233' });
    const client = new WorkflowClient(connection.service, { namespace: 'default' });
    const workflow = client.getHandle(id);
    await workflow.signal('cancelPurchase');

    res.status(200).json({ cancelled: id });
  } catch (e: any) {
    res.status(500).send({ message: e?.details, errorCode: e?.code });
  }
}

./workflows/queue1/GETSTATE_api.ts

// eslint-disable-next-line
import { Connection, WorkflowClient } from '@temporalio/client';

export default async function oneClickBuy_GETSTATE_api({ req, res }) {
  const { id } = req?.query || {};
  // console.log({ id });
  if (!id) {
    res.status(405).send({ message: 'must send workflow id to query' });
    return;
  }

  try {
    const connection = new Connection({ address: process?.env?.TEMPORAL_SERVER || 'http://localhost:7233' });
    const client = new WorkflowClient(connection.service, { namespace: 'default' });
    const workflow = client.getHandle(id);
    const purchaseState = await workflow.query('purchaseState');

    res.status(200).json({ purchaseState });
  } catch (e: any) {
    res.status(500).send({ message: e?.details, errorCode: e?.code });
  }
}

./workflows/queue1/CANCEL_act.ts

export async function oneClickBuy_START_act(itemId: string): Promise<string> {
  return `checking out ${itemId}!`;
}

./workflows/queue1/CANCEL_act.ts

// eslint-disable-next-line
import { Connection, WorkflowClient } from '@temporalio/client';
import { oneClickBuy as wtf } from './_workflow-current';

export default async function oneClickBuy_START_api({ req, res }) {
  if (req.method !== 'POST') {
    res.status(405).send({ message: 'Only POST requests allowed' });
    return;
  }
  const { itemId, transactionId } = req.body;
  if (!itemId) {
    res.status(405).send({ message: 'must send itemId to buy' });
    return;
  }

  const connection = new Connection({ address: 'localhost:7233' });
  const client = new WorkflowClient(connection.service, {
    namespace: 'default',
  });
  await client
    .start(wtf, {
      taskQueue: 'queue1',
      workflowId: transactionId,
      args: [{ itemId }], // only add params inside object, first arr element
    })
    .then((r) => {
      // console.log({ r });
    })
    .catch((e) => {
      // REPORT TO SENTRY HERE
      // console.log({ e });
    });

  res.status(200).json({ ok: true });
}

ADDITIONAL FILES NEEDED

./docker-compose-temporal.yml

#
#
#    docker-compose -f ./docker-compose-temporal.yml up -d
#    docker-compose -f ./docker-compose-temporal.yml down
#
#
version: "3.5"
services:
  postgresql:
    container_name: temporal-postgresql
    environment:
      POSTGRES_PASSWORD: temporal
      POSTGRES_USER: temporal
    image: postgres:13
    networks:
      - temporal-network
    ports:
      - 5432:5432
  temporal:
    container_name: temporal
    depends_on:
      - postgresql
      - elasticsearch
    environment:
      - DB=postgresql
      - DB_PORT=5432
      - POSTGRES_USER=temporal
      - POSTGRES_PWD=temporal
      - POSTGRES_SEEDS=postgresql
      - DYNAMIC_CONFIG_FILE_PATH=config/.docker-compose/temporal-dev-es.yaml
      - ENABLE_ES=true
      - ES_SEEDS=elasticsearch
      - ES_VERSION=v7
    image: temporalio/auto-setup:1.14.0
    networks:
      - temporal-network
    ports:
      - 7233:7233
    volumes:
      - ./.docker-compose:/etc/temporal/config/.docker-compose
  temporal-admin-tools:
    container_name: temporal-admin-tools
    depends_on:
      - temporal
    environment:
      - TEMPORAL_CLI_ADDRESS=temporal:7233
    image: temporalio/admin-tools:1.14.0
    networks:
      - temporal-network
    stdin_open: true
    tty: true
  temporal-web:
    container_name: temporal-web
    depends_on:
      - temporal
    environment:
      - TEMPORAL_GRPC_ENDPOINT=temporal:7233
      - TEMPORAL_PERMIT_WRITE_API=true
    image: temporalio/web:1.13.0
    networks:
      - temporal-network
    ports:
      - 8088:8088
  elasticsearch:
    container_name: temporal-elasticsearch
    environment:
      - cluster.routing.allocation.disk.threshold_enabled=true
      - cluster.routing.allocation.disk.watermark.low=512mb
      - cluster.routing.allocation.disk.watermark.high=256mb
      - cluster.routing.allocation.disk.watermark.flood_stage=128mb
      - discovery.type=single-node
      - ES_JAVA_OPTS=-Xms100m -Xmx100m
    image: elasticsearch:7.10.1
    networks:
      - temporal-network
    ports:
      - 9200:9200
networks:
  temporal-network:
    driver: bridge
    name: temporal-network

./.docker-compose/temporal-dev-es.yaml

frontend.enableClientVersionCheck:
- value: true
  constraints: {}
history.persistenceMaxQPS:
- value: 3000
  constraints: {}
frontend.persistenceMaxQPS:
- value: 3000
  constraints: {}
frontend.historyMgrNumConns:
- value: 10
  constraints: {}
frontend.throttledLogRPS:
- value: 20
  constraints: {}
history.historyMgrNumConns:
- value: 50
  constraints: {}
history.defaultActivityRetryPolicy:
- value:
    InitialIntervalInSeconds: 1
    MaximumIntervalCoefficient: 100.0
    BackoffCoefficient: 2.0
    MaximumAttempts: 0
history.defaultWorkflowRetryPolicy:
- value:
    InitialIntervalInSeconds: 1
    MaximumIntervalCoefficient: 100.0
    BackoffCoefficient: 2.0
    MaximumAttempts: 0
system.advancedVisibilityWritingMode:
  - value: "on"
    constraints: {}
system.enableReadVisibilityFromES:
  - value: true
    constraints: {}

./docker-compose/temporal-dev.yaml

frontend.enableClientVersionCheck:
- value: true
  constraints: {}
history.persistenceMaxQPS:
- value: 3000
  constraints: {}
frontend.persistenceMaxQPS:
- value: 3000
  constraints: {}
frontend.historyMgrNumConns:
- value: 10
  constraints: {}
frontend.throttledLogRPS:
- value: 20
  constraints: {}
history.historyMgrNumConns:
- value: 50
  constraints: {}
history.defaultActivityRetryPolicy:
- value:
    InitialIntervalInSeconds: 1
    MaximumIntervalCoefficient: 100.0
    BackoffCoefficient: 2.0
    MaximumAttempts: 0
history.defaultWorkflowRetryPolicy:
- value:
    InitialIntervalInSeconds: 1
    MaximumIntervalCoefficient: 100.0
    BackoffCoefficient: 2.0
    MaximumAttempts: 0
system.advancedVisibilityWritingMode:
  - value: "off"
    constraints: {}

[ Documentation request ] Better workflowId generator

Brief description

I suggest not using random * 1000 to generate workflow IDs in the documentation and sample code. For example:

workflowId: 'wf-id-' + Math.floor(Math.random() * 1000),

This appears in two samples and a blog:

In only one instance is there a disclaimer comment:

// in practice, use a meaningful business id, eg customerId or transactionId

Note that these IDs are required to be unique among open workflow executions in the same namespace.

Calculating the odds of a collision is solving the generalized birthday problem. With 1000 IDs to choose from, there's a 50% chance of a collision after generating 38 IDs, and a greater than 99% chance of collision after generating 100 IDs. (Assuming random is random.)

Your recommended content

  1. I think the disclaimer should always be present.
  2. If an ID generator is used in these samples, I suggest using something better than random * 1000, as I expect this snippet will end up being copied further. Use NanoID, UUID, or similar? Or just 'my-business-id'?

[Feature Request] Speed up project creation time

Is your feature request related to a problem? Please describe.

Slow speed of time npx @temporalio/create@latest test -s hello-world

Describe the solution you'd like

In hello-world/, time npm i --prefer-online takes 8s with a package-lock and 19s without, on gigabit ethernet. So first step is add package-lock files to each sample? Anything we can do beyond that?

[Feature Request] Add NextJS ESM sample

Is your feature request related to a problem? Please describe.

Not being able to use NextJS and Temporal and ES modules from NPM. User feedback: https://temporalio.slack.com/archives/C01DKSMU94L/p1642900509072000?thread_ts=1642896199.071100&cid=C01DKSMU94L

Describe the solution you'd like

Once NextJS supports type: "module", create a sample combining NextJS with our fetch-esm sample.

Additional context

NextJS recently added support for importing ES modules from NPM, but it doesn't appear to support having "type": "module", in the package.json. When I tried, the Temporal part works fine, but next build fails:

https://github.com/lorensr/next.js/tree/58fc36e0166e6479c810e2f57ab9c101c3ff66f0/examples/with-temporal

git clone https://github.com/lorensr/next.js.git
cd next.js/examples/with-temporal
git checkout 58fc36e01
npm i
npm run build
error: require() of ES Module is not supported
$ npm run build

> build
> next build

info  - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5
info  - Checking validity of types  
warn  - The Next.js plugin was not detected in your ESLint configuration. See https://nextjs.org/docs/basic-features/eslint#migrating-existing-config
info  - Creating an optimized production build  
info  - Compiled successfully
info  - Collecting page data ..node:internal/process/promises:246
          triggerUncaughtException(err, true /* fromPromise */);
          ^

Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/me/gh/next.js/examples/with-temporal/.next/server/pages/_document.js from /Users/me/gh/next.js/examples/with-temporal/node_modules/next/dist/server/require.js not supported.
_document.js is treated as an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which declares all .js files in that package scope as ES modules.
Instead rename _document.js to end in .cjs, change the requiring code to use dynamic import() which is available in all CommonJS modules, or change "type": "module" to "type": "commonjs" in /Users/me/gh/next.js/examples/with-temporal/package.json to treat all .js files as CommonJS (using .mjs for all ES modules instead).

    at Object.requirePage (/Users/me/gh/next.js/examples/with-temporal/node_modules/next/dist/server/require.js:47:12)
    at Object.loadComponents (/Users/me/gh/next.js/examples/with-temporal/node_modules/next/dist/server/load-components.js:47:45)
    at Object.getNamedExports (/Users/me/gh/next.js/examples/with-temporal/node_modules/next/dist/build/utils.js:652:51)
    at execFunction (/Users/me/gh/next.js/examples/with-temporal/node_modules/jest-worker/build/workers/processChild.js:145:17)
    at execHelper (/Users/me/gh/next.js/examples/with-temporal/node_modules/jest-worker/build/workers/processChild.js:124:5)
    at execMethod (/Users/me/gh/next.js/examples/with-temporal/node_modules/jest-worker/build/workers/processChild.js:128:5)
    at process.messageListener (/Users/me/gh/next.js/examples/with-temporal/node_modules/jest-worker/build/workers/processChild.js:46:7)
    at process.emit (node:events:390:28) {
  type: 'Error',
  code: 'ERR_REQUIRE_ESM'
}

lerna-4.0.0.tgz: 2 vulnerabilities (highest severity is: 9.8) - autoclosed

Vulnerable Library - lerna-4.0.0.tgz

Path to dependency file: /package.json

Path to vulnerable library: /node_modules/node-fetch/package.json

Found in HEAD commit: 3b9bae980eb794fab08e5addef96e9ace5acb327

Vulnerabilities

CVE Severity CVSS Dependency Type Fixed in Remediation Available
CVE-2021-3918 High 9.8 json-schema-0.2.3.tgz Transitive 5.0.0-alpha.0
CVE-2022-0235 Medium 6.1 node-fetch-2.6.1.tgz Transitive N/A

Details

CVE-2021-3918

Vulnerable Library - json-schema-0.2.3.tgz

JSON Schema validation and specifications

Library home page: https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz

Path to dependency file: /package.json

Path to vulnerable library: /node_modules/json-schema/package.json

Dependency Hierarchy:

  • lerna-4.0.0.tgz (Root Library)
    • bootstrap-4.0.0.tgz
      • run-lifecycle-4.0.0.tgz
        • npm-lifecycle-3.1.5.tgz
          • node-gyp-5.1.1.tgz
            • request-2.88.2.tgz
              • http-signature-1.2.0.tgz
                • jsprim-1.4.1.tgz
                  • json-schema-0.2.3.tgz (Vulnerable Library)

Found in HEAD commit: 3b9bae980eb794fab08e5addef96e9ace5acb327

Found in base branch: main

Vulnerability Details

json-schema is vulnerable to Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')

Publish Date: 2021-11-13

URL: CVE-2021-3918

CVSS 3 Score Details (9.8)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: None
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: High
    • Integrity Impact: High
    • Availability Impact: High

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: https://nvd.nist.gov/vuln/detail/CVE-2021-3918

Release Date: 2021-11-13

Fix Resolution (json-schema): 0.4.0

Direct dependency fix Resolution (lerna): 5.0.0-alpha.0

⛑️ Automatic Remediation is available for this issue

CVE-2022-0235

Vulnerable Library - node-fetch-2.6.1.tgz

A light-weight module that brings window.fetch to node.js

Library home page: https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz

Path to dependency file: /package.json

Path to vulnerable library: /node_modules/node-fetch/package.json

Dependency Hierarchy:

  • lerna-4.0.0.tgz (Root Library)
    • version-4.0.0.tgz
      • gitlab-client-4.0.0.tgz
        • node-fetch-2.6.1.tgz (Vulnerable Library)

Found in HEAD commit: 3b9bae980eb794fab08e5addef96e9ace5acb327

Found in base branch: main

Vulnerability Details

node-fetch is vulnerable to Exposure of Sensitive Information to an Unauthorized Actor

Publish Date: 2022-01-16

URL: CVE-2022-0235

CVSS 3 Score Details (6.1)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: Required
    • Scope: Changed
  • Impact Metrics:
    • Confidentiality Impact: Low
    • Integrity Impact: Low
    • Availability Impact: None

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: GHSA-r683-j2x4-v87g

Release Date: 2022-01-16

Fix Resolution: node-fetch - 2.6.7,3.1.1


⛑️ Automatic Remediation is available for this issue.

zx-4.3.0.tgz: 1 vulnerabilities (highest severity is: 6.1) - autoclosed

Vulnerable Library - zx-4.3.0.tgz

Path to dependency file: /package.json

Path to vulnerable library: /node_modules/node-fetch/package.json

Found in HEAD commit: 94666f806607c87d31196797cba5ddadc18ba8bb

Vulnerabilities

CVE Severity CVSS Dependency Type Fixed in Remediation Available
CVE-2022-0235 Medium 6.1 node-fetch-2.6.1.tgz Transitive 5.0.0

Details

CVE-2022-0235

Vulnerable Library - node-fetch-2.6.1.tgz

A light-weight module that brings window.fetch to node.js

Library home page: https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz

Path to dependency file: /package.json

Path to vulnerable library: /node_modules/node-fetch/package.json

Dependency Hierarchy:

  • zx-4.3.0.tgz (Root Library)
    • node-fetch-2.6.1.tgz (Vulnerable Library)

Found in HEAD commit: 94666f806607c87d31196797cba5ddadc18ba8bb

Found in base branch: main

Vulnerability Details

node-fetch is vulnerable to Exposure of Sensitive Information to an Unauthorized Actor

Publish Date: 2022-01-16

URL: CVE-2022-0235

CVSS 3 Score Details (6.1)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: Required
    • Scope: Changed
  • Impact Metrics:
    • Confidentiality Impact: Low
    • Integrity Impact: Low
    • Availability Impact: None

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: GHSA-r683-j2x4-v87g

Release Date: 2022-01-16

Fix Resolution (node-fetch): 2.6.7

Direct dependency fix Resolution (zx): 5.0.0

⛑️ Automatic Remediation is available for this issue


⛑️ Automatic Remediation is available for this issue.

[Bug] cancellation works?

Describe the bug

The cancellation sample works now?

Despite the disclaimer in its README, I can build and run it, and it prints "Cancelled workflow successfully".

However, the Web UI has a problem reporting the cancelled result:

{
  "message": "Right-hand side of 'instanceof' is not an object",
  "source": "",
  "stackTrace": "TypeError: Right-hand side of 'instanceof' is not an object\n    at Object.main (workflow-isolate:83472:16)",
  "cause": null,
  "applicationFailureInfo": {
    "type": "TypeError",
    "nonRetryable": false,
    "details": null
  },
  "failureInfo": "applicationFailureInfo"
}

I can't locate an open issue for cancellation, nor an issue regarding the TypeError above.

To Reproduce

  1. Make sure the Temporal Server is running locally. Follow the Quick install guide to do that.
  2. Run npm install to install dependencies
  3. Run npm start to start the worker. Leave the worker process running.
  4. Run npm run schedule-workflow to start the example

Expected behavior

Should print out "Cancelled workflow successfully"

[Bug] Otel example seems broken (at least on Gitpod)

When trying to run the interceptors-opentelemetry example on Gitpod I'm getting the following error (the hello-world example works):

image

Error: Webpack stats has errors
    at /workspace/samples-node/interceptors-opentelemetry/node_modules/@temporalio/worker/src/isolate-builder.ts:172:20
    at finalCallback (/workspace/samples-node/interceptors-opentelemetry/node_modules/webpack/lib/Compiler.js:434:32)
    at /workspace/samples-node/interceptors-opentelemetry/node_modules/webpack/lib/Compiler.js:498:17
    at /workspace/samples-node/interceptors-opentelemetry/node_modules/webpack/lib/HookWebpackError.js:68:3
    at Hook.eval [as callAsync] (eval at create (/workspace/samples-node/interceptors-opentelemetry/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/workspace/samples-node/interceptors-opentelemetry/node_modules/tapable/lib/Hook.js:18:14)
    at Cache.storeBuildDependencies (/workspace/samples-node/interceptors-opentelemetry/node_modules/webpack/lib/Cache.js:122:37)
    at /workspace/samples-node/interceptors-opentelemetry/node_modules/webpack/lib/Compiler.js:494:19
    at Hook.eval [as callAsync] (eval at create (/workspace/samples-node/interceptors-opentelemetry/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/workspace/samples-node/interceptors-opentelemetry/node_modules/tapable/lib/Hook.js:18:14)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

[Feature Request] Unique Task Queue Names for samples

Is your feature request related to a problem? Please describe.

Some of the samples have the same task-queue name. This can result in non-obvious workflow failures where multiple workers are subscribed to a task queue, but do not have the proper workflows and activities registered to handle the task pulled from the queue.

Describe the solution you'd like

Tihomir in slack suggested I open this issue to provide unique task queue names for each sample to prevent this error.

Additional context

I have already created a new branch, added unique task queue names to each of the samples, and have tested each. I am unable to contribute due to permissions, but would be happy to do so.

[Bug] devcontainer not running appropriately

What are you really trying to do?

First of all, thanks for this awesome repository to test Temporal.
That said, I'm trying to run the hello-world sample via VSCode devcontainer.

Describe the bug

Not sure if this is a bug but I cannot view the workflow from the temporal UI. First of all, there's probably a typo in the docker-compose.yml where it says depends_on: temporal here:

I assume this should be temporalite. After editing this, the devcontainer spins up and I can access the temporal UI.

Unfortuantely, a 500 Internal Server Error keeps on showing up in the UI.

image

If I look at the logs for the temporalite container, I see some errors happening as follows:

{"level":"debug","ts":"2022-01-20T13:03:55.542Z","msg":"Poll workflow task queue.","service":"frontend","wf-namespace":"temporal-system","wf-namespace-id":"32049b68-7872-4094-8e63-d0dd59896a83","logging-call-at":"workflowHandler.go:777"}
{"level":"debug","ts":"2022-01-20T13:03:55.544Z","msg":"Received PollWorkflowTaskQueue for taskQueue","service":"matching","component":"matching-engine","wf-task-queue-name":"125f23ab927c:69aa0d3b-a789-4202-9578-a054269db107","logging-call-at":"matchingEngine.go:349"}
{"level":"error","ts":"2022-01-20T13:03:56.850Z","msg":"Panic is captured","service":"frontend","sys-stack-trace":"goroutine 416646 [running]:\nruntime/debug.Stack()\n\t/usr/local/go/src/runtime/debug/stack.go:24 +0x65\ngo.temporal.io/server/common/log.CapturePanic({0x384e078, 0xc0009c7a10}, 0xc00142aba8)\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/log/panic.go:49 +0x8e\npanic({0x2101780, 0xc000043560})\n\t/usr/local/go/src/runtime/panic.go:1038 +0x215\ngo.temporal.io/server/common/persistence/visibility/store/standard.(*valuesInterceptor).Values(0xc0026146a8, {0xc000492d50, 0x382a3d0}, {0xc0024ff140, 0x0, 0x0})\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/persistence/visibility/store/standard/query_interceptors.go:109 +0x8de\ngo.temporal.io/server/common/persistence/visibility/store/query.(*comparisonExprConverter).Convert(0xc0018fc450, {0x382a440, 0xc0013f1b80})\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/persistence/visibility/store/query/converter.go:444 +0x207\ngo.temporal.io/server/common/persistence/visibility/store/query.(*WhereConverter).Convert(0x0, {0x382a440, 0xc0013f1b80})\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/persistence/visibility/store/query/converter.go:265 +0x1da\ngo.temporal.io/server/common/persistence/visibility/store/query.(*Converter).convertSelect(0xc00228e160, 0xc0018add40)\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/persistence/visibility/store/query/converter.go:227 +0x7f\ngo.temporal.io/server/common/persistence/visibility/store/query.(*Converter).ConvertSql(0x22a81a9, {0xc000a00500, 0xc000efc970})\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/persistence/visibility/store/query/converter.go:213 +0x5f\ngo.temporal.io/server/common/persistence/visibility/store/query.(*Converter).ConvertWhereOrderBy(0x4a4d901, {0xc0013ddaa0, 0x1a42abc})\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/persistence/visibility/store/query/converter.go:198 +0xdc\ngo.temporal.io/server/common/persistence/visibility/store/standard.(*converter).GetFilter(0xc0024ff0e0, {0xc0013ddaa0, 0x9a2785f37d})\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/persistence/visibility/store/standard/converter.go:70 +0x2d\ngo.temporal.io/server/common/persistence/visibility/store/standard.(*standardStore).ListWorkflowExecutions(0xc0008882e0, 0xc0018be5a0)\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/persistence/visibility/store/standard/visibility_store.go:128 +0x3c\ngo.temporal.io/server/common/persistence/visibility.(*visibilityManagerImpl).ListWorkflowExecutions(0xc000077d60, 0x43)\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/persistence/visibility/visibility_manager_impl.go:181 +0x29\ngo.temporal.io/server/common/persistence/visibility.(*visibilityManagerRateLimited).ListWorkflowExecutions(0xc000886960, 0x50)\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/persistence/visibility/visibility_manager_rate_limited.go:144 +0x4a\ngo.temporal.io/server/common/persistence/visibility.(*visibilityManagerMetrics).ListWorkflowExecutions(0xc00088c300, 0xc000492bc0)\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/persistence/visibility/visiblity_manager_metrics.go:147 +0x5b\ngo.temporal.io/server/service/frontend.(*WorkflowHandler).ListWorkflowExecutions(0xc0007e3d40, {0x3829870, 0xc0018fc030}, 0xc0013f14c0)\n\t/go/pkg/mod/go.temporal.io/[email protected]/service/frontend/workflowHandler.go:2275 +0x422\ngo.temporal.io/server/service/frontend.(*DCRedirectionHandlerImpl).ListWorkflowExecutions.func2({0x22823d8, 0x6})\n\t/go/pkg/mod/go.temporal.io/[email protected]/service/frontend/dcRedirectionHandler.go:405 +0x14c\ngo.temporal.io/server/service/frontend.(*NoopRedirectionPolicy).WithNamespaceRedirect(0xc0006730e0, {0xc000efcce8, 0x1145dcc}, {0x8, 0xc000efcce0}, {0x0, 0xf58}, 0x0)\n\t/go/pkg/mod/go.temporal.io/[email protected]/service/frontend/dcRedirectionPolicy.go:118 +0x26\ngo.temporal.io/server/service/frontend.(*DCRedirectionHandlerImpl).ListWorkflowExecutions(0xc0006730e0, {0x3829870, 0xc0018fc030}, 0xc0013f14c0)\n\t/go/pkg/mod/go.temporal.io/[email protected]/service/frontend/dcRedirectionHandler.go:401 +0x2d9\ngo.temporal.io/api/workflowservice/v1._WorkflowService_ListWorkflowExecutions_Handler.func1({0x3829870, 0xc0018fc030}, {0x21cac40, 0xc0013f14c0})\n\t/go/pkg/mod/go.temporal.io/[email protected]/workflowservice/v1/service.pb.go:1482 +0x7b\ngo.temporal.io/server/common/authorization.(*interceptor).Interceptor(0xc0007eea50, {0x3829870, 0xc0018fc030}, {0x21cac40, 0xc0013f14c0}, 0xc00228e060, 0xc002614438)\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/authorization/interceptor.go:152 +0x637\ngoogle.golang.org/grpc.chainUnaryInterceptors.func1.1({0x3829870, 0xc0018fc030}, {0x21cac40, 0xc0013f14c0})\n\t/go/pkg/mod/google.golang.org/[email protected]/server.go:1116 +0x5b\ngo.temporal.io/server/common/rpc/interceptor.(*NamespaceCountLimitInterceptor).Intercept(0xc000717800, {0x3829870, 0xc0018fc030}, {0x21cac40, 0xc0013f14c0}, 0x16, 0xc0013f1500)\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/rpc/interceptor/namespace_count_limit.go:98 +0x1e3\ngoogle.golang.org/grpc.chainUnaryInterceptors.func1.1({0x3829870, 0xc0018fc030}, {0x21cac40, 0xc0013f14c0})\n\t/go/pkg/mod/google.golang.org/[email protected]/server.go:1119 +0x83\ngo.temporal.io/server/common/rpc/interceptor.(*NamespaceRateLimitInterceptor).Intercept(0xc000882b10, {0x3829870, 0xc0018fc030}, {0x21cac40, 0xc0013f14c0}, 0x23171e5, 0xc0013f1500)\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/rpc/interceptor/namespace_rate_limit.go:88 +0x1fa\ngoogle.golang.org/grpc.chainUnaryInterceptors.func1.1({0x3829870, 0xc0018fc030}, {0x21cac40, 0xc0013f14c0})\n\t/go/pkg/mod/google.golang.org/[email protected]/server.go:1119 +0x83\ngo.temporal.io/server/common/rpc/interceptor.(*RateLimitInterceptor).Intercept(0xc00081cd38, {0x3829870, 0xc0018fc030}, {0x21cac40, 0xc0013f14c0}, 0x46, 0xc0013f1500)\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/rpc/interceptor/rate_limit.go:83 +0x1a5\ngoogle.golang.org/grpc.chainUnaryInterceptors.func1.1({0x3829870, 0xc0018fc030}, {0x21cac40, 0xc0013f14c0})\n\t/go/pkg/mod/google.golang.org/[email protected]/server.go:1119 +0x83\ngo.temporal.io/server/common/rpc/interceptor.(*NamespaceValidatorInterceptor).Intercept(0x380f3e8, {0x3829870, 0xc0018fc030}, {0x21cac40, 0xc0013f14c0}, 0xc00228e060, 0xc0013f1500)\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/rpc/interceptor/namespace_validator.go:113 +0xc6\ngoogle.golang.org/grpc.chainUnaryInterceptors.func1.1({0x3829870, 0xc0018fc030}, {0x21cac40, 0xc0013f14c0})\n\t/go/pkg/mod/google.golang.org/[email protected]/server.go:1119 +0x83\ngo.temporal.io/server/common/rpc/interceptor.(*TelemetryInterceptor).Intercept(0x0, {0x3829870, 0xc0008c1c80}, {0x21cac40, 0xc0013f14c0}, 0x20e1540, 0xc0013f1500)\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/rpc/interceptor/telemetry.go:108 +0x22e\ngoogle.golang.org/grpc.chainUnaryInterceptors.func1.1({0x3829870, 0xc0008c1c80}, {0x21cac40, 0xc0013f14c0})\n\t/go/pkg/mod/google.golang.org/[email protected]/server.go:1119 +0x83\ngo.temporal.io/server/common/metrics.NewServerMetricsContextInjectorInterceptor.func1({0x3829870, 0xc0008c1c50}, {0x21cac40, 0xc0013f14c0}, 0xc001b73fc8, 0xc0013f1500)\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/metrics/grpc.go:66 +0x7c\ngoogle.golang.org/grpc.chainUnaryInterceptors.func1.1({0x3829870, 0xc0008c1c50}, {0x21cac40, 0xc0013f14c0})\n\t/go/pkg/mod/google.golang.org/[email protected]/server.go:1119 +0x83\ngo.temporal.io/server/common/rpc.ServiceErrorInterceptor({0x3829870, 0xc0008c1c50}, {0x21cac40, 0xc0013f14c0}, 0x4ddc20, 0xc001068778)\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/rpc/grpc.go:131 +0x34\ngoogle.golang.org/grpc.chainUnaryInterceptors.func1.1({0x3829870, 0xc0008c1c50}, {0x21cac40, 0xc0013f14c0})\n\t/go/pkg/mod/google.golang.org/[email protected]/server.go:1119 +0x83\ngo.temporal.io/server/common/rpc/interceptor.(*NamespaceLogInterceptor).Intercept(0x100000000000000, {0x3829870, 0xc0008c1c50}, {0x21cac40, 0xc0013f14c0}, 0x40, 0xc00005cc00)\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/rpc/interceptor/namespace_logger.go:84 +0x74f\ngoogle.golang.org/grpc.chainUnaryInterceptors.func1.1({0x3829870, 0xc0008c1c50}, {0x21cac40, 0xc0013f14c0})\n\t/go/pkg/mod/google.golang.org/[email protected]/server.go:1119 +0x83\ngoogle.golang.org/grpc.chainUnaryInterceptors.func1({0x3829870, 0xc0008c1c50}, {0x21cac40, 0xc0013f14c0}, 0xc00228e060, 0xc002614438)\n\t/go/pkg/mod/google.golang.org/[email protected]/server.go:1121 +0x12b\ngo.temporal.io/api/workflowservice/v1._WorkflowService_ListWorkflowExecutions_Handler({0x22375c0, 0xc0006730e0}, {0x3829870, 0xc0008c1c50}, 0xc001c13f80, 0xc000077bc0)\n\t/go/pkg/mod/go.temporal.io/[email protected]/workflowservice/v1/service.pb.go:1484 +0x138\ngoogle.golang.org/grpc.(*Server).processUnaryRPC(0xc000499dc0, {0x386b498, 0xc002469800}, 0xc001c026c0, 0xc00095efc0, 0x497b410, 0x0)\n\t/go/pkg/mod/google.golang.org/[email protected]/server.go:1282 +0xccf\ngoogle.golang.org/grpc.(*Server).handleStream(0xc000499dc0, {0x386b498, 0xc002469800}, 0xc001c026c0, 0x0)\n\t/go/pkg/mod/google.golang.org/[email protected]/server.go:1616 +0xa2a\ngoogle.golang.org/grpc.(*Server).serveStreams.func1.2()\n\t/go/pkg/mod/google.golang.org/[email protected]/server.go:921 +0x98\ncreated by google.golang.org/grpc.(*Server).serveStreams.func1\n\t/go/pkg/mod/google.golang.org/[email protected]/server.go:919 +0x294\n","error":"runtime error: index out of range [1] with length 1","logging-call-at":"panic.go:51","stacktrace":"go.temporal.io/server/common/log.(*zapLogger).Error\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/log/zap_logger.go:142\ngo.temporal.io/server/common/log.CapturePanic\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/log/panic.go:51\nruntime.gopanic\n\t/usr/local/go/src/runtime/panic.go:1038\nruntime.goPanicIndex\n\t/usr/local/go/src/runtime/panic.go:90\ngo.temporal.io/server/common/persistence/visibility/store/standard.(*valuesInterceptor).Values\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/persistence/visibility/store/standard/query_interceptors.go:109\ngo.temporal.io/server/common/persistence/visibility/store/query.(*comparisonExprConverter).Convert\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/persistence/visibility/store/query/converter.go:444\ngo.temporal.io/server/common/persistence/visibility/store/query.(*WhereConverter).Convert\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/persistence/visibility/store/query/converter.go:265\ngo.temporal.io/server/common/persistence/visibility/store/query.(*Converter).convertSelect\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/persistence/visibility/store/query/converter.go:227\ngo.temporal.io/server/common/persistence/visibility/store/query.(*Converter).ConvertSql\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/persistence/visibility/store/query/converter.go:213\ngo.temporal.io/server/common/persistence/visibility/store/query.(*Converter).ConvertWhereOrderBy\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/persistence/visibility/store/query/converter.go:198\ngo.temporal.io/server/common/persistence/visibility/store/standard.(*converter).GetFilter\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/persistence/visibility/store/standard/converter.go:70\ngo.temporal.io/server/common/persistence/visibility/store/standard.(*standardStore).ListWorkflowExecutions\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/persistence/visibility/store/standard/visibility_store.go:128\ngo.temporal.io/server/common/persistence/visibility.(*visibilityManagerImpl).ListWorkflowExecutions\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/persistence/visibility/visibility_manager_impl.go:181\ngo.temporal.io/server/common/persistence/visibility.(*visibilityManagerRateLimited).ListWorkflowExecutions\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/persistence/visibility/visibility_manager_rate_limited.go:144\ngo.temporal.io/server/common/persistence/visibility.(*visibilityManagerMetrics).ListWorkflowExecutions\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/persistence/visibility/visiblity_manager_metrics.go:147\ngo.temporal.io/server/service/frontend.(*WorkflowHandler).ListWorkflowExecutions\n\t/go/pkg/mod/go.temporal.io/[email protected]/service/frontend/workflowHandler.go:2275\ngo.temporal.io/server/service/frontend.(*DCRedirectionHandlerImpl).ListWorkflowExecutions.func2\n\t/go/pkg/mod/go.temporal.io/[email protected]/service/frontend/dcRedirectionHandler.go:405\ngo.temporal.io/server/service/frontend.(*NoopRedirectionPolicy).WithNamespaceRedirect\n\t/go/pkg/mod/go.temporal.io/[email protected]/service/frontend/dcRedirectionPolicy.go:118\ngo.temporal.io/server/service/frontend.(*DCRedirectionHandlerImpl).ListWorkflowExecutions\n\t/go/pkg/mod/go.temporal.io/[email protected]/service/frontend/dcRedirectionHandler.go:401\ngo.temporal.io/api/workflowservice/v1._WorkflowService_ListWorkflowExecutions_Handler.func1\n\t/go/pkg/mod/go.temporal.io/[email protected]/workflowservice/v1/service.pb.go:1482\ngo.temporal.io/server/common/authorization.(*interceptor).Interceptor\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/authorization/interceptor.go:152\ngoogle.golang.org/grpc.chainUnaryInterceptors.func1.1\n\t/go/pkg/mod/google.golang.org/[email protected]/server.go:1116\ngo.temporal.io/server/common/rpc/interceptor.(*NamespaceCountLimitInterceptor).Intercept\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/rpc/interceptor/namespace_count_limit.go:98\ngoogle.golang.org/grpc.chainUnaryInterceptors.func1.1\n\t/go/pkg/mod/google.golang.org/[email protected]/server.go:1119\ngo.temporal.io/server/common/rpc/interceptor.(*NamespaceRateLimitInterceptor).Intercept\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/rpc/interceptor/namespace_rate_limit.go:88\ngoogle.golang.org/grpc.chainUnaryInterceptors.func1.1\n\t/go/pkg/mod/google.golang.org/[email protected]/server.go:1119\ngo.temporal.io/server/common/rpc/interceptor.(*RateLimitInterceptor).Intercept\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/rpc/interceptor/rate_limit.go:83\ngoogle.golang.org/grpc.chainUnaryInterceptors.func1.1\n\t/go/pkg/mod/google.golang.org/[email protected]/server.go:1119\ngo.temporal.io/server/common/rpc/interceptor.(*NamespaceValidatorInterceptor).Intercept\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/rpc/interceptor/namespace_validator.go:113\ngoogle.golang.org/grpc.chainUnaryInterceptors.func1.1\n\t/go/pkg/mod/google.golang.org/[email protected]/server.go:1119\ngo.temporal.io/server/common/rpc/interceptor.(*TelemetryInterceptor).Intercept\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/rpc/interceptor/telemetry.go:108\ngoogle.golang.org/grpc.chainUnaryInterceptors.func1.1\n\t/go/pkg/mod/google.golang.org/[email protected]/server.go:1119\ngo.temporal.io/server/common/metrics.NewServerMetricsContextInjectorInterceptor.func1\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/metrics/grpc.go:66\ngoogle.golang.org/grpc.chainUnaryInterceptors.func1.1\n\t/go/pkg/mod/google.golang.org/[email protected]/server.go:1119\ngo.temporal.io/server/common/rpc.ServiceErrorInterceptor\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/rpc/grpc.go:131\ngoogle.golang.org/grpc.chainUnaryInterceptors.func1.1\n\t/go/pkg/mod/google.golang.org/[email protected]/server.go:1119\ngo.temporal.io/server/common/rpc/interceptor.(*NamespaceLogInterceptor).Intercept\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/rpc/interceptor/namespace_logger.go:84\ngoogle.golang.org/grpc.chainUnaryInterceptors.func1.1\n\t/go/pkg/mod/google.golang.org/[email protected]/server.go:1119\ngoogle.golang.org/grpc.chainUnaryInterceptors.func1\n\t/go/pkg/mod/google.golang.org/[email protected]/server.go:1121\ngo.temporal.io/api/workflowservice/v1._WorkflowService_ListWorkflowExecutions_Handler\n\t/go/pkg/mod/go.temporal.io/[email protected]/workflowservice/v1/service.pb.go:1484\ngoogle.golang.org/grpc.(*Server).processUnaryRPC\n\t/go/pkg/mod/google.golang.org/[email protected]/server.go:1282\ngoogle.golang.org/grpc.(*Server).handleStream\n\t/go/pkg/mod/google.golang.org/[email protected]/server.go:1616\ngoogle.golang.org/grpc.(*Server).serveStreams.func1.2\n\t/go/pkg/mod/google.golang.org/[email protected]/server.go:921"}
{"level":"error","ts":"2022-01-20T13:03:56.851Z","msg":"uncategorized error","operation":"ListWorkflowExecutions","wf-namespace":"default","error":"runtime error: index out of range [1] with length 1","logging-call-at":"telemetry.go:190","stacktrace":"go.temporal.io/server/common/log.(*zapLogger).Error\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/log/zap_logger.go:142\ngo.temporal.io/server/common/rpc/interceptor.(*TelemetryInterceptor).handleError\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/rpc/interceptor/telemetry.go:190\ngo.temporal.io/server/common/rpc/interceptor.(*TelemetryInterceptor).Intercept\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/rpc/interceptor/telemetry.go:117\ngoogle.golang.org/grpc.chainUnaryInterceptors.func1.1\n\t/go/pkg/mod/google.golang.org/[email protected]/server.go:1119\ngo.temporal.io/server/common/metrics.NewServerMetricsContextInjectorInterceptor.func1\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/metrics/grpc.go:66\ngoogle.golang.org/grpc.chainUnaryInterceptors.func1.1\n\t/go/pkg/mod/google.golang.org/[email protected]/server.go:1119\ngo.temporal.io/server/common/rpc.ServiceErrorInterceptor\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/rpc/grpc.go:131\ngoogle.golang.org/grpc.chainUnaryInterceptors.func1.1\n\t/go/pkg/mod/google.golang.org/[email protected]/server.go:1119\ngo.temporal.io/server/common/rpc/interceptor.(*NamespaceLogInterceptor).Intercept\n\t/go/pkg/mod/go.temporal.io/[email protected]/common/rpc/interceptor/namespace_logger.go:84\ngoogle.golang.org/grpc.chainUnaryInterceptors.func1.1\n\t/go/pkg/mod/google.golang.org/[email protected]/server.go:1119\ngoogle.golang.org/grpc.chainUnaryInterceptors.func1\n\t/go/pkg/mod/google.golang.org/[email protected]/server.go:1121\ngo.temporal.io/api/workflowservice/v1._WorkflowService_ListWorkflowExecutions_Handler\n\t/go/pkg/mod/go.temporal.io/[email protected]/workflowservice/v1/service.pb.go:1484\ngoogle.golang.org/grpc.(*Server).processUnaryRPC\n\t/go/pkg/mod/google.golang.org/[email protected]/server.go:1282\ngoogle.golang.org/grpc.(*Server).handleStream\n\t/go/pkg/mod/google.golang.org/[email protected]/server.go:1616\ngoogle.golang.org/grpc.(*Server).serveStreams.func1.2\n\t/go/pkg/mod/google.golang.org/[email protected]/server.go:921"}
{"level":"debug","ts":"2022-01-20T13:03:59.956Z","msg":"Membership heartbeat upserted successfully","service":"worker","address":"127.0.0.1","port":7336,"hostId":"e2af5f56-79ef-11ec-807a-0242ac120002","logging-call-at":"rpMonitor.go:163"}
{"level":"debug","ts":"2022-01-20T13:03:59.972Z","msg":"Membership heartbeat upserted successfully","service":"frontend","address":"127.0.0.1","port":7333,"hostId":"e2ac9b94-79ef-11ec-807a-0242ac120002","logging-call-at":"rpMonitor.go:163"}

If I start a worker with npm start in the hello-world sample, it seems to spin up and have a state of RUNNING. Here is the output:

2022-01-20T12:55:35.292Z [INFO] webpack 5.66.0 compiled successfully in 2708 ms
2022-01-20T12:55:35.294Z [INFO] Workflow bundle created { size: '0.47MB' }
2022-01-20T12:55:36.140Z [INFO] Worker state changed { state: 'RUNNING' }

And if I run a workflow, it seems to be registered correctly, too:

$ npm run workflow

> [email protected] workflow
> ts-node src/client.ts

Started workflow wf-id-132

So I'm thinking it's only the UI that has the problem? I couldn't come up with anything after this so have decided to post an issue.

Minimal Reproduction

  1. fix the typo mentioned above (temporal -> temporalite)
  2. spin up the repository with VSCode devcontainer
  3. go to the hello-world sample
  4. npm start to start the worker
  5. npm run workflow to register the workflow
  6. browse the UI http://localhost:8080
  7. the 500 error occurs repeatedly

Environment/Versions

  • OS and processor: Linux(ubuntu)
  • Temporal Version: Not sure but it is the temporalite:test container written in the docker-compose

  • Are you using Docker or Kubernetes or building Temporal from source? Docker

Additional context

If there's anything else I can share, please let me know :)

[Bug] Ecommerce file structure

Describe the bug

The new @temporalio/create assumes each top-level directory is a project with a package.json and the same npm scripts, so the ecommerce nesting doesn't work:

image

The CLI can either not show ecommerce as an example, or it can add special-case logic. I'd be happy to implement either.

[Feature Request] Lint against Node imports only inside Workflow files

Is your feature request related to a problem? Please describe.

we should be able to use this: https://eslint.org/docs/rules/no-restricted-imports

however it should not be applied indiscriminately, only on workflow files

Describe the solution you'd like

ideally to keep it lightweight, we just add a comment at the top of a workflow file to keep us honest.

Additional context

https://twitter.com/ryanflorence/status/1499456892724137987?s=20&t=2MMXl5duaDr4OiIw2U2W9A

[Bug] Enable CI

Describe the bug

It's not currently running on PRs or pushes to main. Does it need to be enabled in repo settings? Pretty sure this is valid syntax:

image

[Feature Request] DSL example

Is your feature request related to a problem? Please describe.

Create a DSL example similar to the ones found for Go and Java

"npx @temporalio/create@latest my-project-name" fails on Win10 (21H1), VS2019 BuildTools (16.11.2+f32259642, 16.11.2.50704), node 16.9.1, node-gyp 8.3

Describe the bug

When executing npx @temporalio/create@latest my-project-name on Win10 with node 16.9.1, node-gyp 8.3, VS2019 (16.11.31829.152), MSBuild 16.11.2.50704, python 3.8.8 the process fails with:

~> npx @temporalio/create@latest my-project-name
Need to install the following packages:
  @temporalio/create@latest
Ok to proceed? (y) y
√ Which sample would you like to use? » hello-world
Creating a new Temporal project in ~\my-project-name/

Downloading files for sample hello-world. This might take a moment.

Installing packages. This might take a couple of minutes.

npm WARN cleanup Failed to remove some directories [
npm WARN cleanup   [
npm WARN cleanup     '~\\my-project-name\\node_modules',
npm WARN cleanup     [Error: EBUSY: resource busy or locked, rmdir '~\my-project-name\node_modules\isolated-vm'] {
npm WARN cleanup       errno: -4082,
npm WARN cleanup       code: 'EBUSY',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: '~\\my-project-name\\node_modules\\isolated-vm'
npm WARN cleanup     }
npm WARN cleanup   ]
npm WARN cleanup ]
npm ERR! code 1
npm ERR! path ~\my-project-name\node_modules\@temporalio\worker
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c npm run build
npm ERR! > @temporalio/[email protected] build
npm ERR! > node-gyp rebuild --release
npm ERR!
npm ERR! Die Projekte in dieser Projektmappe werden nacheinander erstellt. Um eine parallele Erstellung zu ermöglichen, müssen Sie den Schalter "-m" hinzufügen.
npm ERR!   workflow-isolate-extension.cc
npm ERR! ~\my-project-name\node_modules\isolated-vm\src\lib\thread_pool.h(17,55): warning C4003: Nicht genügend Argumente für den Aufruf des funktionsähnlichen Makros "max". [~\my-project-name\node_modules\@temporalio\worker\build\temporalio-workflow-isolate-extension.vcxproj]       
npm ERR! ~\my-project-name\node_modules\isolated-vm\src\lib\thread_pool.h(17,55): error C2589: "(": Ungültiges Token auf der rechten Seite von "::" [~\my-project-name\node_modules\@temporalio\worker\build\temporalio-workflow-isolate-extension.vcxproj]
npm ERR! ~\my-project-name\node_modules\isolated-vm\src\lib\thread_pool.h(17): error C2062: "unknown-type"-Typ unerwartet [~\my-project-name\node_modules\@temporalio\worker\build\temporalio-workflow-isolate-extension.vcxproj]
npm ERR! ~\my-project-name\node_modules\isolated-vm\src\lib\thread_pool.h(17,22): error C2059: Syntaxfehler: ")" [~\my-project-name\node_modules\@temporalio\worker\build\temporalio-workflow-isolate-extension.vcxproj]
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | win32 | x64
npm ERR! gyp info find Python using Python version 3.8.8 found at "C:\tools\Anaconda3\python.exe"
npm ERR! gyp info find VS using VS2019 (16.11.31829.152) found at:
npm ERR! gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools"
npm ERR! gyp info find VS run with --verbose for detailed information
npm ERR! gyp info spawn C:\tools\Anaconda3\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   'C:\\ProgramData\\nvm\\v16.9.1\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'msvs',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '~\\my-project-name\\node_modules\\@temporalio\\worker\\build\\config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\ProgramData\\nvm\\v16.9.1\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Users\\User\\AppData\\Local\\node-gyp\\Cache\\16.9.1\\include\\node\\common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=C:\\Users\\User\\AppData\\Local\\node-gyp\\Cache\\16.9.1',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=C:\\ProgramData\\nvm\\v16.9.1\\node_modules\\npm\\node_modules\\node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\User\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\16.9.1\\\\<(target_arch)\\\\node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=~\\my-project-name\\node_modules\\@temporalio\\worker',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   '~\\my-project-name\\node_modules\\@temporalio\\worker\\build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   'build/binding.sln',
npm ERR! gyp info spawn args   '/clp:Verbosity=minimal',
npm ERR! gyp info spawn args   '/nologo',
npm ERR! gyp info spawn args   '/p:Configuration=Release;Platform=x64'
npm ERR! gyp info spawn args ]
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onExit (C:\ProgramData\nvm\v16.9.1\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:394:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Windows_NT 10.0.19043
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\ProgramData\\nvm\\v16.9.1\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--release"
npm ERR! gyp ERR! cwd ~\my-project-name\node_modules\@temporalio\worker
npm ERR! gyp ERR! node -v v16.9.1
npm ERR! gyp ERR! node-gyp -v v8.3.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\User\AppData\Local\npm-cache\_logs\2021-11-11T09_46_09_564Z-debug.log

Aborting installation.
  npm.cmd has failed.

To Reproduce

install dependencies as explained by
https://docs.temporal.io/docs/typescript/introduction/#getting-started
https://github.com/nodejs/node-gyp#installation
install MS VS build tools from herre: https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools
install python (e.g. anaconda)
set "npm config set msvs_version 2017"
set "npm config set python ..."

Expected behavior

It seems that "temporalio-workflow-isolate-extension.vcxproj" contains invalid tokens and syntax errors during a compile of isolation-vm thread_pool.h stuff... I will also investigate on isolation-vm github.

either:

  1. make hello world example run as explained by getting started guide OR
  2. give additional hints in getting started guide.

Screenshots/Terminal output

see above

Versions

  • OS: Windows 10 (21H1)
  • Temporal Version 0.14.0
  • node 16.9.1, node-gyp 8.3,
  • VS2019 (16.11.31829.152), MSBuild 16.11.2.50704,
  • python 3.8.8
  • Are you using Docker or Kubernetes or building Temporal from source? no,

[Bug] nextjs-ecommerce-oneclick sample wont run on Windows without renaming

Describe the bug

There is an issue (temporalio/sdk-typescript#450) with the typescript SDK that prevents projects from launching on Windows if the name of the project folder starts with the letter n. This issue currently impacts the nextjs-ecommerce-oneclick sample.

You can work around this issue by renaming your local copy of the folder to something that doesn't start with the letter n, like ecommerce-oneclick instead of nextjs-ecommerce-oneclick.

Environment/Versions

Impacts Windows only (does not impact WSL)

[Feature Request] On pre-commit, only copy and prompt when needed

Is your feature request related to a problem? Please describe.

Currently, we prompt contributors every time they commit:

This will overwrite any changes made to config files in samples (like hello-world/tsconfig.json).
Proceed? [Y/n] y
Copying config files from .shared/ to samples... done.

And we copy all shared files to all dirs.

Describe the solution you'd like

We could only prompt when they've edited config files that are about to be overwritten (by checking with git to see if there are local changes). Similarly, we could also only copy files from .shared/ that have changed, or to dirs that are new.

axios-0.21.4.tgz: 1 vulnerabilities (highest severity is: 8.8) - autoclosed

Vulnerable Library - axios-0.21.4.tgz

Promise based HTTP client for the browser and node.js

Library home page: https://registry.npmjs.org/axios/-/axios-0.21.4.tgz

Path to dependency file: /expense/package.json

Path to vulnerable library: /expense/node_modules/axios/package.json

Found in HEAD commit: 3b9bae980eb794fab08e5addef96e9ace5acb327

Vulnerabilities

CVE Severity CVSS Dependency Type Fixed in Remediation Available
CVE-2022-1214 High 8.8 axios-0.21.4.tgz Direct 0.26.0

Details

CVE-2022-1214

Vulnerable Library - axios-0.21.4.tgz

Promise based HTTP client for the browser and node.js

Library home page: https://registry.npmjs.org/axios/-/axios-0.21.4.tgz

Path to dependency file: /expense/package.json

Path to vulnerable library: /expense/node_modules/axios/package.json

Dependency Hierarchy:

  • axios-0.21.4.tgz (Vulnerable Library)

Found in HEAD commit: 3b9bae980eb794fab08e5addef96e9ace5acb327

Found in base branch: main

Vulnerability Details

Exposure of Sensitive Information to an Unauthorized Actor in GitHub repository axios/axios prior to 0.26.

Publish Date: 2022-05-03

URL: CVE-2022-1214

CVSS 3 Score Details (8.8)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: Low
    • User Interaction: None
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: High
    • Integrity Impact: High
    • Availability Impact: High

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: https://huntr.dev/bounties/ef7b4ab6-a3f6-4268-a21a-e7104d344607/

Release Date: 2022-05-03

Fix Resolution: 0.26.0

⛑️ Automatic Remediation is available for this issue


⛑️ Automatic Remediation is available for this issue.

[Bug] Hello World sample workflow cannot run

Describe the bug

Attempting to run the hello-world workflow throws an error in the @temporalio/client package.

To Reproduce

  1. Run npx @temporalio/create@latest ./example-temporal-node --sample hello-world to fetch the example
  2. Start the Temporal server: docker-compose up.
  3. Start the worker: npm run start.watch.
  4. Try to run the workflow: npm run workflow.

Expected behavior

I expect the workflow to run as described in the documentation.

Screenshots/Terminal output

example-temporal-node % npm run workflow

> [email protected] workflow /Users/rupalivohra/code/convoyinc/example-temporal-node
> ts-node src/exec-workflow.ts

<redacted/path>/example-temporal-node/node_modules/@temporalio/client/lib/workflow-client.js:65
        const interceptors = (this.options.interceptors.calls ?? []).map((ctor) => ctor({ workflowId: compiledOptions.workflowId }));
                                                               ^

SyntaxError: Unexpected token '?'
    at wrapSafe (internal/modules/cjs/loader.js:1063:16)
    at Module._compile (internal/modules/cjs/loader.js:1111:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
    at Module.load (internal/modules/cjs/loader.js:996:32)
    at Function.Module._load (internal/modules/cjs/loader.js:896:14)
    at Module.require (internal/modules/cjs/loader.js:1036:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/Users/rupalivohra/code/convoyinc/example-temporal-node/node_modules/@temporalio/client/src/index.ts:12:1)
    at Module._compile (internal/modules/cjs/loader.js:1147:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] workflow: `ts-node src/exec-workflow.ts`
npm ERR! Exit status 1

Versions

Temporalio Client version from yarn.lock:

"@temporalio/client@^0.8.0":
  version "0.8.0"
  resolved "https://packages.convoy.com/artifactory/api/npm/npm/@temporalio/client/-/client-0.8.0.tgz#1e659089a6dd2c66a2ea5bb2e08b137b29e5dc8e"
  integrity sha1-HmWQiabdLGai6luy4IsTeynl3I4=
  dependencies:
    "@grpc/grpc-js" "^1.3.7"
    "@temporalio/common" "^0.4.0"
    "@temporalio/proto" "^0.3.3"
    ms "^2.1.3"
    protobufjs "^6.11.2"
    uuid "^8.3.2"

axios-0.21.1.tgz: 2 vulnerabilities (highest severity is: 8.8) - autoclosed

Vulnerable Library - axios-0.21.1.tgz

Promise based HTTP client for the browser and node.js

Library home page: https://registry.npmjs.org/axios/-/axios-0.21.1.tgz

Path to dependency file: /patching-api/package.json

Path to vulnerable library: /patching-api/node_modules/axios/package.json,/activities-examples/node_modules/axios/package.json

Found in HEAD commit: 3b9bae980eb794fab08e5addef96e9ace5acb327

Vulnerabilities

CVE Severity CVSS Dependency Type Fixed in Remediation Available
CVE-2022-1214 High 8.8 axios-0.21.1.tgz Direct 0.26.0
CVE-2021-3749 High 7.5 axios-0.21.1.tgz Direct 0.21.2

Details

CVE-2022-1214

Vulnerable Library - axios-0.21.1.tgz

Promise based HTTP client for the browser and node.js

Library home page: https://registry.npmjs.org/axios/-/axios-0.21.1.tgz

Path to dependency file: /patching-api/package.json

Path to vulnerable library: /patching-api/node_modules/axios/package.json,/activities-examples/node_modules/axios/package.json

Dependency Hierarchy:

  • axios-0.21.1.tgz (Vulnerable Library)

Found in HEAD commit: 3b9bae980eb794fab08e5addef96e9ace5acb327

Found in base branch: main

Vulnerability Details

Exposure of Sensitive Information to an Unauthorized Actor in GitHub repository axios/axios prior to 0.26.

Publish Date: 2022-05-03

URL: CVE-2022-1214

CVSS 3 Score Details (8.8)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: Low
    • User Interaction: None
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: High
    • Integrity Impact: High
    • Availability Impact: High

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: https://huntr.dev/bounties/ef7b4ab6-a3f6-4268-a21a-e7104d344607/

Release Date: 2022-05-03

Fix Resolution: 0.26.0

⛑️ Automatic Remediation is available for this issue

CVE-2021-3749

Vulnerable Library - axios-0.21.1.tgz

Promise based HTTP client for the browser and node.js

Library home page: https://registry.npmjs.org/axios/-/axios-0.21.1.tgz

Path to dependency file: /patching-api/package.json

Path to vulnerable library: /patching-api/node_modules/axios/package.json,/activities-examples/node_modules/axios/package.json

Dependency Hierarchy:

  • axios-0.21.1.tgz (Vulnerable Library)

Found in HEAD commit: 3b9bae980eb794fab08e5addef96e9ace5acb327

Found in base branch: main

Vulnerability Details

axios is vulnerable to Inefficient Regular Expression Complexity

Publish Date: 2021-08-31

URL: CVE-2021-3749

CVSS 3 Score Details (7.5)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: None
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: None
    • Integrity Impact: None
    • Availability Impact: High

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: https://huntr.dev/bounties/1e8f07fc-c384-4ff9-8498-0690de2e8c31/

Release Date: 2021-08-31

Fix Resolution: 0.21.2

⛑️ Automatic Remediation is available for this issue


⛑️ Automatic Remediation is available for this issue.

[Bug] Next.JS sample state management issues

Describe the bug

The Next.JS sample app has a couple react state management issues that don't have anything to do with using temporal but which do prevent the app from working as expected.

  1. Purchases never show as completed - The onClose() function looks at the state variable directly instead of going through a useRef wrapper. This causes the contents of the state variable to be out of date at the time when onClose() is testing for an 'ORDERED' state (it sees 'NEW' instead of 'ORDERED'). The implication of this issue is the onClose() function never sets the local state to 'CONFIRMED' and hence the UI never shows the item as purchased. Wrapping state in a useRef and looking at the .current property of the ref will fix this problem.

  2. Cancelling a purchase blocks any future attempted purchases of the same item - The code currently doesn't reset the transactionId after cancelling a purchase. After cancelling a purchase the code needs to assign a new uuid4() to the transactionId.

To Reproduce

  1. Click buy on an item
  2. Wait
  3. Expect to see the button text switch to Purchased
  4. Never actually see the button text switch to Purchased

and

  1. Click buy on an item
  2. Click cancel
  3. Click buy on the same item
  4. See error - unable to re-purchase

[Bug] codespaces devcontainer will not start

What are you really trying to do?

I was trying to start a github codespace as described in the readme

Describe the bug

The dev container does not start

2022-06-15 14:52:11.048Z: Configuration starting...
2022-06-15 14:52:11.085Z: $ git -C "/var/lib/docker/codespacemount/workspace" clone --branch main --depth 1 https://github.com/temporalio/samples-typescript "/var/lib/docker/codespacemount/workspace/samples-typescript"
2022-06-15 14:52:11.101Z: Cloning into '/var/lib/docker/codespacemount/workspace/samples-typescript'...
2022-06-15 14:52:12.648Z: git process exited with exit code 0
2022-06-15 14:52:12.670Z: $ git -C "/var/lib/docker/codespacemount/workspace/samples-typescript" config --local remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
2022-06-15 14:52:12.684Z: git process exited with exit code 0
2022-06-15 14:52:13.541Z: @microsoft/vscode-dev-containers-cli 0.62.0.
2022-06-15 14:52:13.555Z: Start: Resolving Remote
2022-06-15 14:52:13.568Z: $ docker ps -q -a --filter label=Type=codespaces
2022-06-15 14:52:13.581Z: Stop (39 ms): Run: docker ps -q -a --filter label=Type=codespaces
2022-06-15 14:52:13.593Z: $ /usr/bin/node /usr/lib/node_modules/@microsoft/vscode-dev-containers-cli/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /var/lib/docker/codespacemount/.persistedshare --container-data-folder .vscode-remote/data/Machine --container-system-data-folder /var/vscode-remote --workspace-folder /var/lib/docker/codespacemount/workspace/samples-typescript --id-label Type=codespaces --log-level info --log-format json --config /var/lib/docker/codespacemount/workspace/samples-typescript/.devcontainer/devcontainer.json --override-config /root/.codespaces/shared/merged_devcontainer.json --default-user-env-probe none --mount type=bind,source=/.codespaces/agent/mount/cache,target=/vscode --skip-post-create --update-remote-user-uid-default never --mount-workspace-git-root false
2022-06-15 14:52:13.677Z: @microsoft/vscode-dev-containers-cli 0.62.0.
2022-06-15 14:52:13.690Z: Start: Resolving Remote
2022-06-15 14:52:13.702Z: $ docker-compose version --short
2022-06-15 14:52:14.207Z: Stop (525 ms): Run: docker-compose version --short
2022-06-15 14:52:14.221Z: $ docker ps -q -a --filter label=com.docker.compose.project=samples-typescript_devcontainer --filter label=com.docker.compose.service=samples
2022-06-15 14:52:14.241Z: Stop (33 ms): Run: docker ps -q -a --filter label=com.docker.compose.project=samples-typescript_devcontainer --filter label=com.docker.compose.service=samples
2022-06-15 14:52:14.253Z: $ docker-compose -f /var/lib/docker/codespacemount/workspace/samples-typescript/.devcontainer/docker-compose.yml -f /var/lib/docker/codespacemount/.persistedshare/docker-compose.codespaces.yml config
2022-06-15 14:52:14.798Z: Stop (548 ms): Run: docker-compose -f /var/lib/docker/codespacemount/workspace/samples-typescript/.devcontainer/docker-compose.yml -f /var/lib/docker/codespacemount/.persistedshare/docker-compose.codespaces.yml config
2022-06-15 14:52:14.813Z: services:
2022-06-15 14:52:14.827Z:   samples:
2022-06-15 14:52:14.839Z:     build:
2022-06-15 14:52:14.852Z:       args:
2022-06-15 14:52:14.864Z:         INSTALL_ZSH: "false"
2022-06-15 14:52:14.876Z:         UPGRADE_PACKAGES: "true"
2022-06-15 14:52:14.889Z:         USERNAME: vscode
2022-06-15 14:52:14.901Z:       context: /var/lib/docker/codespacemount/workspace/samples-typescript/.devcontainer
2022-06-15 14:52:14.913Z:       dockerfile: Dockerfile
2022-06-15 14:52:14.926Z:     command: sleep infinity
2022-06-15 14:52:14.939Z:     container_name: samples_dev
2022-06-15 14:52:14.951Z:     depends_on:
2022-06-15 14:52:14.963Z:       temporalite:
2022-06-15 14:52:14.975Z:         condition: service_started
2022-06-15 14:52:14.987Z:     entrypoint: /usr/local/share/docker-init.sh
2022-06-15 14:52:14.999Z:     environment:
2022-06-15 14:52:15.011Z:       CODESPACES: "true"
2022-06-15 14:52:15.023Z:     image: samples:test
2022-06-15 14:52:15.035Z:     labels:
2022-06-15 14:52:15.047Z:       ContainerVersion: '12'
2022-06-15 14:52:15.059Z:       Type: codespaces
2022-06-15 14:52:15.071Z:     network_mode: service:temporalite
2022-06-15 14:52:15.084Z:     user: vscode
2022-06-15 14:52:15.097Z:     volumes:
2022-06-15 14:52:15.109Z:     - /.codespaces/agent/mount:/.codespaces/bin:rw
2022-06-15 14:52:15.123Z:     - /mnt/containerTmp:/tmp:rw
2022-06-15 14:52:15.135Z:     - /var/run/docker.sock:/var/run/docker-host.sock:rw
2022-06-15 14:52:15.147Z:     - /var/lib/docker/codespacemount/workspace/samples-typescript:/workspace:cached
2022-06-15 14:52:15.160Z:     - /var/lib/docker/codespacemount/workspace:/workspaces:rw
2022-06-15 14:52:15.172Z:     - /var/lib/docker/codespacemount/.persistedshare:/workspaces/.codespaces/.persistedshare:rw
2022-06-15 14:52:15.184Z:     - /root/.codespaces/shared:/workspaces/.codespaces/shared:rw
2022-06-15 14:52:15.197Z:   temporal-admin-tools:
2022-06-15 14:52:15.209Z:     container_name: samples_admin-tools
2022-06-15 14:52:15.221Z:     depends_on:
2022-06-15 14:52:15.233Z:       temporalite:
2022-06-15 14:52:15.246Z:         condition: service_started
2022-06-15 14:52:15.258Z:     environment:
2022-06-15 14:52:15.270Z:       TEMPORAL_CLI_ADDRESS: localhost:7233
2022-06-15 14:52:15.282Z:     image: temporalio/admin-tools:latest
2022-06-15 14:52:15.295Z:     network_mode: service:temporalite
2022-06-15 14:52:15.307Z:     restart: unless-stopped
2022-06-15 14:52:15.320Z:     stdin_open: true
2022-06-15 14:52:15.331Z:     tty: true
2022-06-15 14:52:15.346Z:   temporalite:
2022-06-15 14:52:15.359Z:     build:
2022-06-15 14:52:15.371Z:       context: /var/lib/docker/codespacemount/workspace/samples-typescript/.devcontainer
2022-06-15 14:52:15.383Z:       dockerfile: Dockerfile.temporalite
2022-06-15 14:52:15.395Z:     container_name: samples_temporalite
2022-06-15 14:52:15.408Z:     environment:
2022-06-15 14:52:15.420Z:       TEMPORAL_CLI_ADDRESS: localhost:7233
2022-06-15 14:52:15.433Z:     image: temporalite:test
2022-06-15 14:52:15.446Z:     ports:
2022-06-15 14:52:15.470Z:     - published: 7233
2022-06-15 14:52:15.494Z:       target: 7233
2022-06-15 14:52:15.519Z:   web:
2022-06-15 14:52:15.538Z:     container_name: samples_web
2022-06-15 14:52:15.562Z:     depends_on:
2022-06-15 14:52:15.574Z:       temporalite:
2022-06-15 14:52:15.597Z:         condition: service_started
2022-06-15 14:52:15.623Z:     environment:
2022-06-15 14:52:15.641Z:       TEMPORAL_ADDRESS: localhost:7233
2022-06-15 14:52:15.667Z:     image: temporaliotest/ui:latest
2022-06-15 14:52:15.690Z:     network_mode: service:temporalite
2022-06-15 14:52:15.709Z:     restart: unless-stopped
2022-06-15 14:52:15.728Z: version: '3.8'
2022-06-15 14:52:15.741Z: 
2022-06-15 14:52:15.760Z: $ docker -v
2022-06-15 14:52:15.784Z: Stop (38 ms): Run: docker -v
2022-06-15 14:52:15.804Z: $ docker events --format {{json .}} --filter event=start
2022-06-15 14:52:15.823Z: $ docker-compose --project-name samples-typescript_devcontainer -f /var/lib/docker/codespacemount/workspace/samples-typescript/.devcontainer/docker-compose.yml -f /var/lib/docker/codespacemount/.persistedshare/docker-compose.codespaces.yml build
2022-06-15 14:52:15.846Z: web uses an image, skipping
2022-06-15 14:52:15.865Z: temporal-admin-tools uses an image, skipping
2022-06-15 14:52:15.883Z: Building temporalite
2022-06-15 14:52:15.902Z: #2 [internal] load .dockerignore
2022-06-15 14:52:15.921Z: #2 sha256:d4af0ccf46ad3154e0881d5f1b051372defecbcec9ab0bf59ec8b17ad98310f5
2022-06-15 14:52:15.956Z: #2 transferring context: 2B done
2022-06-15 14:52:15.978Z: #2 DONE 0.4s
2022-06-15 14:52:15.998Z: 
2022-06-15 14:52:16.010Z: #1 [internal] load build definition from Dockerfile.temporalite
2022-06-15 14:52:16.035Z: #1 sha256:c218318f55f961aea17880529aaa63f34792bfd86dbda6cbfda6af2d5efae4be
2022-06-15 14:52:16.048Z: #1 transferring dockerfile: 352B done
2022-06-15 14:52:16.064Z: #1 DONE 0.5s
2022-06-15 14:52:16.142Z: 
2022-06-15 14:52:16.154Z: #4 [auth] library/golang:pull token for registry-1.docker.io
2022-06-15 14:52:16.167Z: #4 sha256:f8f6eaafbaa31a9c48b2cbf2b8e218c2fa6e9df07f309040e4f345a320986d07
2022-06-15 14:52:16.310Z: #4 DONE 0.0s
2022-06-15 14:52:16.326Z: 
2022-06-15 14:52:16.338Z: #3 [internal] load metadata for docker.io/library/golang:1.17
2022-06-15 14:52:16.351Z: #3 sha256:85d71333fef77c424238254d83208db5f9cca4e89afebc9089673b74f68e11e2
2022-06-15 14:52:16.902Z: #3 DONE 0.8s
2022-06-15 14:52:16.917Z: 
2022-06-15 14:52:16.930Z: #5 [1/4] FROM docker.io/library/golang:1.17@sha256:095eb1b2178f83935a6f43e53d61b54d0426149e54a82e9789f4b8f7f20c8125
2022-06-15 14:52:16.956Z: #5 sha256:a14567ece7349cc8883bc97ddf1194d7704a50815ebfdb44b881e2abe1bf13af
2022-06-15 14:52:16.982Z: #5 resolve docker.io/library/golang:1.17@sha256:095eb1b2178f83935a6f43e53d61b54d0426149e54a82e9789f4b8f7f20c8125 0.1s done
2022-06-15 14:52:17.042Z: #5 sha256:0e970dee9aa41b53e9096c0fe39d64d8e4e96dfbffaa7b47a9d1897ae965b9b0 7.11kB / 7.11kB done
2022-06-15 14:52:17.058Z: #5 sha256:dceb25b534d8da2aa50da5c6489fc4120db24f24dcf8b3b1862d1a8cebf1210b 1.80kB / 1.80kB done
2022-06-15 14:52:17.070Z: #5 sha256:e604223835ccf02d097187b5a58ca73e8598cadbb16a36202ca1943e97f56f1f 0B / 10.88MB 0.1s
2022-06-15 14:52:17.083Z: #5 sha256:095eb1b2178f83935a6f43e53d61b54d0426149e54a82e9789f4b8f7f20c8125 2.35kB / 2.35kB done
2022-06-15 14:52:17.215Z: #5 sha256:e604223835ccf02d097187b5a58ca73e8598cadbb16a36202ca1943e97f56f1f 10.88MB / 10.88MB 0.3s
2022-06-15 14:52:17.255Z: #5 sha256:e756f3fdd6a378aa16205b0f75d178b7532b110e86be7659004fc6a21183226c 6.29MB / 55.01MB 0.3s
2022-06-15 14:52:17.274Z: #5 sha256:bf168a6748997eb97b48cc86234b7ff7d8bc907645b9be99013158b3f146b272 3.15MB / 5.16MB 0.3s
2022-06-15 14:52:17.350Z: #5 sha256:e604223835ccf02d097187b5a58ca73e8598cadbb16a36202ca1943e97f56f1f 10.88MB / 10.88MB 0.3s done
2022-06-15 14:52:17.371Z: #5 sha256:e756f3fdd6a378aa16205b0f75d178b7532b110e86be7659004fc6a21183226c 26.21MB / 55.01MB 0.5s
2022-06-15 14:52:17.384Z: #5 sha256:bf168a6748997eb97b48cc86234b7ff7d8bc907645b9be99013158b3f146b272 5.16MB / 5.16MB 0.4s done
2022-06-15 14:52:17.397Z: #5 sha256:6d5c91c4cd86dde23108ab3af91e9eae838d0059a380ee7dfd4f370b6d985523 0B / 54.58MB 0.5s
2022-06-15 14:52:17.462Z: #5 sha256:e756f3fdd6a378aa16205b0f75d178b7532b110e86be7659004fc6a21183226c 36.70MB / 55.01MB 0.6s
2022-06-15 14:52:17.475Z: #5 sha256:6d5c91c4cd86dde23108ab3af91e9eae838d0059a380ee7dfd4f370b6d985523 10.49MB / 54.58MB 0.6s
2022-06-15 14:52:17.489Z: #5 sha256:93c221c34e03cb2bc3c5cb0e1fcf029b793cfe2c10362287dd05270d80333db9 5.24MB / 85.87MB 0.6s
2022-06-15 14:52:17.544Z: #5 sha256:e756f3fdd6a378aa16205b0f75d178b7532b110e86be7659004fc6a21183226c 42.99MB / 55.01MB 0.7s
2022-06-15 14:52:17.559Z: #5 sha256:6d5c91c4cd86dde23108ab3af91e9eae838d0059a380ee7dfd4f370b6d985523 20.97MB / 54.58MB 0.7s
2022-06-15 14:52:17.571Z: #5 sha256:93c221c34e03cb2bc3c5cb0e1fcf029b793cfe2c10362287dd05270d80333db9 13.63MB / 85.87MB 0.7s
2022-06-15 14:52:17.656Z: #5 sha256:e756f3fdd6a378aa16205b0f75d178b7532b110e86be7659004fc6a21183226c 51.38MB / 55.01MB 0.8s
2022-06-15 14:52:17.946Z: #5 sha256:6d5c91c4cd86dde23108ab3af91e9eae838d0059a380ee7dfd4f370b6d985523 31.46MB / 54.58MB 0.8s
2022-06-15 14:52:17.963Z: #5 sha256:93c221c34e03cb2bc3c5cb0e1fcf029b793cfe2c10362287dd05270d80333db9 24.12MB / 85.87MB 0.8s
2022-06-15 14:52:18.157Z: #5 sha256:e756f3fdd6a378aa16205b0f75d178b7532b110e86be7659004fc6a21183226c 55.01MB / 55.01MB 0.9s
2022-06-15 14:52:18.276Z: #5 sha256:6d5c91c4cd86dde23108ab3af91e9eae838d0059a380ee7dfd4f370b6d985523 40.89MB / 54.58MB 0.9s
2022-06-15 14:52:18.302Z: #5 sha256:93c221c34e03cb2bc3c5cb0e1fcf029b793cfe2c10362287dd05270d80333db9 33.55MB / 85.87MB 0.9s
2022-06-15 14:52:18.330Z: #5 sha256:6d5c91c4cd86dde23108ab3af91e9eae838d0059a380ee7dfd4f370b6d985523 54.58MB / 54.58MB 1.1s
2022-06-15 14:52:18.357Z: #5 sha256:93c221c34e03cb2bc3c5cb0e1fcf029b793cfe2c10362287dd05270d80333db9 49.28MB / 85.87MB 1.1s
2022-06-15 14:52:18.383Z: #5 sha256:e756f3fdd6a378aa16205b0f75d178b7532b110e86be7659004fc6a21183226c 55.01MB / 55.01MB 1.1s done
2022-06-15 14:52:18.401Z: #5 sha256:93c221c34e03cb2bc3c5cb0e1fcf029b793cfe2c10362287dd05270d80333db9 55.57MB / 85.87MB 1.2s
2022-06-15 14:52:18.426Z: #5 sha256:93c221c34e03cb2bc3c5cb0e1fcf029b793cfe2c10362287dd05270d80333db9 65.01MB / 85.87MB 1.3s
2022-06-15 14:52:18.445Z: #5 extracting sha256:e756f3fdd6a378aa16205b0f75d178b7532b110e86be7659004fc6a21183226c
2022-06-15 14:52:18.474Z: #5 sha256:6d5c91c4cd86dde23108ab3af91e9eae838d0059a380ee7dfd4f370b6d985523 54.58MB / 54.58MB 1.4s done
2022-06-15 14:52:18.867Z: #5 sha256:93c221c34e03cb2bc3c5cb0e1fcf029b793cfe2c10362287dd05270d80333db9 77.59MB / 85.87MB 1.5s
2022-06-15 14:52:18.916Z: #5 sha256:93c221c34e03cb2bc3c5cb0e1fcf029b793cfe2c10362287dd05270d80333db9 84.93MB / 85.87MB 1.6s
2022-06-15 14:52:18.935Z: #5 sha256:ad491e6a2878e96d876127fb0107f5063e90c343528b58151170cd95ce9b0a95 0B / 134.96MB 1.6s
2022-06-15 14:52:18.947Z: #5 sha256:bbec5306b106b1062838a5fa65c34731772b8da7ff56a9aec828890a5bf1f226 156B / 156B 1.6s
2022-06-15 14:52:18.963Z: #5 sha256:bbec5306b106b1062838a5fa65c34731772b8da7ff56a9aec828890a5bf1f226 156B / 156B 1.6s done
2022-06-15 14:52:18.979Z: #5 sha256:ad491e6a2878e96d876127fb0107f5063e90c343528b58151170cd95ce9b0a95 14.68MB / 134.96MB 1.9s
2022-06-15 14:52:18.992Z: #5 sha256:ad491e6a2878e96d876127fb0107f5063e90c343528b58151170cd95ce9b0a95 23.07MB / 134.96MB 2.0s
2022-06-15 14:52:19.036Z: #5 sha256:93c221c34e03cb2bc3c5cb0e1fcf029b793cfe2c10362287dd05270d80333db9 85.87MB / 85.87MB 2.0s done
2022-06-15 14:52:19.050Z: #5 sha256:ad491e6a2878e96d876127fb0107f5063e90c343528b58151170cd95ce9b0a95 32.51MB / 134.96MB 2.1s
2022-06-15 14:52:19.148Z: #5 sha256:ad491e6a2878e96d876127fb0107f5063e90c343528b58151170cd95ce9b0a95 47.19MB / 134.96MB 2.3s
2022-06-15 14:52:19.289Z: #5 sha256:ad491e6a2878e96d876127fb0107f5063e90c343528b58151170cd95ce9b0a95 57.56MB / 134.96MB 2.4s
2022-06-15 14:52:19.403Z: #5 sha256:ad491e6a2878e96d876127fb0107f5063e90c343528b58151170cd95ce9b0a95 65.01MB / 134.96MB 2.5s
2022-06-15 14:52:19.511Z: #5 sha256:ad491e6a2878e96d876127fb0107f5063e90c343528b58151170cd95ce9b0a95 74.45MB / 134.96MB 2.6s
2022-06-15 14:52:19.625Z: #5 sha256:ad491e6a2878e96d876127fb0107f5063e90c343528b58151170cd95ce9b0a95 84.93MB / 134.96MB 2.7s
2022-06-15 14:52:19.764Z: #5 sha256:ad491e6a2878e96d876127fb0107f5063e90c343528b58151170cd95ce9b0a95 101.71MB / 134.96MB 2.9s
2022-06-15 14:52:19.850Z: #5 sha256:ad491e6a2878e96d876127fb0107f5063e90c343528b58151170cd95ce9b0a95 110.10MB / 134.96MB 3.0s
2022-06-15 14:52:19.959Z: #5 sha256:ad491e6a2878e96d876127fb0107f5063e90c343528b58151170cd95ce9b0a95 117.44MB / 134.96MB 3.1s
2022-06-15 14:52:20.072Z: #5 extracting sha256:e756f3fdd6a378aa16205b0f75d178b7532b110e86be7659004fc6a21183226c 1.8s done
2022-06-15 14:52:20.244Z: #5 sha256:ad491e6a2878e96d876127fb0107f5063e90c343528b58151170cd95ce9b0a95 132.12MB / 134.96MB 3.3s
2022-06-15 14:52:20.944Z: #5 sha256:ad491e6a2878e96d876127fb0107f5063e90c343528b58151170cd95ce9b0a95 134.96MB / 134.96MB 3.9s done
2022-06-15 14:52:20.967Z: #5 extracting sha256:bf168a6748997eb97b48cc86234b7ff7d8bc907645b9be99013158b3f146b272 0.1s
2022-06-15 14:52:21.081Z: #5 extracting sha256:bf168a6748997eb97b48cc86234b7ff7d8bc907645b9be99013158b3f146b272 0.2s done
2022-06-15 14:52:22.117Z: #5 extracting sha256:e604223835ccf02d097187b5a58ca73e8598cadbb16a36202ca1943e97f56f1f
2022-06-15 14:52:22.318Z: #5 extracting sha256:e604223835ccf02d097187b5a58ca73e8598cadbb16a36202ca1943e97f56f1f 0.2s done
2022-06-15 14:52:22.733Z: #5 extracting sha256:6d5c91c4cd86dde23108ab3af91e9eae838d0059a380ee7dfd4f370b6d985523 0.1s
2022-06-15 14:52:24.274Z: #5 extracting sha256:6d5c91c4cd86dde23108ab3af91e9eae838d0059a380ee7dfd4f370b6d985523 1.5s done
2022-06-15 14:52:25.337Z: #5 extracting sha256:93c221c34e03cb2bc3c5cb0e1fcf029b793cfe2c10362287dd05270d80333db9
2022-06-15 14:52:27.138Z: #5 extracting sha256:93c221c34e03cb2bc3c5cb0e1fcf029b793cfe2c10362287dd05270d80333db9 1.8s done
2022-06-15 14:52:28.481Z: #5 extracting sha256:ad491e6a2878e96d876127fb0107f5063e90c343528b58151170cd95ce9b0a95
2022-06-15 14:52:32.010Z: #5 extracting sha256:ad491e6a2878e96d876127fb0107f5063e90c343528b58151170cd95ce9b0a95 3.6s done
2022-06-15 14:52:34.225Z: #5 extracting sha256:bbec5306b106b1062838a5fa65c34731772b8da7ff56a9aec828890a5bf1f226
2022-06-15 14:52:34.365Z: #5 extracting sha256:bbec5306b106b1062838a5fa65c34731772b8da7ff56a9aec828890a5bf1f226 done
2022-06-15 14:52:35.541Z: #5 DONE 18.7s
2022-06-15 14:52:35.681Z: 
2022-06-15 14:52:35.699Z: #6 [2/4] RUN go install github.com/DataDog/temporalite/cmd/temporalite@latest
2022-06-15 14:52:35.720Z: #6 sha256:db524e52b961436bcc48b0859396de795eb9116ab65183d1e725ce738aaf7461
2022-06-15 14:52:36.241Z: #6 0.642 go: downloading github.com/DataDog/temporalite v0.0.0-20220526022626-0f25777b0ee7
2022-06-15 14:52:36.379Z: #6 0.655 go: downloading github.com/temporalio/ui-server v0.13.1
2022-06-15 14:52:36.395Z: #6 0.657 go: downloading github.com/urfave/cli/v2 v2.8.1
2022-06-15 14:52:36.549Z: #6 0.810 go: downloading go.temporal.io/server v1.16.2
2022-06-15 14:52:36.968Z: #6 1.362 go: downloading go.uber.org/zap v1.21.0
2022-06-15 14:52:37.109Z: #6 1.420 go: downloading go.temporal.io/sdk v1.14.0
2022-06-15 14:52:37.278Z: #6 1.547 go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.2
2022-06-15 14:52:37.298Z: #6 1.564 go: downloading github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673
2022-06-15 14:52:37.360Z: #6 1.673 go: downloading github.com/blang/semver/v4 v4.0.0
2022-06-15 14:52:37.380Z: #6 1.687 go: downloading go.temporal.io/api v1.7.1-0.20220326004856-88a7c92fb8b4
2022-06-15 14:52:37.398Z: #6 1.708 go: downloading google.golang.org/grpc v1.45.0
2022-06-15 14:52:37.412Z: #6 1.708 go: downloading github.com/golang/mock v1.6.0
2022-06-15 14:52:37.427Z: #6 1.721 go: downloading github.com/iancoleman/strcase v0.2.0
2022-06-15 14:52:37.442Z: #6 1.736 go: downloading github.com/jmoiron/sqlx v1.3.4
2022-06-15 14:52:37.461Z: #6 1.755 go: downloading github.com/mattn/go-sqlite3 v1.14.11
2022-06-15 14:52:37.474Z: #6 1.762 go: downloading github.com/pborman/uuid v1.2.1
2022-06-15 14:52:37.492Z: #6 1.817 go: downloading go.uber.org/fx v1.16.0
2022-06-15 14:52:37.508Z: #6 1.884 go: downloading go.uber.org/atomic v1.9.0
2022-06-15 14:52:37.583Z: #6 1.902 go: downloading go.uber.org/multierr v1.7.0
2022-06-15 14:52:37.606Z: #6 1.930 go: downloading github.com/golang-jwt/jwt/v4 v4.3.0
2022-06-15 14:52:37.620Z: #6 1.953 go: downloading github.com/golang-jwt/jwt v3.2.2+incompatible
2022-06-15 14:52:37.633Z: #6 1.969 go: downloading gopkg.in/square/go-jose.v2 v2.6.0
2022-06-15 14:52:37.648Z: #6 1.971 go: downloading github.com/gocql/gocql v0.0.0-20211222173705-d73e6b1002a7
2022-06-15 14:52:37.663Z: #6 1.973 go: downloading gopkg.in/validator.v2 v2.0.0-20210331031555-b37d688a7fb0
2022-06-15 14:52:37.676Z: #6 1.994 go: downloading gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
2022-06-15 14:52:37.724Z: #6 2.019 go: downloading github.com/cactus/go-statsd-client v3.1.1+incompatible
2022-06-15 14:52:37.741Z: #6 2.026 go: downloading github.com/prometheus/client_golang v1.12.1
2022-06-15 14:52:37.757Z: #6 2.037 go: downloading github.com/stretchr/testify v1.7.0
2022-06-15 14:52:37.772Z: #6 2.064 go: downloading github.com/uber-go/tally/v4 v4.1.1
2022-06-15 14:52:37.790Z: #6 2.109 go: downloading go.opentelemetry.io/otel v1.4.0
2022-06-15 14:52:37.838Z: #6 2.110 go: downloading go.opentelemetry.io/otel/exporters/prometheus v0.27.0
2022-06-15 14:52:37.862Z: #6 2.111 go: downloading go.opentelemetry.io/otel/metric v0.27.0
2022-06-15 14:52:37.877Z: #6 2.177 go: downloading go.opentelemetry.io/otel/sdk/export/metric v0.27.0
2022-06-15 14:52:37.897Z: #6 2.177 go: downloading go.opentelemetry.io/otel/sdk/metric v0.27.0
2022-06-15 14:52:37.911Z: #6 2.196 go: downloading go.opentelemetry.io/otel/sdk v1.4.0
2022-06-15 14:52:37.924Z: #6 2.225 go: downloading github.com/russross/blackfriday/v2 v2.1.0
2022-06-15 14:52:37.980Z: #6 2.227 go: downloading github.com/gorilla/securecookie v1.1.1
2022-06-15 14:52:37.993Z: #6 2.228 go: downloading github.com/gorilla/sessions v1.2.1
2022-06-15 14:52:38.005Z: #6 2.241 go: downloading github.com/labstack/echo-contrib v0.12.0
2022-06-15 14:52:38.017Z: #6 2.263 go: downloading github.com/labstack/echo/v4 v4.6.3
2022-06-15 14:52:38.029Z: #6 2.273 go: downloading golang.org/x/time v0.0.0-20220224211638-0e9765cccd65
2022-06-15 14:52:38.045Z: #6 2.281 go: downloading github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13
2022-06-15 14:52:38.059Z: #6 2.287 go: downloading github.com/google/uuid v1.3.0
2022-06-15 14:52:38.074Z: #6 2.297 go: downloading github.com/gogo/protobuf v1.3.2
2022-06-15 14:52:38.288Z: #6 2.590 go: downloading github.com/aws/aws-sdk-go v1.42.52
2022-06-15 14:52:38.311Z: #6 2.591 go: downloading github.com/olivere/elastic v6.2.37+incompatible
2022-06-15 14:52:38.424Z: #6 2.731 go: downloading github.com/olivere/elastic/v7 v7.0.31
2022-06-15 14:52:38.585Z: #6 2.903 go: downloading github.com/uber/tchannel-go v1.22.2
2022-06-15 14:52:39.034Z: #6 3.305 go: downloading github.com/temporalio/ringpop-go v0.0.0-20211012191444-6f91b5915e95
2022-06-15 14:52:39.313Z: #6 3.435 go: downloading go.temporal.io/version v0.3.0
2022-06-15 14:52:39.438Z: #6 3.479 go: downloading github.com/gogo/status v1.1.0
2022-06-15 14:52:39.476Z: #6 3.696 go: downloading go.uber.org/dig v1.13.0
2022-06-15 14:52:39.496Z: #6 3.766 go: downloading golang.org/x/sys v0.0.0-20220325203850-36772127a21f
2022-06-15 14:52:39.737Z: #6 4.000 go: downloading google.golang.org/protobuf v1.28.0
2022-06-15 14:52:39.878Z: #6 4.180 go: downloading github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a
2022-06-15 14:52:39.899Z: #6 4.189 go: downloading github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
2022-06-15 14:52:39.911Z: #6 4.225 go: downloading github.com/robfig/cron v1.2.0
2022-06-15 14:52:39.924Z: #6 4.242 go: downloading github.com/golang/protobuf v1.5.2
2022-06-15 14:52:39.937Z: #6 4.271 go: downloading golang.org/x/net v0.0.0-20220325170049-de3da57026de
2022-06-15 14:52:40.184Z: #6 4.490 go: downloading golang.org/x/crypto v0.0.0-20220214200702-86341886e292
2022-06-15 14:52:40.269Z: #6 4.648 go: downloading github.com/golang/snappy v0.0.4
2022-06-15 14:52:40.292Z: #6 4.668 go: downloading github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed
2022-06-15 14:52:40.306Z: #6 4.677 go: downloading gopkg.in/inf.v0 v0.9.1
2022-06-15 14:52:40.437Z: #6 4.686 go: downloading github.com/davecgh/go-spew v1.1.1
2022-06-15 14:52:40.462Z: #6 4.701 go: downloading github.com/pmezard/go-difflib v1.0.0
2022-06-15 14:52:40.479Z: #6 4.709 go: downloading github.com/beorn7/perks v1.0.1
2022-06-15 14:52:40.495Z: #6 4.721 go: downloading github.com/cespare/xxhash/v2 v2.1.2
2022-06-15 14:52:40.509Z: #6 4.733 go: downloading github.com/prometheus/client_model v0.2.0
2022-06-15 14:52:40.523Z: #6 4.743 go: downloading github.com/prometheus/common v0.32.1
2022-06-15 14:52:40.537Z: #6 4.775 go: downloading github.com/prometheus/procfs v0.7.3
2022-06-15 14:52:40.576Z: #6 4.830 go: downloading github.com/pkg/errors v0.9.1
2022-06-15 14:52:40.593Z: #6 4.848 go: downloading go.opentelemetry.io/otel/internal/metric v0.27.0
2022-06-15 14:52:40.609Z: #6 4.861 go: downloading github.com/jonboulle/clockwork v0.2.2
2022-06-15 14:52:40.626Z: 
2022-06-15 14:52:40.641Z: #6 4.872 go: downloading github.com/coreos/go-oidc/v3 v3.1.0
2022-06-15 14:52:40.655Z: #6 4.885 go: downloading github.com/gogo/gateway v1.1.0
2022-06-15 14:52:40.672Z: #6 4.896 go: downloading github.com/grpc-ecosystem/grpc-gateway v1.16.0
2022-06-15 14:52:40.689Z: #6 4.999 go: downloading golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b
2022-06-15 14:52:40.702Z: #6 5.039 go: downloading github.com/gorilla/context v1.1.1
2022-06-15 14:52:40.716Z: #6 5.047 go: downloading github.com/labstack/gommon v0.3.1
2022-06-15 14:52:40.730Z: #6 5.064 go: downloading github.com/valyala/fasttemplate v1.2.1
2022-06-15 14:52:40.743Z: #6 5.087 go: downloading github.com/mailru/easyjson v0.7.7
2022-06-15 14:52:41.250Z: #6 5.593 go: downloading github.com/opentracing/opentracing-go v1.2.0
2022-06-15 14:52:41.291Z: #6 5.600 go: downloading github.com/apache/thrift v0.0.0-20161221203622-b2a4d4ae21c7
2022-06-15 14:52:41.306Z: #6 5.602 go: downloading github.com/benbjohnson/clock v1.3.0
2022-06-15 14:52:41.319Z: #6 5.609 go: downloading github.com/uber-common/bark v1.3.0
2022-06-15 14:52:41.331Z: #6 5.610 go: downloading github.com/robfig/cron/v3 v3.0.1
2022-06-15 14:52:41.345Z: #6 5.615 go: downloading github.com/xwb1989/sqlparser v0.0.0-20180606152119-120387863bf2
2022-06-15 14:52:41.358Z: #6 5.624 go: downloading github.com/gogo/googleapis v1.4.1
2022-06-15 14:52:41.370Z: #6 5.624 go: downloading google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb
2022-06-15 14:52:41.382Z: #6 5.650 go: downloading github.com/stretchr/objx v0.3.0
2022-06-15 14:52:41.396Z: #6 5.660 go: downloading github.com/matttproud/golang_protobuf_extensions v1.0.1
2022-06-15 14:52:41.408Z: #6 5.670 go: downloading github.com/twmb/murmur3 v1.1.6
2022-06-15 14:52:41.420Z: #6 5.673 go: downloading github.com/go-logr/logr v1.2.2
2022-06-15 14:52:41.432Z: #6 5.688 go: downloading go.opentelemetry.io/otel/trace v1.4.0
2022-06-15 14:52:41.977Z: #6 6.374 go: downloading github.com/mattn/go-colorable v0.1.12
2022-06-15 14:52:42.089Z: #6 6.384 go: downloading github.com/mattn/go-isatty v0.0.14
2022-06-15 14:52:42.110Z: #6 6.401 go: downloading github.com/valyala/bytebufferpool v1.0.0
2022-06-15 14:52:42.124Z: #6 6.408 go: downloading github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475
2022-06-15 14:52:42.139Z: #6 6.426 go: downloading github.com/josharian/intern v1.0.0
2022-06-15 14:52:42.151Z: #6 6.458 go: downloading github.com/sirupsen/logrus v1.8.1
2022-06-15 14:52:42.163Z: #6 6.485 go: downloading github.com/go-logr/stdr v1.2.2
2022-06-15 14:52:42.228Z: #6 6.497 go: downloading golang.org/x/text v0.3.7
2022-06-15 14:52:42.989Z: #6 7.241 go: downloading cloud.google.com/go/storage v1.20.0
2022-06-15 14:52:43.033Z: #6 7.322 go: downloading google.golang.org/api v0.68.0
2022-06-15 14:52:43.050Z: #6 7.327 go: downloading github.com/jmespath/go-jmespath v0.4.0
2022-06-15 14:52:43.066Z: #6 7.329 go: downloading cloud.google.com/go v0.100.2
2022-06-15 14:52:43.129Z: #6 7.408 go: downloading cloud.google.com/go/compute v1.2.0
2022-06-15 14:52:43.144Z: #6 7.434 go: downloading cloud.google.com/go/iam v0.1.1
2022-06-15 14:52:43.157Z: #6 7.457 go: downloading github.com/googleapis/gax-go/v2 v2.1.1
2022-06-15 14:52:43.169Z: #6 7.472 go: downloading golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
2022-06-15 14:52:45.361Z: #6 9.754 go: downloading go.opencensus.io v0.23.0
2022-06-15 14:52:46.363Z: 
2022-06-15 14:52:46.397Z: #6 9.825 go: downloading github.com/google/go-cmp v0.5.7
2022-06-15 14:52:46.418Z: #6 9.825 go: downloading github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da
2022-06-15 14:52:47.105Z: #6 11.51 pkg/mod/github.com/temporalio/[email protected]/server/server.go:49:12: pattern all:generated/openapi: no matching files found
2022-06-15 14:52:48.815Z: #6 ERROR: executor failed running [/bin/sh -c go install github.com/DataDog/temporalite/cmd/temporalite@latest]: exit code: 1
2022-06-15 14:52:48.840Z: ------
2022-06-15 14:52:48.858Z:  > [2/4] RUN go install github.com/DataDog/temporalite/cmd/temporalite@latest:
2022-06-15 14:52:48.874Z: ------
2022-06-15 14:52:48.890Z: executor failed running [/bin/sh -c go install github.com/DataDog/temporalite/cmd/temporalite@latest]: exit code: 1
2022-06-15 14:52:48.912Z: ERROR: Service 'temporalite' failed to build : Build failed
2022-06-15 14:52:48.927Z: Stop (34087 ms): Run: docker-compose --project-name samples-typescript_devcontainer -f /var/lib/docker/codespacemount/workspace/samples-typescript/.devcontainer/docker-compose.yml -f /var/lib/docker/codespacemount/.persistedshare/docker-compose.codespaces.yml build
2022-06-15 14:52:48.943Z: Error: Command failed: docker-compose --project-name samples-typescript_devcontainer -f /var/lib/docker/codespacemount/workspace/samples-typescript/.devcontainer/docker-compose.yml -f /var/lib/docker/codespacemount/.persistedshare/docker-compose.codespaces.yml build
2022-06-15 14:52:48.969Z:     at Lu (/usr/lib/node_modules/@microsoft/vscode-dev-containers-cli/dist/spec-node/devContainersSpecCLI.js:186:227)
2022-06-15 14:52:48.999Z:     at processTicksAndRejections (internal/process/task_queues.js:95:5)
2022-06-15 14:52:49.037Z:     at async CR (/usr/lib/node_modules/@microsoft/vscode-dev-containers-cli/dist/spec-node/devContainersSpecCLI.js:186:1007)
2022-06-15 14:52:49.071Z:     at async ER (/usr/lib/node_modules/@microsoft/vscode-dev-containers-cli/dist/spec-node/devContainersSpecCLI.js:183:2075)
2022-06-15 14:52:49.102Z:     at async $R (/usr/lib/node_modules/@microsoft/vscode-dev-containers-cli/dist/spec-node/devContainersSpecCLI.js:226:2178)
2022-06-15 14:52:49.132Z:     at async Zy (/usr/lib/node_modules/@microsoft/vscode-dev-containers-cli/dist/spec-node/devContainersSpecCLI.js:226:3112)
2022-06-15 14:52:49.166Z:     at async BR (/usr/lib/node_modules/@microsoft/vscode-dev-containers-cli/dist/spec-node/devContainersSpecCLI.js:226:12448)
2022-06-15 14:52:49.207Z:     at async qR (/usr/lib/node_modules/@microsoft/vscode-dev-containers-cli/dist/spec-node/devContainersSpecCLI.js:226:12204)
2022-06-15 14:52:49.230Z: Stop (35355 ms): Run: /usr/bin/node /usr/lib/node_modules/@microsoft/vscode-dev-containers-cli/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /var/lib/docker/codespacemount/.persistedshare --container-data-folder .vscode-remote/data/Machine --container-system-data-folder /var/vscode-remote --workspace-folder /var/lib/docker/codespacemount/workspace/samples-typescript --id-label Type=codespaces --log-level info --log-format json --config /var/lib/docker/codespacemount/workspace/samples-typescript/.devcontainer/devcontainer.json --override-config /root/.codespaces/shared/merged_devcontainer.json --default-user-env-probe none --mount type=bind,source=/.codespaces/agent/mount/cache,target=/vscode --skip-post-create --update-remote-user-uid-default never --mount-workspace-git-root false
2022-06-15 14:52:49.267Z: Exit code 1
2022-06-15 14:52:49.300Z: Failed to create container.
2022-06-15 14:52:49.335Z: Error: Command failed: /usr/bin/node /usr/lib/node_modules/@microsoft/vscode-dev-containers-cli/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /var/lib/docker/codespacemount/.persistedshare --container-data-folder .vscode-remote/data/Machine --container-system-data-folder /var/vscode-remote --workspace-folder /var/lib/docker/codespacemount/workspace/samples-typescript --id-label Type=codespaces --log-level info --log-format json --config /var/lib/docker/codespacemount/workspace/samples-typescript/.devcontainer/devcontainer.json --override-config /root/.codespaces/shared/merged_devcontainer.json --default-user-env-probe none --mount type=bind,source=/.codespaces/agent/mount/cache,target=/vscode --skip-post-create --update-remote-user-uid-default never --mount-workspace-git-root false
2022-06-15 14:52:49.382Z: Error Code: 1302
2022-06-15 14:52:49.408Z: Container creation failed.
2022-06-15 14:52:49.442Z: 
2022-06-15 14:52:49.473Z: Creating recovery container.

Minimal Reproduction

Try to start a codespace via the button on github

Environment/Versions

github codespaces (8gb ram, 32gb storage)

Additional context

[Bug] --list-samples is an unknown argument for the `@temporalio/create` package

Describe the bug

The documentation identifies --list-samples as an optional arg to the sample creation package. If you try to use this arg, however, the package throws an error saying that it doesn't know what that option is.

To Reproduce

Run npx @temporalio/create@latest hello-world --list-samples or npx @temporalio/create@latest --list-samples from your terminal.

Expected behavior

I expect to see a list of available samples I can bootstrap.

Screenshots/Terminal output

% npx @temporalio/create@latest hello-world --list-samples      
Need to install the following packages:
  @temporalio/create@latest
Ok to proceed? (y) y
ArgError: unknown or unexpected option: --list-samples
    at arg (/Users/rupalivohra/.npm/_npx/84edb3507a773a27/node_modules/arg/index.js:132:13)
    at init (/Users/rupalivohra/.npm/_npx/84edb3507a773a27/node_modules/@temporalio/create/lib/index.js:124:52)
    at Object.<anonymous> (/Users/rupalivohra/.npm/_npx/84edb3507a773a27/node_modules/@temporalio/create/lib/index.js:135:1)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'ARG_UNKNOWN_OPTION'
}

doctoc-2.1.0.tgz: 2 vulnerabilities (highest severity is: 9.8) - autoclosed

Vulnerable Library - doctoc-2.1.0.tgz

Path to dependency file: /package.json

Path to vulnerable library: /node_modules/minimist/package.json

Found in HEAD commit: 3b9bae980eb794fab08e5addef96e9ace5acb327

Vulnerabilities

CVE Severity CVSS Dependency Type Fixed in Remediation Available
CVE-2021-44906 High 9.8 minimist-1.2.5.tgz Transitive N/A
CVE-2020-7753 High 7.5 trim-0.0.1.tgz Transitive N/A

Details

CVE-2021-44906

Vulnerable Library - minimist-1.2.5.tgz

parse argument options

Library home page: https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz

Path to dependency file: /package.json

Path to vulnerable library: /node_modules/minimist/package.json

Dependency Hierarchy:

  • doctoc-2.1.0.tgz (Root Library)
    • minimist-1.2.5.tgz (Vulnerable Library)

Found in HEAD commit: 3b9bae980eb794fab08e5addef96e9ace5acb327

Found in base branch: main

Vulnerability Details

Minimist <=1.2.5 is vulnerable to Prototype Pollution via file index.js, function setKey() (lines 69-95).

Publish Date: 2022-03-17

URL: CVE-2021-44906

CVSS 3 Score Details (9.8)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: None
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: High
    • Integrity Impact: High
    • Availability Impact: High

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: https://github.com/substack/minimist/issues/164

Release Date: 2022-03-17

Fix Resolution: minimist - 1.2.6

CVE-2020-7753

Vulnerable Library - trim-0.0.1.tgz

Trim string whitespace

Library home page: https://registry.npmjs.org/trim/-/trim-0.0.1.tgz

Path to dependency file: /package.json

Path to vulnerable library: /node_modules/trim/package.json

Dependency Hierarchy:

  • doctoc-2.1.0.tgz (Root Library)
    • markdown-to-ast-6.1.7.tgz
      • remark-parse-5.0.0.tgz
        • trim-0.0.1.tgz (Vulnerable Library)

Found in HEAD commit: 3b9bae980eb794fab08e5addef96e9ace5acb327

Found in base branch: main

Vulnerability Details

All versions of package trim are vulnerable to Regular Expression Denial of Service (ReDoS) via trim().

Publish Date: 2020-10-27

URL: CVE-2020-7753

CVSS 3 Score Details (7.5)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: None
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: None
    • Integrity Impact: None
    • Availability Impact: High

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: component/trim#8

Release Date: 2020-10-27

Fix Resolution: trim - 0.0.3

mailgun-js-0.22.0.tgz: 4 vulnerabilities (highest severity is: 9.8)

Vulnerable Library - mailgun-js-0.22.0.tgz

Path to dependency file: /timer-examples/package.json

Path to vulnerable library: /timer-examples/node_modules/pac-resolver/package.json

Found in HEAD commit: 2fe5a211069f374e81470f3eac2dfa6ae7af1a75

Vulnerabilities

CVE Severity CVSS Dependency Type Fixed in Remediation Available
CVE-2021-23406 High 9.8 multiple Transitive N/A
CVE-2021-28918 High 9.1 netmask-1.0.6.tgz Transitive N/A
CVE-2021-43138 High 8.8 async-2.6.3.tgz Transitive N/A
CVE-2021-29418 Medium 5.3 netmask-1.0.6.tgz Transitive N/A

Details

CVE-2021-23406

Vulnerable Libraries - degenerator-1.0.4.tgz, pac-resolver-3.0.0.tgz

degenerator-1.0.4.tgz

Turns sync functions into async generator functions

Library home page: https://registry.npmjs.org/degenerator/-/degenerator-1.0.4.tgz

Path to dependency file: /timer-examples/package.json

Path to vulnerable library: /timer-examples/node_modules/degenerator/package.json

Dependency Hierarchy:

  • mailgun-js-0.22.0.tgz (Root Library)
    • proxy-agent-3.1.1.tgz
      • pac-proxy-agent-3.0.1.tgz
        • pac-resolver-3.0.0.tgz
          • degenerator-1.0.4.tgz (Vulnerable Library)

pac-resolver-3.0.0.tgz

Generates an asynchronous resolver function from a PAC file

Library home page: https://registry.npmjs.org/pac-resolver/-/pac-resolver-3.0.0.tgz

Path to dependency file: /timer-examples/package.json

Path to vulnerable library: /timer-examples/node_modules/pac-resolver/package.json

Dependency Hierarchy:

  • mailgun-js-0.22.0.tgz (Root Library)
    • proxy-agent-3.1.1.tgz
      • pac-proxy-agent-3.0.1.tgz
        • pac-resolver-3.0.0.tgz (Vulnerable Library)

Found in HEAD commit: 2fe5a211069f374e81470f3eac2dfa6ae7af1a75

Found in base branch: main

Vulnerability Details

This affects the package pac-resolver before 5.0.0. This can occur when used with untrusted input, due to unsafe PAC file handling. NOTE: The fix for this vulnerability is applied in the node-degenerator library, a dependency written by the same maintainer.

Publish Date: 2021-08-24

URL: CVE-2021-23406

CVSS 3 Score Details (9.8)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: None
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: High
    • Integrity Impact: High
    • Availability Impact: High

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: GHSA-9j49-mfvp-vmhm

Release Date: 2021-08-24

Fix Resolution: pac-resolver -5.0.0, degenerator - 3.0.1

CVE-2021-28918

Vulnerable Library - netmask-1.0.6.tgz

Parse and lookup IP network blocks

Library home page: https://registry.npmjs.org/netmask/-/netmask-1.0.6.tgz

Path to dependency file: /timer-examples/package.json

Path to vulnerable library: /timer-examples/node_modules/netmask/package.json

Dependency Hierarchy:

  • mailgun-js-0.22.0.tgz (Root Library)
    • proxy-agent-3.1.1.tgz
      • pac-proxy-agent-3.0.1.tgz
        • pac-resolver-3.0.0.tgz
          • netmask-1.0.6.tgz (Vulnerable Library)

Found in HEAD commit: 2fe5a211069f374e81470f3eac2dfa6ae7af1a75

Found in base branch: main

Vulnerability Details

Improper input validation of octal strings in netmask npm package v1.0.6 and below allows unauthenticated remote attackers to perform indeterminate SSRF, RFI, and LFI attacks on many of the dependent packages. A remote unauthenticated attacker can bypass packages relying on netmask to filter IPs and reach critical VPN or LAN hosts.

Publish Date: 2021-04-01

URL: CVE-2021-28918

CVSS 3 Score Details (9.1)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: None
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: High
    • Integrity Impact: High
    • Availability Impact: None

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: GHSA-pch5-whg9-qr2r

Release Date: 2021-04-01

Fix Resolution: netmask - 2.0.1

CVE-2021-43138

Vulnerable Library - async-2.6.3.tgz

Higher-order functions and common patterns for asynchronous code

Library home page: https://registry.npmjs.org/async/-/async-2.6.3.tgz

Path to dependency file: /timer-examples/package.json

Path to vulnerable library: /timer-examples/node_modules/async/package.json,/monorepo-folders/node_modules/async/package.json

Dependency Hierarchy:

  • mailgun-js-0.22.0.tgz (Root Library)
    • async-2.6.3.tgz (Vulnerable Library)

Found in HEAD commit: 2fe5a211069f374e81470f3eac2dfa6ae7af1a75

Found in base branch: main

Vulnerability Details

A vulnerability exists in Async through 3.2.1 (fixed in 3.2.2) , which could let a malicious user obtain privileges via the mapValues() method.

Publish Date: 2022-04-06

URL: CVE-2021-43138

CVSS 3 Score Details (8.8)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: Low
    • User Interaction: None
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: High
    • Integrity Impact: High
    • Availability Impact: High

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: https://nvd.nist.gov/vuln/detail/CVE-2021-43138

Release Date: 2022-04-06

Fix Resolution: async - v3.2.2

CVE-2021-29418

Vulnerable Library - netmask-1.0.6.tgz

Parse and lookup IP network blocks

Library home page: https://registry.npmjs.org/netmask/-/netmask-1.0.6.tgz

Path to dependency file: /timer-examples/package.json

Path to vulnerable library: /timer-examples/node_modules/netmask/package.json

Dependency Hierarchy:

  • mailgun-js-0.22.0.tgz (Root Library)
    • proxy-agent-3.1.1.tgz
      • pac-proxy-agent-3.0.1.tgz
        • pac-resolver-3.0.0.tgz
          • netmask-1.0.6.tgz (Vulnerable Library)

Found in HEAD commit: 2fe5a211069f374e81470f3eac2dfa6ae7af1a75

Found in base branch: main

Vulnerability Details

The netmask package before 2.0.1 for Node.js mishandles certain unexpected characters in an IP address string, such as an octal digit of 9. This (in some situations) allows attackers to bypass access control that is based on IP addresses. NOTE: this issue exists because of an incomplete fix for CVE-2021-28918.

Publish Date: 2021-03-30

URL: CVE-2021-29418

CVSS 3 Score Details (5.3)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: None
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: None
    • Integrity Impact: Low
    • Availability Impact: None

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: https://vuln.ryotak.me/advisories/6.txt

Release Date: 2021-03-30

Fix Resolution: 2.0.1

[Feature Request] Update next ecommerce sample

Is your feature request related to a problem? Please describe.

It's at version 0.4.2

Describe the solution you'd like

Updating to version 0.11.x and removing the first line of the workflow file /* eslint-disable @typescript-eslint/explicit-module-boundary-types */

[Feature Request] Create error-handling sample

Is your feature request related to a problem? Please describe.

Users not knowing how to handle errors: https://temporalio.slack.com/archives/C01DKSMU94L/p1638225730301800

Describe the solution you'd like

Sample with activity failing and maximum attempts reached, catching and reporting the error (perhaps only reporting if isCancellation(e) is false), workflow failing, client catching and inspecting cause.

Additional context

https://docs.temporal.io/docs/typescript/handling-failure

[Feature Request] Log Interceptor demo

Is your feature request related to a problem? Please describe.

What's the recommended way to inject e.g. a winston logger into activities in the Node SDK? The documentation talks a lot about custom logging solutions for workflows and how to inject them through dependencies but it's less clear to me how to best do the same in an activity. I could obviously just inject the logger alongside other "services" (like db connections, etc.) when creating the activities but I was wondering if there was a different recommended way considering the specific mention of logging for workflows in the docs.

Roey Berman 1 day ago
There's a section about sharing dependencies in the activities docs page https://docs.temporal.io/docs/typescript/activities

docs.temporal.iodocs.temporal.io
Activities in TypeScript | Temporal documentation
@temporalio/activity NPM API reference | GitHub source

Roey Berman 1 day ago
Otherwise you can reference a global logger

Sebastian Siemssen 1 day ago
Yeah I know. I am using that approach for all sorts of services (db connections, kafka producers, etc.) but I was wondering if there are any quirks about logging because it gets a honorable mention in the workflow docs

Roey Berman 1 day ago
There's nothing special about activities

Roey Berman 1 day ago
Just use whatever you're used to in any normal nodejs app

Roey Berman 1 day ago
Curious to know what you come up with

Sebastian Siemssen 1 day ago
Cool. Thanks. Any problem with injecting the workflow activity context into the logger default metadata so I can serialize that into my log stream?

Sebastian Siemssen 1 day ago
I find the idea interesting of dynamically logging more verbosely if it's a retry, etc.

Sebastian Siemssen 1 day ago
https://typescript.temporal.io/api/interfaces/activity.info/

typescript.temporal.iotypescript.temporal.io
Interface: Info | Temporal Node.js SDK API Reference
activity.Info

Sebastian Siemssen 1 day ago
Btw. thanks for the super responsive support in here (and on a sunday nonetheless)
🙂
1

Roey Berman 1 day ago
Another thing you might want to do is use activity inbound interceptor with node's asynclocalstorage to create a logger with the relevant activity context

Roey Berman 1 day ago
Interceptors are like middleware so you can automatically log any activity call

Roey Berman 1 day ago
See example here https://docs.temporal.io/docs/typescript/interceptors#interceptor-examples

docs.temporal.iodocs.temporal.io
Interceptors in TypeScript SDK | Temporal documentation
Interceptors are a mechanism for users to modify inbound and outbound SDK calls.

Roey Berman 1 day ago
Just note that the sample refers to workflow outbound and not activity inbound so it's not exactly what you want

Sebastian Siemssen 1 day ago
Cool stuff. Thanks!

Roey Berman 2 hours ago
@shawn Wang worth adding a sample to show this + docs?

Shawn Wang 2 hours ago
nice.. whats the benefit of using interceptor to log vs just share logger dependency? not super clear to me

Shawn Wang 2 hours ago
just so the logging code doesnt clutter up every activity? (edited)
New

Roey Berman 1 hour ago
No, it's so the logger has additional context about the current activity

Roey Berman 1 hour ago
Something like this: https://github.com/winstonjs/winston#creating-child-loggers

[Bug] monorepo-folders example crashes

What are you really trying to do?

Trying to run the monorepo-folders example on my machine following the instructions in the README.

Describe the bug

Got the below error:

[frontend] ℹ 「wds」: Project is running at http://192.168.0.49/
[frontend] ℹ 「wds」: webpack output is served from 
[frontend] ℹ 「wds」: Content not from webpack is served from /home/val/Workspace/temporalio/samples-typescript/monorepo-folders/packages/frontend-ui/public
[frontend] ℹ 「wds」: 404s will fallback to /
[frontend] Starting the development server...
[frontend] 
[worker] /home/val/Workspace/temporalio/samples-typescript/monorepo-folders/node_modules/ts-node/src/index.ts:750
[worker]     return new TSError(diagnosticText, diagnosticCodes);
[worker]            ^
[worker] TSError: ⨯ Unable to compile TypeScript:
[worker] worker.ts(2,29): error TS2307: Cannot find module 'temporal-workflows/lib/all-activities' or its corresponding type declarations.
[worker] 
[worker]     at createTSError (/home/val/Workspace/temporalio/samples-typescript/monorepo-folders/node_modules/ts-node/src/index.ts:750:12)
[worker]     at reportTSError (/home/val/Workspace/temporalio/samples-typescript/monorepo-folders/node_modules/ts-node/src/index.ts:754:19)
[worker]     at getOutput (/home/val/Workspace/temporalio/samples-typescript/monorepo-folders/node_modules/ts-node/src/index.ts:941:36)
[worker]     at Object.compile (/home/val/Workspace/temporalio/samples-typescript/monorepo-folders/node_modules/ts-node/src/index.ts:1243:30)
[worker]     at Module.m._compile (/home/val/Workspace/temporalio/samples-typescript/monorepo-folders/node_modules/ts-node/src/index.ts:1370:30)
[worker]     at Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
[worker]     at Object.require.extensions.<computed> [as .ts] (/home/val/Workspace/temporalio/samples-typescript/monorepo-folders/node_modules/ts-node/src/index.ts:1374:12)
[worker]     at Module.load (internal/modules/cjs/loader.js:950:32)
[worker]     at Function.Module._load (internal/modules/cjs/loader.js:790:12)
[worker]     at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12) {
[worker]   diagnosticText: "worker.ts(2,29): error TS2307: Cannot find module 'temporal-workflows/lib/all-activities' or its corresponding type declarations.\n",
[worker]   diagnosticCodes: [ 2307 ]
[worker] }
[worker] [nodemon] app crashed - waiting for file changes before starting...
[frontend] Compiled successfully!
[frontend] 
[frontend] You can now view frontend-ui in the browser.
[frontend] 
[frontend]   Local:            http://localhost:3000
[frontend]   On Your Network:  http://192.168.0.49:3000
[frontend] 
[frontend] Note that the development build is not optimized.
[frontend] To create a production build, use npm run build.
[frontend] 
[api-server] TypeError: Cannot read property 'QUERY_REJECT_CONDITION_UNSPECIFIED' of undefined
[api-server]     at defaultWorkflowClientOptions (/home/val/Workspace/temporalio/samples-typescript/monorepo-folders/node_modules/@temporalio/client/src/workflow-client.ts:160:70)
[api-server]     at new WorkflowClient (/home/val/Workspace/temporalio/samples-typescript/monorepo-folders/node_modules/@temporalio/client/src/workflow-client.ts:207:25)
[api-server]     at Object.runWorkflow (/home/val/Workspace/temporalio/samples-typescript/monorepo-folders/packages/backend-apis/temporal-client.ts:9:18)
[api-server]     at /home/val/Workspace/temporalio/samples-typescript/monorepo-folders/packages/backend-apis/server.ts:14:41
[api-server]     at Layer.handle [as handle_request] (/home/val/Workspace/temporalio/samples-typescript/monorepo-folders/node_modules/express/lib/router/layer.js:95:5)
[api-server]     at next (/home/val/Workspace/temporalio/samples-typescript/monorepo-folders/node_modules/express/lib/router/route.js:137:13)
[api-server]     at Route.dispatch (/home/val/Workspace/temporalio/samples-typescript/monorepo-folders/node_modules/express/lib/router/route.js:112:3)
[api-server]     at Layer.handle [as handle_request] (/home/val/Workspace/temporalio/samples-typescript/monorepo-folders/node_modules/express/lib/router/layer.js:95:5)
[api-server]     at /home/val/Workspace/temporalio/samples-typescript/monorepo-folders/node_modules/express/lib/router/index.js:281:22
[api-server]     at Function.process_params (/home/val/Workspace/temporalio/samples-typescript/monorepo-folders/node_modules/express/lib/router/index.js:335:12)
[api-server] [nodemon] app crashed - waiting for file changes before starting...
[frontend] Proxy error: Could not proxy request /api/workflow from localhost:3000 to http://localhost:4000.
[frontend] See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (ECONNRESET).
[frontend] 

Minimal Reproduction

monorepo-folders

Environment/Versions

yarn 1.22.17
ubuntu 20.04

  • OS and processor: [e.g. M1 Mac, x86 Windows, Linux] ubuntu 20.04
  • Temporal Version: [e.g. 1.14.0?] and/or SDK version: SDK 0.16.4, temporalio/docker-compose v1.13.1
  • Are you using Docker or Kubernetes or building Temporal from source?

Additional context

[Bug] Need to move workflows.ts to index.ts

Describe the bug

temporalio 0.4.2 will not automatically (workDir) import from workflows.ts - it expects workflows/index.ts

To Reproduce

Steps to reproduce the behavior:

  1. Go to hello-world
  2. Clean checkout and build using node 16
  3. Follow steps in README
  4. See error

Similar with http. Probably others as well, but I didn't look or try.

Expected behavior

Samples work.

Versions

  • OS: Mac
  • Temporal Version 1.12.1

Additional Context

The underlying problem is described in temporalio/sdk-typescript#258

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.