score-compose

WIP, 2 issues currently:
First issue, with placeholders in files section
When running make compose-up, getting this error:
mkdir -p credentials && touch credentials/github-app-backstage-humanitec-credentials.yaml
score-compose generate score.yaml \
        --build 'backstage={"context":".","tags":["backstage:test"]}' \
        --override-property containers.backstage.variables.GITHUB_ORG_ID="" \
        --override-property containers.backstage.variables.GITHUB_APP_CLIENT_ID="" \
        --override-property containers.backstage.variables.GITHUB_APP_CLIENT_SECRET="" \
        --override-property containers.backstage.variables.HUMANITEC_ORG_ID="" \
        --override-property containers.backstage.variables.HUMANITEC_TOKEN="" \
        --override-property containers.backstage.variables.CLOUD_PROVIDER=""
INFO: Overriding 'containers.backstage.variables.GITHUB_ORG_ID' in workload
INFO: Overriding 'containers.backstage.variables.GITHUB_APP_CLIENT_ID' in workload
INFO: Overriding 'containers.backstage.variables.GITHUB_APP_CLIENT_SECRET' in workload
INFO: Overriding 'containers.backstage.variables.HUMANITEC_ORG_ID' in workload
INFO: Overriding 'containers.backstage.variables.HUMANITEC_TOKEN' in workload
INFO: Overriding 'containers.backstage.variables.CLOUD_PROVIDER' in workload
INFO: Loaded state directory with docker compose project 'backstage'
INFO: Validated workload 'backstage'
INFO: Successfully loaded 12 resource provisioners
INFO: postgres.default#backstage.db: postgres.default#backstage.db: To connect to postgres, enter password 'R95Y1xHBPFeAfJWs' at: "docker run -it --network backstage_default --rm postgres:17-alpine psql -h pg-HFeITA -U user-byiOUWIa --dbname db-eVdopSAX"
INFO: route.default#backstage.route: route.default#backstage.route: To connect to this route, http://dnsfe3o2x.localhost:8080/ (make sure dnsfe3o2x.localhost resolves to localhost)
INFO: Provisioned 5 resources
INFO: Converting workload 'backstage' to Docker compose
Error: failed to convert workload 'backstage' to Docker compose: containers.backstage.files[0]: failed to substitute in content: invalid ref 'resources.env.GITHUB_APP_ID': environment variable 'GITHUB_APP_ID' must be resolved
invalid ref 'resources.env.GITHUB_APP_CLIENT_ID': environment variable 'GITHUB_APP_CLIENT_ID' must be resolved
invalid ref 'resources.env.GITHUB_APP_CLIENT_SECRET': environment variable 'GITHUB_APP_CLIENT_SECRET' must be resolved
invalid ref 'resources.env.GITHUB_APP_WEBHOOK_SECRET': environment variable 'GITHUB_APP_WEBHOOK_SECRET' must be resolved
invalid ref 'resources.env.GITHUB_APP_PRIVATE_KEY': environment variable 'GITHUB_APP_PRIVATE_KEY' must be resolved
make: *** [Makefile:24: compose.yaml] Error 1

Second issue, when running the Backstage container, permission denied to create the backstage_plugin_app
If passing the previous issue by having $$, now the containers will run when running make compose-up:
...
[+] Running 5/5
 ✔ Container backstage-pg-HFeITA-1            Healthy                                                                                1.3s
 ✔ Container backstage-routing-UghS7c-1       Running                                                                                0.0s
 ✔ Container backstage-pg-HFeITA-init-1       Exited                                                                                1.3s
 ✔ Container backstage-wait-for-resources-1   Exited                                                                                2.0s
 ✔ Container backstage-backstage-backstage-1  Started

But the Backstage container will fail at runtime with this error as it needs to create a database:
Loading config from MergedConfigSource{FileConfigSource{path="/app/app-config.yaml"}, FileConfigSource{path="/app/app-config.production.yaml"}, EnvConfigSource{count=3}}
{"level":"info","message":"Found 1 new secrets in config that will be redacted","service":"backstage"}
{"level":"info","message":"Listening on :7007","service":"rootHttpRouter"}
{"level":"info","message":"Plugin initialization started: 'app', 'proxy', 'techdocs', 'auth', 'catalog', 'permission', 'search', 'scaffolder', 'humanitec'","service":"backstage","type":"initialization"}
{"level":"error","message":"Plugin 'app' thew an error during startup, waiting for 8 other plugins to finish before shutting down the process","service":"backstage","type":"initialization"}
/app/node_modules/@backstage/backend-defaults/dist/entrypoints/database/connectors/postgres.cjs.js:143
        throw new Error(
              ^

Error: Failed to connect to the database to make sure that 'backstage_plugin_app' exists, error: CREATE DATABASE "backstage_plugin_app" - permission denied to create database
    at PgConnector.getClient (/app/node_modules/@backstage/backend-defaults/dist/entrypoints/database/connectors/postgres.cjs.js:143:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v20.18.1

The first issue is because score-compose's default environment provisioner tries to use the shell environment variables at deploy time. However we can't template those into the mounted file at deploy time. The solution here is generally to set a custom environment provisioner from your makefile and import it at score-compose init time.
The second issue I've cut https://github.com/score-spec/score-compose/issues/219 for.

Ready for your review to be merged, thanks!


Fix #2573 by removing duplicated templates from topic.xsl

Signed-off-by: Shane Taylor<EMAIL_ADDRESS>

These changes were originally submitted for 2.4.3 in #2574 and approved there, but never merged.
The commit has been rebased onto the hotfix/2.4.4 branch, so this PR should be ready for inclusion in 2.4.4.

This actually removes the wrong template. topic.xsl has the new one, whereas the get-meta.xsl has old XHTML one. The correct fix is to move the templates from topic.xsl into get-meta.xsl.

I'll make that change.


Change error with exceptions

Description
I changed error with Exceptions
Issue
Solves #88
TODO:

[ ] Handle exceptions in the dotenv application

@sestrella Would you mind taking a look again, please?


Fix Bugs

Fix #201, fix #196, fix #204, fix #203, fix #207, fix #206

I've run test locally, and all tests except doc test passes.


HOP-3789

Following this checklist to help us incorporate your contribution quickly and easily:

[x] Make sure there is a JIRA issue filed
for the change (usually before you start working on it).  Trivial changes like typos do not
require a JIRA issue.  Your pull request should address just this issue, without pulling in other changes.
[x] Each commit in the pull request should have a meaningful subject line and body.
[x] Format the pull request title like [HOP-XXX] - Fixes bug in SessionManager,
where you replace HOP-XXX with the appropriate JIRA issue. Best practice
is to use the JIRA issue title in the pull request title and in the first line of the commit message.
[x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
[x] Run mvn clean install apache-rat:check to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.
[x] If you have a group of commits related to the same change, please squash your commits into one and force push your branch using git rebase -i.

Trivial changes like typos do not require a JIRA issue (javadoc, comments...).
In this case, just format the pull request title like (DOC) - Add javadoc in SessionManager.
If this is your first contribution, you have to read the Contribution Guidelines
If your pull request is about ~20 lines of code you don't need to sign an Individual Contributor License Agreement
if you are unsure please ask on the developers list.
To make clear that you license your contribution under the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

[x] I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004
[x] In any other case, please file an Apache Individual Contributor License Agreement.

Will this not impact multiple copies of the pipeline executor?

Each copy of the PipelineExecutor refers to a specific execution thread, and the lock we are setting with ReentrandLock is at thread level. I understood what you are saying. Well the answer could be yes, but we didn't tried it. Theoretically each copy that is executing will have it's own version of the lock because they are different threads.


is it possible to play faster than realtime and to record to a .wav file ?

Hello
I'm using raudio for a project, and I would like to have the ability to 'render' a wav file faster than realtime.
What I have done for now is to modify raudio_standalone.c example, and save the pFramesOut content to wav, at the end of OnSendAudioDataToDevice.
So I can save raylib output to .wav, but the rendering time is still the real time.
What I'd like to do now is to call OnSendAudioDataToDevice() manually, and save the output data to .wav.
When I tried this, I get some output but it sounds like very small buffers repeated again and again.
Is there anything else I have to do to 'simulate' the callback from miniAudio, except calling it ?
Thanks for you help

@cyberic99 It depends on what you are trying to do but you can load the full file as a Wave and just process it manually.
Once processed, it can be saved as a .wav or .qoa with ExportWave().

Hello @raysan5 maybe I wasn't clear enough.
I'd like to use raudio to mix different sounds together, and save the result to wave.
And I would like to do it as fast as possible

@cyberic99 Then, the fastest way to do it is just load all required sound data as Wave, mix it and save the result with with ExportWave(). This is the fastest way.

thank you @raysan5 . I found no way to call raudio mixing routines programmatically without calling InitAudioDevice(), is there a way ?


Mexican number normalization

Imported from Google Code issue #273 created by Elaaboudi.Meriem on 2013-05-14T15:58:49.000Z:

What steps will reproduce the problem?
1.Enter a normalized mexican phone number for example :<PHONE_NUMBER>11
What is the expected output? What do you see instead?
Expected Result from getNumberType() = MOBILE but was FIXED
What version of the product are you using? On what operating system?
libphonenumber demo
Please provide any additional information below.
In the file attached that comes from this site : http://dset01.cft.gob.mx/numeracion.exe/w_vip we can see that the number should be recognized as MOBILE.

Issue #902 has been merged into this issue.

Duplicate of issue #132


Abbreviate PhasedXPowGate circuit representation as PhX

PhasedX(0.123)^0.456 makes the circuit diagrams really long. I propose changing it to PhX(0.123)^0.456

I wonder how confused people are by "phased"?  The one reason I don't like it is that it is a basis dependent concept, i.e. it means phased in Z basis.  RotXY, for example, would generalize to other two pauli rotations nicely, RotYZ, RotXZ.  On the other hand for qubits that are clocks it really is a natural gate.

But I do like PhX.

PhasedXPowGate certainly was not obvious to me at first but yeah I'm mainly concerned about circuit diagram width :)

Sounds good to me.

can you please assign it to me. I will have a look.

Hi,
I can see reference to PhasedX has been spread across below listed file. which includes docstring as well.
let me know if it's ok changed all of them.
cirq/circuits/circuit_test.py
cirq/google/convert_to_xmon_gates_test.py
cirq/neutral_atoms/convert_to_neutral_atom_gates_test.py
cirq/ops/moment.py
cirq/ops/phased_x_gate.py
cirq/ops/phased_x_gate_test.py
cirq/optimizers/decompositions.py
cirq/optimizers/eject_phased_paulis.py
cirq/optimizers/merge_single_qubit_gates.py
cirq/optimizers/two_qubit_decompositions_test.py
cirq/protocols/decompose_protocol.py

Where do you see PhasedX in moment.py?
You should only change PhasedX to PhX in strings that are circuit diagrams or circuit diagram info.

ahh apologies,  moment.py wasn't part of it. I will follow your instructions.


Accept OPTIONS formatted with single quotes for SAI analyzer config

This PR increases the acceptable syntax for configuring SAI analyzers. The current formatting requires correctly escaped double quotes around all JSON keys and string values. After this change, it will be possible to use single quotes without escaping when combined with the $$ string literal wrapper. It will also be possible to optionally drop the quotes from the JSON keys. See the test for further explanation and for examples of correctly and incorrectly formatted options.

How much of the Json class do we use in the analyzer?
It might be cleaner to pull out what we use to a separate class instead of adding options to the existing one. I'm okay either way. #collaborating

I think it makes sense to move the new object mapper to the JSONAnalyzerParser to limit the scope of this change. The Json class is documented as Term-related classes for INSERT JSON support., which further supports making this a more local change. Does that match what you're thinking?

Yes

Since we were able to implement built in analyzers, I think we should defer adding additional ways to configure the custom analyzers for now. If we find that we need this, we can re-open the PR and resolve the conflicts.


MNIST:Enable ttnn Support

Enable support for MNIST model using TTNN ops.

Closing this. Tracked in #13329


Date (resp. time) of modification is (still) wrong

I saw #836 and #773, these were closed since this should be fixed, but in version 1.0 I still see this wrong behaviour.
Describe the bug
I'm using Windows 10 with German language and my time is set to UTC +01:00.
Now, when looking at the date of modification from files/folders I see that Files shows the wrong date of modification (it is one or two hours before the real time).
Expected behavior
Date of modification should be correct.
Screenshots
This is a screenshot form the System32 folder, on the left in the Windows Explorer and on the right from Files

Desktop:

OS Version: Windows 10 20H2 Build 19042.685
App version: <IP_ADDRESS> - <IP_ADDRESS>

Log file
debug.txt

+1

+1

+1

+1

This issue is still in <IP_ADDRESS>. I will look back later.

OK, I found this issue has been fixed in latest "main" branch.

@PMExtra
So this will be fixed with the next release?

@Ein-Tim As it should be, but I couldn't find which commit fixed the problem.

@yaichenbaum I couldn't find any commit that about this issue after tag 1.3. But it really has been fixed in master but 1.3 not.
Could you check why this happens? Then you can close this issue if it has been really fixed.

@PMExtra
This is fixed if you choose "Application" in the "Appearance" settings, but if you set it to system, you'll see that the time still differs from the one shown in the explorer:
Having the time on my machine set to UTC +1, but seems like files is showing just the UTC time (or some other time, since the time sometimes differ more than one hour.

@Ein-Tim Thanks for your analysis.  I will dig it later.

@Ein-Tim This issue should be resolved with #3776.

@yaichenbaum
So this will be part of the next release, correct?
@PMExtra
Thanks for fixing!

What release will this be in? I'm seeing this issue in <IP_ADDRESS>

@stevenbrix It'll be part of the v2 release, we don't have any timeline on when that will though. But if you're up to it, you can join the preview flight.


Create QApplication on demand in viewer.Window, add run_app function

Description
This PR does 3 things:

moves all QApplication() creation logic from qt_main_window.Window.__init__ to _qt.event_loop.get_app.
calls get_app in Window.__init__, thereby creating a QApplication if one does not already exist (thus removing the need for the exception warning that an app must be created, and removing the mandate for a gui_qt context prior to Viewer creation)
Adds a napari.run_qt_app function that starts the event loop... with the added bonus that if there is nothing to show (i.e. no top level widgets) then run_qt_app will just show a warning and do nothing (preventing confusing blocking events with nothing shown).

all told, this allows:
import napari

viewer = napari.Viewer()

napari.run_app()

lots more can and should be done surrounding our handling of the app, and context-dependent showing of the viewer...  but that will be for follow up PRs.
Depending on the merge order of this and #2055, one of the two will need to be modified slightly
Type of change

[x] New feature (non-breaking change which adds functionality)

How has this been tested?

[ ] the test suite for my feature covers cases x, y, and z
[ ] all tests pass with my change

side note: this is a step towards making #2029 a little clearer, for example now:
In [3]: import napari
   ...:
   ...: viewer = napari.Viewer()
   ...: viewer.close()
   ...:
   ...: napari.run_app()
/Users/talley/Dropbox (HMS)/Python/forks/napari/napari/_qt/event_loop.py:125: UserWarning:
Refusing to run a QtApplication with no topLevelWidgets(). To run the app anyway, use `run_app(force=True)`

note, removed the test_no_qt_loop test which was the only thing requiring pytest-ordering, so removed that too

I've gone ahead and merged #2055, probably worth waiting for @jni to catch up before going too deep into this one as I see it as more of a feature addition than pure refactor. Thoughts?

yep, waiting for @jni is fine here

I definitely love this idea, but:
In [2]: with napari.gui_qt():
   ...:     viewer = napari.Viewer()
   ...:     viewer.close()
   ...:
/Users/talley/Dropbox (HMS)/Python/forks/napari/napari/_qt/event_loop.py:125: UserWarning:
Refusing to run a QtApplication with no topLevelWidgets().
To run the app anyway, use `run_app(force=True)`

I find this super super unclear, since the user did not call run_app at all. In fact, an existing user, already used to the context manager, would have no idea about the namespace in which to find run_app.
Overall, though, I really like this design, brings us much closer to e.g. the matplotlib model of plt.show() which many people are familiar with. Would be excited to get this in for 0.4.3!

I definitely love this idea, but:
In [2]: with napari.gui_qt():
   ...:     viewer = napari.Viewer()
   ...:     viewer.close()
   ...:
/Users/talley/Dropbox (HMS)/Python/forks/napari/napari/_qt/event_loop.py:125: UserWarning:
Refusing to run a QtApplication with no topLevelWidgets().
To run the app anyway, use `run_app(force=True)`

I find this super super unclear, since the user did not call run_app at all. In fact, an existing user, already used to the context manager, would have no idea about the namespace in which to find run_app.
Overall, though, I really like this design, brings us much closer to e.g. the matplotlib model of plt.show() which many people are familiar with. Would be excited to get this in for 0.4.3!

I find this super super unclear, since the user did not call run_app at all

agreed, lemme just change the string based on calling context

I find this super super unclear, since the user did not call run_app at all

agreed, lemme just change the string based on calling context

@jni, lemme know if you're ok with this fix to the warning message  (could try to do something clever with inspect.stack but that feels like overkill

@jni, lemme know if you're ok with this fix to the warning message  (could try to do something clever with inspect.stack but that feels like overkill

This is really great @tlambert03, thanks for the helpful detail in https://github.com/napari/napari/pull/2056#discussion_r550924887 too. I really see napari.run_app as becoming the main way people will launch napari and that we can slowly deprecate napari.gui_qt context manager. I'll probably start switching my own code after this is released.
Given how important this method will become, how do people feel about just napari.run() instead of napari.run_app(). I don't think we need the _app, as I'm not sure we'll have another napari.run_ method. In which case I prefer the simpler no _ version.
napari.show() or napari.launch() would be other options that i'd be fine with
In general having as simple a name as possible would be nice. @tlambert03 @jni @GenevieveBuckley @kevinyamauchi ?

This is really great @tlambert03, thanks for the helpful detail in https://github.com/napari/napari/pull/2056#discussion_r550924887 too. I really see napari.run_app as becoming the main way people will launch napari and that we can slowly deprecate napari.gui_qt context manager. I'll probably start switching my own code after this is released.
Given how important this method will become, how do people feel about just napari.run() instead of napari.run_app(). I don't think we need the _app, as I'm not sure we'll have another napari.run_ method. In which case I prefer the simpler no _ version.
napari.show() or napari.launch() would be other options that i'd be fine with
In general having as simple a name as possible would be nice. @tlambert03 @jni @GenevieveBuckley @kevinyamauchi ?

Given how important this method will become, how do people feel about just napari.run() instead of napari.run_app(). I don't think we need the app, as I'm not sure we'll have another napari.run method. In which case I prefer the simpler no _ version.

yeah, very much open to napari.run! Show matches plt.show() ... but I think .show() should stay on the viewer itself, rather than napari.show(), though in future PRs we can make viewer.show() block and run the app depending on the context?
let's hear from @jni @GenevieveBuckley @kevinyamauchi

Given how important this method will become, how do people feel about just napari.run() instead of napari.run_app(). I don't think we need the app, as I'm not sure we'll have another napari.run method. In which case I prefer the simpler no _ version.

yeah, very much open to napari.run! Show matches plt.show() ... but I think .show() should stay on the viewer itself, rather than napari.show(), though in future PRs we can make viewer.show() block and run the app depending on the context?
let's hear from @jni @GenevieveBuckley @kevinyamauchi

On run vs run_app, it's an interesting one, on an intellectual level I agree simple is better, but on a visceral level, for some reason, run feels incomplete. Maybe this has something to do with it? 😂 So, I'm weakly on the run_app side of the fence for now... But I would not veto run().
On the other end, viewer.show() is nice but it might also be confusing — what happens when you instantiate two viewers, and then you do viewer1.show()? Do they both show?

On run vs run_app, it's an interesting one, on an intellectual level I agree simple is better, but on a visceral level, for some reason, run feels incomplete. Maybe this has something to do with it? 😂 So, I'm weakly on the run_app side of the fence for now... But I would not veto run().
On the other end, viewer.show() is nice but it might also be confusing — what happens when you instantiate two viewers, and then you do viewer1.show()? Do they both show?

what happens when you instantiate two viewers, and then you do viewer1.show()? Do they both show?

oof... good question!  it could be that way if we make viewer.visible false by default?  I think we will be able to do something with viewer.show ... but if someone has instantiated (and shown) multiple viewers without an event loop, we still need some sort of global napari.run* command

what happens when you instantiate two viewers, and then you do viewer1.show()? Do they both show?

oof... good question!  it could be that way if we make viewer.visible false by default?  I think we will be able to do something with viewer.show ... but if someone has instantiated (and shown) multiple viewers without an event loop, we still need some sort of global napari.run* command

yeah, my vote is napari.run() and we can decide viewer.show later

yeah, my vote is napari.run() and we can decide viewer.show later

i'm pretty solidly neutral here.  I just changed it to run and pushed.  Would be nice to merge so we can also address #2065 ... but if anyone comes up with newer/stronger feelings about run vs run_app or any alternative, we have a few days to change it

i'm pretty solidly neutral here.  I just changed it to run and pushed.  Would be nice to merge so we can also address #2065 ... but if anyone comes up with newer/stronger feelings about run vs run_app or any alternative, we have a few days to change it

Ok, thanks @tlambert03 I'm going to merge this now as it sounds like there is no strong opposition to run. We can still adjust in follow up PRs before release too!

Ok, thanks @tlambert03 I'm going to merge this now as it sounds like there is no strong opposition to run. We can still adjust in follow up PRs before release too!


Recipe validation error in org.openrewrite.java.security.JavaSecurityBestPractices

https://github.com/openrewrite/rewrite/blob/main/rewrite-java/src/main/resources/META-INF/rewrite/security-bugs.yml refers to a recipe that doesn't exist: org.openrewrite.java.security.ResultOfFileMkdirsIgnored
It might be nice to have some unit tests that verify declarative recipes.

Good catch and thanks for reporting, @murdos. Agreed we should add some verification of declarative recipes as part of our standard testing.


TimeoutError: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?

Environment
Knex version: 0.15.2
Database: sqlite3
OS: Ubuntu 18
I'm getting lots of errors like TimeoutError: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?
Any ideas? All my code lives in this one file: https://github.com/umaar/wiki-globe/blob/master/index.js - that code powers this globe which I posted in a Hacker News comment and in turn led to the discovery of such error.
An example query looks like this:
await knex('edits').insert([{
	field1: JSON.stringify(data),
	field2: 'field2'
}]);

Does sqlite3 only allow a single connection to it because it's file-based? I'll try adding .transacting() calls to see if that makes a difference.
I guess it comes down to: some technical limitation with sqlite3 (maybe lack of pooling?) or some badly written code DB/queries on my part! Any insight you have would be much appreciated, thanks!

From the documentation:
The client created by the configuration initializes a connection pool, using the generic-pool library. This connection pool has a default setting of a min: 2, max: 10 for the MySQL and PG libraries, and a single connection for sqlite3 (due to issues with utilizing multiple connections on a single file). To change the config settings for the pool, pass a pool option as one of the keys in the initialize block.

So if you're using sqlite3 you will run into issues with more than 1 connection.

Oh got it, so the issue is: many clients are backed up in a queue waiting for a single available connection to sqlite3, but the timeout passes and that error is thrown? As a quick fix for a hobby project, I wonder if it's acceptable to simply increase the timeout

I am facing this issue though i am just trying to create a table in sample project , only one client is connected still this error , Any fix for this ?

+1 having this issue too

@tahv0 there are 100 different reasons why that might happen, so you need to find out how to reproduce the problem. Probably by then you will also see why that is happening.

Knex version: 0.15.2
Database: MySQL 8
OS: MacOSX
I'm having the same connection issue when I run "knex migrate:latest", and have scoured google with no luck. I've tested connections between Node and MySQL with a simple SQL script and that's connecting fine. Initially there was an authentication issue with the connection which I was able to resolve by altering the user privileges with 'mysql_native_password'. However I was unable to get the connection going.
I know this can be anything, so here's all the code I have for this project.
knexfile.js
`require('dotenv').config();
module.exports = {
development: {
client: 'mysql2',
connection: {
port: process.env.db_port,
host: process.env.db_host,
database: process.env.db_name,
user: process.env.db_user,
password: process.env.db_key,
connectTimeout: 90000
},
debug: true,
pool: {
min: 1,
max: 20,
},
migrations: {
directory: __dirname + '/knex/migrations',
},
seeds: {
directory: __dirname + '/knex/seeds',
},
}
};
knex.jsrequire('dotenv').config();
const env = process.env.environment || 'development'
const config = require('../knexfile.js')[env];
const knex = require('knex')(config);
module.exports = knex;`
server.js
`require('dotenv').config();
const express = require('express');
const bodyParser = require("body-parser");
const path = require('path');
const PORT = process.env.db_port || 3002;
const knex = require('../knex/knex.js');
const app = express();
app.use((req, res, next) => {
res.header("Access-Control-Allow-Origin", "*");
res.header(
"Access-Control-Allow-Headers",
"Origin, X-Requested-With, Content-Type, Accept"
);
res.header("Access-Control-Allow-Methods", "GET,PUT,POST,DELETE");
next();
});
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.use(express.static(${__dirname}/../client/dist, { maxAge: "365d" }));
app.listen(PORT, () => {
console.log(listening on port: ${PORT});
});`
migration file
`exports.up = function(knex, Promise) {
return knex.schema.createTable('sdcapstone', (t) => {
t.increments('_id').primary().unique();
t.string('name').notNullable();
t.integer('rating');
t.integer('reviewCount');
t.integer('itemNum').notNullable();
t.integer('price').notNullable();
t.string('mainImage');
t.json('images');
})
};
exports.down = function(knex, Promise) {
return knex.schema.dropTable('sdcapstone');
};`
Here is the result of a console log of "knex" from knex.js
{ [Function: knex]   Promise:     { [Function: Promise]      TypeError: [Function: TypeError],      RangeError: [Function: RangeError],      CancellationError: [Function: SubError],      TimeoutError: [Function: SubError],      OperationalError: [Function: OperationalError],      RejectionError: [Function: OperationalError],      AggregateError: [Function: SubError],      _peekContext: [Function],      onPossiblyUnhandledRejection: [Function],      onUnhandledRejectionHandled: [Function],      longStackTraces: [Function],      hasLongStackTraces: [Function],      config: [Function],      getNewLibraryCopy: [Function],      is: [Function],      fromCallback: [Function],      fromNode: [Function],      all: [Function],      cast: [Function],      fulfilled: [Function],      resolve: [Function],      rejected: [Function],      reject: [Function],      setScheduler: [Function],      pending: [Function],      defer: [Function],      method: [Function],      try: [Function],      attempt: [Function],      bind: [Function],      PromiseInspection: [Function: PromiseInspection],      join: [Function],      Promise: [Circular],      version: '3.5.2',      map: [Function],      using: [Function],      delay: [Function],      coroutine: { [Function] addYieldHandler: [Function] },      spawn: [Function],      promisify: [Function],      promisifyAll: [Function],      props: [Function],      race: [Function],      reduce: [Function],      settle: [Function],      some: [Function],      _SomePromiseArray: [Function: SomePromiseArray],      filter: [Function],      each: [Function],      mapSeries: [Function: PromiseMapSeries],      any: [Function],      noConflict: [Function: noConflict] },   queryBuilder: [Function: queryBuilder],   raw: [Function: raw],   batchInsert: [Function: batchInsert],   transaction: [Function: transaction],   initialize: [Function: initialize],   destroy: [Function: destroy],   ref: [Function: ref],   domain: null,   _events: {},   _eventsCount: 0,   _maxListeners: undefined,   setMaxListeners: [Function: setMaxListeners],   getMaxListeners: [Function: getMaxListeners],   emit: [Function: emit],   addListener: [Function: addListener],   on: [Function: addListener],   prependListener: [Function: prependListener],   once: [Function: once],   prependOnceListener: [Function: prependOnceListener],   removeListener: [Function: removeListener],   removeAllListeners: [Function: removeAllListeners],   listeners: [Function: listeners],   listenerCount: [Function: listenerCount],   eventNames: [Function: eventNames],   with: [Function],   select: [Function],   as: [Function],   columns: [Function],   column: [Function],   from: [Function],   fromJS: [Function],   into: [Function],   withSchema: [Function],   table: [Function],   distinct: [Function],   join: [Function],   joinRaw: [Function],   innerJoin: [Function],   leftJoin: [Function],   leftOuterJoin: [Function],   rightJoin: [Function],   rightOuterJoin: [Function],   outerJoin: [Function],   fullOuterJoin: [Function],   crossJoin: [Function],   where: [Function],   andWhere: [Function],   orWhere: [Function],   whereNot: [Function],   orWhereNot: [Function],   whereRaw: [Function],   whereWrapped: [Function],   havingWrapped: [Function],   orWhereRaw: [Function],   whereExists: [Function],   orWhereExists: [Function],   whereNotExists: [Function],   orWhereNotExists: [Function],   whereIn: [Function],   orWhereIn: [Function],   whereNotIn: [Function],   orWhereNotIn: [Function],   whereNull: [Function],   orWhereNull: [Function],   whereNotNull: [Function],   orWhereNotNull: [Function],   whereBetween: [Function],   whereNotBetween: [Function],   andWhereBetween: [Function],   andWhereNotBetween: [Function],   orWhereBetween: [Function],   orWhereNotBetween: [Function],   groupBy: [Function],   groupByRaw: [Function],   orderBy: [Function],   orderByRaw: [Function],   union: [Function],   unionAll: [Function],   having: [Function],   havingRaw: [Function],   orHaving: [Function],   orHavingRaw: [Function],   offset: [Function],   limit: [Function],   count: [Function],   countDistinct: [Function],   min: [Function],   max: [Function],   sum: [Function],   sumDistinct: [Function],   avg: [Function],   avgDistinct: [Function],   increment: [Function],   decrement: [Function],   first: [Function],   debug: [Function],   pluck: [Function],   clearSelect: [Function],   clearWhere: [Function],   clearOrder: [Function],   insert: [Function],   update: [Function],   returning: [Function],   del: [Function],   delete: [Function],   truncate: [Function],   transacting: [Function],   connection: [Function],   client:     Client_MySQL {      config:        { client: 'mysql',         connection: [Object],         debug: true,         pool: [Object],         migrations: [Object],         seeds: [Object],         log: [Object] },      logger:        Logger {         _debug: [Function: debug],         _warn: [Function: warn],         _error: [Function: error],         _deprecate: [Function: deprecate] },      connectionSettings:        { port: '3001',         host: 'localhost',         database: redacted,         user: redacted,         password: redacted },      driver:        { createConnection: [Function: createConnection],         createPool: [Function: createPool],         createPoolCluster: [Function: createPoolCluster],         createQuery: [Function: createQuery],         escape: [Function: escape],         escapeId: [Function: escapeId],         format: [Function: format],         raw: [Function: raw] },      pool:        Pool {         creator: [Function: create],         destroyer: [Function: destroy],         validate: [Function: validate],         log: [Function],         acquireTimeoutMillis: 60000,         createTimeoutMillis: 30000,         idleTimeoutMillis: 30000,         reapIntervalMillis: 1000,         createRetryIntervalMillis: 200,         propagateCreateError: true,         min: 0,         max: 20,         used: [],         free: [],         pendingCreates: [],         pendingAcquires: [],         destroyed: false,         interval: null },      valueForUndefined:        Raw {         client: [Circular],         sql: 'DEFAULT',         bindings: undefined,         _wrappedBefore: undefined,         _wrappedAfter: undefined,         _debug: true },      _events:        { start: [Function],         query: [Function],         'query-error': [Function],         'query-response': [Function] },      _eventsCount: 4,      makeKnex: [Function: makeKnex] } }

Update, I've reverted back to MySQL version 5.7.24 and I'm still getting the same timeout error

@tahv0 there are 100 different reasons why that might happen, so you need to find out how to reproduce the problem. Probably by then you will also see why that is happening.

For me this was Google Cloud specific problem, because one can not take connection from GAE to Google SQL with public IP. I fixed problem by reading some more docs.

The attribute propagateCreateError should be set to false to prevent the Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call? error.
Example pool configuration:
"pool": {
  "min": 2,
  "max": 6,
  "createTimeoutMillis": 3000,
  "acquireTimeoutMillis": 30000,
  "idleTimeoutMillis": 30000,
  "reapIntervalMillis": 1000,
  "createRetryIntervalMillis": 100,
  "propagateCreateError": false // <- default is true, set to false
},

Explanation:
The propagateCreateError is set to true by default in Knex and throws a TimeoutError if the first create connection to the database fails, preventing tarn (the connection pool manager) from re-connecting automatically.
The solution is to set propagateCreateError to false thus enabling knex to automatically reconnect on create connection failure instead of throwing the error.
AuroraDB:
In case you are connecting to an AuroraDB instance, currently it has a very long startup time, causing the TimeoutError on every new cold-start, to fix this, set AWS Console -> RDS -> AuroraDB Instance -> Pause compute capacity after consecutive minutes of inactivity: 1440 hours to prevent the database from going to sleep completely.
Also related issues:
#1381 #1382 #1655 #2445 https://github.com/strapi/strapi/issues/2790 #1875 #1909 #2302 #2141 #1264

@guerrerocarlos please open bug report with some reproduction steps if you think there is a bug

We are also having this issues is "propagateCreateError": false a real solution seems this should be handled by library itself.

@mjurincic please bug report if you think its a bug... I have no idea what are you talking about

@tahv0 there are 100 different reasons why that might happen, so you need to find out how to reproduce the problem. Probably by then you will also see why that is happening.

For me this was Google Cloud specific problem, because one can not take connection from GAE to Google SQL with public IP. I fixed problem by reading some more docs.

@tahv0 I am having the same issue with Google Cloud. Can you share the docs that helped you fix this problem?

@ashanker2
this doc is for Postgres https://cloud.google.com/appengine/docs/flexible/nodejs/using-cloud-sql-postgres

@ashanker2
this doc is for Postgres https://cloud.google.com/appengine/docs/flexible/nodejs/using-cloud-sql-postgres

@tahv0 Thank you for the doc. Seems like we have incorporated these steps in our setup but will verify it again. Is there anything specific you had to do to fix this problem?

@ashanker2 Does your code work with locally installed postgresql server?

@ashanker2
I fixed problem by using
config.host = /cloudsql/${process.env.INSTANCE_CONNECTION_NAME};
and not ip&port. GAE mounts tcp/unix socket to a container when you have configured Cloud SQL instance. There may be a problem if db is in different region than service that uses it and you may need to use this beta_settings-flag in your .yaml like in the docs.

@ashanker2
I fixed problem by using
config.host = /cloudsql/${process.env.INSTANCE_CONNECTION_NAME};
and not ip&port. GAE mounts tcp/unix socket to a container when you have configured Cloud SQL instance. There may be a problem if db is in a different region than service that uses it and you may need to use this beta_settings-flag in your .yaml like in the docs.

@tahv0 Thank you. It worked with INSTANCE_CONNECTION_NAME instead of Host & Port.

@tahv0 there are 100 different reasons why that might happen, so you need to find out how to reproduce the problem. Probably by then you will also see why that is happening.

For me this was Google Cloud specific problem, because one can not take connection from GAE to Google SQL with public IP. I fixed problem by reading some more docs.

Facing the same knex timeout error problem while deploying a dockerized application on Cloud Run. Any ideas?

I solved this problem with these versions:
"knex": "^0.21.1",
"objection": "^2.1.3",
"pg": "^8.0.3"

@batadamnjanovic Thank you so much!  Upgrading to the latest pg did the trick.

for me it was a silly error, I ended up not putting the await trx.commit () before the return

@joaotanaca Good way to avoid that error is to use implicit commit/rollback style of transactions
await knex.transaction(async trx => {
  // use trx here... if handler rejects, transaction will be rolled back if it returns, transaction will be automatically committed
});

I didn't end up checking the transaction method, thank you very much

@joaotanaca Good way to avoid that error is to use implicit commit/rollback style of transactions
await knex.transaction(async trx => {
  // use trx here... if handler rejects, transaction will be rolled back if it returns, transaction will be automatically committed
});

I didn't end up checking the transaction method, thank you very much

i am getting this on a small not-yet-public site with no more than 1-2 connections at a time and im not using transactions, on postgres
nothing about my setup is particularly complicated, and the db isn't very big

@rossPatton try to isolate the exact case where it is happening and then you might find what is wrong in your app. Maybe your queries are really slow. Anyways that error is pretty hard to create without flooding huge amount of queries or using transactions.

This issue popped up for me today on a a very simple and small project that has been working fine for weeks and whose code hasn't changed in weeks. I am not doing any transactions and there was never more than 2 connections, and those only had to handle less than 10 very small queries a day.  The only thing that I could find to fix this was to upgrade to the latest version of Knex. As soon as I did that this issue went away, but I'm left feeling a little nervous as I don't understand what could have caused the issue for me in the first place.

@jj0b What was the old version of knex you were using? For example one old bug which caused connections closed by the server, because of timeout to be not rejected from pool, could have caused that kind of behavior.
To be sure for your use case is probably good to set pool min: 0 and connection idle timeout to be smaller than connection timeout of the server (few minutes).

@elhigu I had been using knex 0.20.15.
My Express server had been running fine for weeks, and this issue only appeared yesterday on my local development version, which was only being queried a few times a day by only two clients. My staging and production versions which are similarly very low traffic with only two connections max have not so far had this issue.
I'll take a look at the settings you recommend. Thank you. :)

@jj0b hmm.. are you sure it doesn't have something to do with thise https://github.com/knex/knex/issues/3831

@jj0b hmm.. are you sure it doesn't have something to do with thise #3831

Not really sure. All I know is that I hadn't made any changes recently and everything had been working when this error popped up yesterday when querying the database. All I did to fix it was update the latest version of Knex and the error stopped happening. I didn't update anything else, including Node as it seems some had to in that thread you shared. I also haven't been doing any migrations which seemed to have triggered this issue for some.

@rossPatton try to isolate the exact case where it is happening and then you might find what is wrong in your app. Maybe your queries are really slow. Anyways that error is pretty hard to create without flooding huge amount of queries or using transactions.

For future people: IIRC the issue for me was that I made a minor change to my passportjs setup and ended up DDOSing myself via deserialize for a bit until I figured it out. I also was trying to use DigitalOcean's connection pool service, which seemed to just keep all my connections open or at least, wasn't closing them consistently. Fixing the passport issue and dropping the DO pool (and just setting it via Knex) solved it. No issues since.

FWIW, I was getting the same error after upgrading from Node 10 to Node 14 with pg 7.12.1. Upgrading to pg 8.3.3 fixed it.

I've had same problem with pg connection.
Took me a while to figure out that with node v14.9.0, pg version ^8.0.3 is required.
I've had pg version ^7.4.1, which caused problems

Well I am having same error but issue is different:
I have async transactions
export const requestCreate = async (payload) => {
try {
    await db.transaction(async (trx) => {
   await db.something.transacting(trx)
 //Or I have other methods I call and pass trx for operation in database
await createWhateverSomhereElse(trx)
//and that has .transacting(trx)
})
catch(err){
throw err
}
}

And now, it works when I do requests 1 by 1 one after the other. It works fine.
But I did test when I spam my API with 10 requests at the same time, then each request hands for 60 seconds
and returns error Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?
I've tried single request in test and that;s fine. I tried 2 and it was fine except it didn't accept duplicate which I will have to solve that problem later.
But if  I do more at the same time, it just can't cope.
Any suggestions ?

@gbkwiatt With the code you pasted that should not happen. You are probably doing something else wrong in the real code. This is also not the place to discuss it. If you think it is a knex bug, please open an issue with minimal reproduction and if not then maybe someone in stackoverflow can help if you provide that reproduction code with knex configuration that actually causes the hanging.

I solved this problem with these versions:
"knex": "^0.21.1",
"objection": "^2.1.3",
"pg": "^8.0.3"

@batadamnjanovic Thank you so much, after 1 week nightmare... finally you saved me.

It is a fact that this error can be caused by very many issues, today I found out a new one the hard way after scrolling up and down countless threads like this one to no avail.
when setting up the pool, there knex allows us to optionally register afterCreate callback, if this callback is added it is imperative that you make the call to the done callback that is passed as the last parameter to your registered callback or else no connection will be acquired leading to timeout.
.....
    pool: {
      afterCreate: (conn, done) => {
        // .... add logic here ....
        // you must call with new connection
        done(null, conn);
      },
    }
.....

It is a fact that this error can be caused by very many issues, today I found out a new one the hard way after scrolling up and down countless threads like this one to no avail.
when setting up the pool, there knex allows us to optionally register afterCreate callback, if this callback is added it is imperative that you make the call to the done callback that is passed as the last parameter to your registered callback or else no connection will be acquired leading to timeout.
.....
    pool: {
      afterCreate: (conn, done) => {
        // .... add logic here ....
        // you must call with new connection
        done(null, conn);
      },
    }
.....

I had this problem but I was using Postgress
To resolve this problem you need to reinstall the node.js on version 12.18.2. I did this and my app is ok.

I had this problem but I was using Postgress
To resolve this problem you need to reinstall the node.js on version 12.18.2. I did this and my app is ok.

Resolvi este problema com estas versões:
"knex": "^0.21.1",
"objection": "^2.1.3",
"pg": "^8.0.3"

Comigo funcionou atualizar as versoes

I've had same problem with pg connection.
Took me a while to figure out that with node v14.9.0, pg version ^8.0.3 is required.
I've had pg version ^7.4.1, which caused problems

life saving comment.

 The pool is probably full. Are you missing a .transacting(trx) call?
My config of knex is
 const config =    client: process.env.CLIENT,
    connection: {
      host: process.env.DBHOST,
      user: process.env.DBUSER,
      password: process.env.DBPASS,
      database: process.env.DATABASE
    },
    pool: { min: 0, max: 30, acquireTimeoutMillis: 60 * 1000 },
    seeds: {
      directory: './db/sds'
    },
    migrations: {
      directory: './db/mg'
    }
}
import knexLib from 'knex';
export const con = knexLib(config);

and I'm using it something like
import {con} from './con';
import {} from '../err'

const handler = (req)=>{
const trx = con.transaction();
try{
  const result = await con('insert-table').transacting(trx).insert(req.list).returning('*');
  const resultOfLog = await Promise.all(
  result.map((o)=>{
 return con('log-table').insert({event_id: 1, resource: o.id});
})
);
return result;
} catch(error){
  return new FormatError(error);
}
}

I got the same error but the reason was VPC

Issue for me were the inbound rules as well, helps to do a quick psql from the EC2 instance to make sure it has access.

Hi devs, i have the same problem with my application.
Today it has a service that crashes the application and I need to restart.
I've tried a lot of things but I wasn't successful.
Here is my error and current configuration.
`import knex from 'knex'
const connection = knex({
client: 'mysql',
connection: {
host: '',
port: ,
user: '',
password: '',
database: '****',
timezone: 'UTC',
dateStrings: true,
},
pool: {
    min: 2,
    max: 6,
    createTimeoutMillis: 3000,
    acquireTimeoutMillis: 10000,
    idleTimeoutMillis: 30000,
    reapIntervalMillis: 1000,
    createRetryIntervalMillis: 100,
    propagateCreateError: false
},
useNullAsDefault: true,
debug: true,

})
export default connection`

`    public async listarCompetencias() {
let qry = "";
let result = false;
    qry = `
        SELECT *
        FROM competencias
        ORDER BY id DESC
        `

    try {
        const trx = await knex.transaction()
        await knex.raw(qry).then((row) => {
            trx.commit()
            result = row[0]
        })

        return result;

    } catch (error) {

        throw Error(error)
    }

}`

Maybe this code works better, which implicitly closes transactions also in case of an error...
import knex from 'knex'

const connection = knex({
    client: 'mysql',
    connection: {
        host: '*****',
        port: *****,
        user: '***',
        password: '*****',
        database: '******',
        timezone: 'UTC',
        dateStrings: true,

    },
    pool: {
        min: 0,
        max: 6,
        idleTimeoutMillis: 10000
    },
    debug: true,
})

export default connection

----------------

    public async listarCompetencias() {
        const qry = `
            SELECT *
            FROM competencias
            ORDER BY id DESC
            `

        try {
            await knex.transaction(trx => {
               const res = await knex.raw(qry);
               return res[0];
            });
        } catch (error) {
            throw Error(error)
        }
    }

Hey there, I too had this error in development, and I wasn't explicitly using transactions. Maybe one of the objection.js codes I was using was, but I doubt it given logs.
It turns out I was running docker-compose with postgres:13.2-alpine on my MacBook m1 computer. The alpine version is built for amd64 architectures, while m1 MacBooks are running on arm64 architectures.
While this works with Docker, it's not recommended and can lead to errors like "stuck spinlock detected at LWLockWaitListLock" and "core dumped" in your Postgres logs (see https://github.com/docker/for-mac/issues/5122) which is the root cause of Knex/Tarn not being able to get more connections (tl;dr; the database goes into crazy mode)
So I switched back to just using the image postgres:13.2, and it works 👍, no more errors :)

It sounds like this error is really ambiguous. Anyway to make it more clear? Do you expect it to be thrown from any knex ORM query like await knex('my_table').select('*'); or await knex.raw('select * from my_table;') or others?
I'm finding that this error is consistently reproducable by running a function of mine that makes additional queries in parallel with lots of input.

In all the error logs for this, I'm seeing there is no additional info on where the error was thrown from
    error KnexTimeoutError: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?
        at Client_PG.acquireConnection (/home/j/projects/my-project/node_modules/knex/lib/client.js:348:26)
        at runNextTicks (internal/process/task_queues.js:60:5)
        at listOnTimeout (internal/timers.js:526:9)
        at processTimers (internal/timers.js:500:7) {
      sql: undefined,
      bindings: undefined
    }

There's no file or line number to trace back to your module. sql and bindings is undefined
I think reproducing the error locally is acceptable, but before that, it would help to actually understand which calls or queries are throwing. I would recommend adding your own stack trace in your catch blocks, .catch calls, or .on('error', err => callback.
using node.js 14
  const stackTrace = new Error().stack.split('\n').slice(1, 3).map(s => s.trim()).join('\n');
  log.error({ stackTrace }, 'error', err);

for me increasing the aquireTimeout was the solution

run into the same problem with the strapi and had to modify the following to get the connection reliably.
export default ({ env }) => ({  connection: { client: 'postgres',     connection: {       host: env('DATABASE_HOST', '<IP_ADDRESS>'),       port: env.int('DATABASE_PORT', 5432),       database: env('DATABASE_NAME', 'XXXXXXX'),       user: env('DATABASE_USERNAME', 'XXXXXX'),       password: env('DATABASE_PASSWORD', 'XXXXXX'),       ssl: env.bool('DATABASE_SSL', false),     },  debug: true,     acquireConnectionTimeout: 1000000,     options: {       pool: {           min: 1,           max: 10,   acquireTimeoutMillis: 900000,           createTimeoutMillis: 900000,           destroyTimeoutMillis: 900000, } }, },});

run into the same problem with the strapi and had to modify the following to get the connection reliably.
export default ({ env }) => ({ connection: { client: 'postgres', connection: { host: env('DATABASE_HOST', '<IP_ADDRESS>'), port: env.int('DATABASE_PORT', 5432), database: env('DATABASE_NAME', 'XXXXXXX'), user: env('DATABASE_USERNAME', 'XXXXXX'), password: env('DATABASE_PASSWORD', 'XXXXXX'), ssl: env.bool('DATABASE_SSL', false), }, debug: true, acquireConnectionTimeout: 1000000, options: { pool: { min: 1, max: 10, acquireTimeoutMillis: 900000, createTimeoutMillis: 900000, destroyTimeoutMillis: 900000, } }, },});

Can you format your reply better?

here you go for Strapi version 3.5
module.exports = ({ env }) => ({
defaultConnection: 'default',
connections: {
default: {
connector: 'bookshelf',
settings: {
client: 'postgres',
host: env('DATABASE_HOST'),
port: env.int('DATABASE_PORT', 5432),
database: env('DATABASE_NAME'),
username: env('DATABASE_USERNAME'),
password: env('DATABASE_PASSWORD'),
ssl: false,
},
acquireConnectionTimeout: 1000000,
debug:true,
options: {
pool: {
min: 0,
max: 1,
acquireTimeoutMillis: 900000,
createTimeoutMillis: 900000,
destroyTimeoutMillis: 900000,
}
},
},
},
});
Strapi version 4.5.4
If you would any one would like to try self hosting one can try these steps https://medium.com/@mohanganesh/strapi-headless-cms-google-cloud-run-and-postgresql-6126b597b10c

For anyone running into this issue, let me explain what learned here.
I was getting this same error with my database connection because the config.connection setting was async due to the database password being loaded from a "secrets" service that GCP was offering. The secrets service would randomly timeout, just take too long for Knex or throw an error randomly. I don't think it was scaled to handle this usecase.
The end result was that Knex would consider all instances of this error its own timeout error. Knex would also timeout itself if the config.connection async resolution took to long. What this amounted to was a very difficult to pin down error that Knex gave zero context on.
I was able to completely fix the problem by converting all runtime secret loading to ENV variables that are filled during deploy (you can do this natively via most hosting providers ... in my case it was Cloud Run on GCP).
The nightmare is finally over.

I'm unfortunately getting this error still after reading this thread. I'm following @mohan-ganesh GCP article and haven't a clue on how to resolve this error. Any additional suggestions?
[2023-04-26 15:41:06.732] debug: ⛔ Server wasn't able to start properly.
[2023-04-26 15:41:06.737] error: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?
KnexTimeoutError: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?

Following back up, Mohan was able to help me solve the issue on my end. I was confused on GCP cloud run ports where I tried setting the port to 1337 rather than 8080. Since cloud run only runs on 8080 it was throwing the error. On top of that, I had to add my variables into my cloud run env. Once completed, it worked like a charm. Again, thanks @mohan-ganesh for helping me debug.

@evanrosa We have been running our web application on port 8080 with CloudRun for several years and have the same problem. Could you please tell me why changing the port to 1337 would stop this problem?

@evanrosa Could you explain exactly what the fix is? I tried running the cloud application port on 8080 and 1337, all with no luck. I even tried changing the web app port (strapi) from 1337 to 8080, also with no luck.

@evanrosa Could you explain exactly what the fix is? I tried running the cloud application port on 8080 and 1337, all with no luck. I even tried changing the web app port (strapi) from 1337 to 8080, also with no luck.

hey Evan,  the actual changes are documented at https://github.com/knex/knex/issues/2820#issuecomment-1402836023
Regarding CloudRun, when we deploy the app the port that it expected should be 8080.

I also forgot to close out a transaction resulting in a connection leak. I figured out that I can add an assertion to my tests that assures I've not leaked any connections by checking the following
knex.client.pool.numUsed() === 0

I'm on knex 2.4.2 which uses tarn 3.0.2 (the pooling library that has the numUsed function)


Remove comments referencing old code paths

There are some areas in comments still referencing old paths. Change to current ones.

Done


Merge everything

Closes #9.

…did you just delete the migration system?
Should probably add those back in before it's finished, because otherwise deployments are going to get painful, or require you to just nuke the entire database all the time. Same problem when multiple people are collaborating on one project, if they end up with different database schemas.

I deleted it earlier on in the tree. I figured out my mistake later, and I re-added it.


Python packaging fails in Terraform Cloud

Description
When using Terraform Cloud Run environment, apply fails at the module.coreapi_lambda.null_resource.archive[0] resource, with the following trace:
Executing: ["python3" ".terraform/modules/coreapi_lambda/package.py" "build" "--timestamp" "1634735951309778000" "builds/4bb5e227c44fc37defeda68f5b9905bb0c3dcf3f02b0f453f3cfddea6d357d47.plan.json"]
  zip: creating 'builds/4bb5e227c44fc37defeda68f5b9905bb0c3dcf3f02b0f453f3cfddea6d357d47.zip' archive
  Installing python requirements: ../core/requirements.txt
  > mktemp -d terraform-aws-lambda-XXXXXXXX # /tmp/terraform-aws-lambda-ns3rqjt3
  > cd /tmp/terraform-aws-lambda-ns3rqjt3
  > python3.7 -m pip install --no-compile --prefix= --target=. --requirement=requirements.txt
  zip: Error during zip archive creation
  Traceback (most recent call last):
    File ".terraform/modules/coreapi_lambda/package.py", line 924, in install_pip_requirements
      check_call(pip_command, env=subproc_env)
    File "/usr/lib/python3.6/subprocess.py", line 306, in check_call
      retcode = call(*popenargs, **kwargs)
    File "/usr/lib/python3.6/subprocess.py", line 287, in call
      with Popen(*popenargs, **kwargs) as p:
    File "/usr/lib/python3.6/subprocess.py", line 729, in __init__
      restore_signals, start_new_session)
    File "/usr/lib/python3.6/subprocess.py", line 1364, in _execute_child
      raise child_exception_type(errno_num, err_msg, err_filename)
  FileNotFoundError: [Errno 2] No such file or directory: 'python3.7': 'python3.7'
  The above exception was the direct cause of the following exception:
  Traceback (most recent call last):
    File ".terraform/modules/coreapi_lambda/package.py", line 1158, in build_command
      bpm.execute(build_plan, zs, query)
    File ".terraform/modules/coreapi_lambda/package.py", line 788, in execute
      with install_pip_requirements(query, pip_requirements) as rd:
    File "/usr/lib/python3.6/contextlib.py", line 81, in __enter__
      return next(self.gen)
    File ".terraform/modules/coreapi_lambda/package.py", line 930, in install_pip_requirements
      ) from e
  RuntimeError: Python interpreter version equal to defined lambda runtime (python3.7) should be available in system PATH

⚠ Note
Local apply as described below 👇 succeeded.
Before you submit an issue, please perform the following first:

Remove the local .terraform directory (! ONLY if state is stored remotely, which hopefully you are following that best practice!): rm -rf .terraform/
Re-initialize the project root to pull down modules: terraform init
Re-attempt your terraform plan or apply and check if the issue still persists

Versions
Terraform v1.0.9
on windows_amd64

provider registry.terraform.io/hashicorp/aws v3.63.0
provider registry.terraform.io/hashicorp/external v2.1.0
provider registry.terraform.io/hashicorp/local v2.1.0
provider registry.terraform.io/hashicorp/null v3.1.0
provider registry.terraform.io/hashicorp/random v3.0.0
terraform-aws-modules/lambda/aws 2.22.0 for coreapi_lambda

Reproduction

Steps to reproduce the behavior:

Using Terraform Cloud Run in a Workspace fails with the above trace.
Using a local state, with or without a workspace, succeeds without the above issue.
Code Snippet to Reproduce

This is my configuration (separate files, merged here for convenience):
provider "aws" {
  region = var.region
}

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = ">= 3.63.0"
    }

    random = {
      source  = "hashicorp/random"
      version = "3.0.0"
    }
  }

  required_version = "~> 1.0"
}

module "coreapi_lambda" {
  source = "terraform-aws-modules/lambda/aws"

  function_name = var.coreapi_function_name
  handler       = "src.main.lambda_handler"
  runtime       = var.coreapi_lambda_runtime

  source_path = "../core"

  vpc_subnet_ids = [aws_default_subnet.default_az1.id]
  vpc_security_group_ids = [aws_security_group.allow_nfs_traffic_to_efs.id]
  attach_network_policy = true

  tags = {
    Name = var.coreapi_function_name
  }
}

variable "region" {
  description = "AWS region"
  default     = "us-east-1"
}

variable "coreapi_function_name" {
  default = "coreapi_backend"
}

variable "coreapi_lambda_runtime" {
  default = "python3.7"
}

Expected behavior
When running locally, the command succeeds:
module.coreapi_lambda.null_resource.archive[0] (local-exec): Executing: ["python.exe" ".terraform/modules/coreapi_lambda/package.py" "build" "--timestamp" "1634737191093293000" "builds\\69eeba9634537
56ac782588e0a5022290d580d13ddb53793e0ab2222dfe2bf36.plan.json"]
module.coreapi_lambda.null_resource.archive[0] (local-exec): zip: creating 'builds\69eeba963453756ac782588e0a5022290d580d13ddb53793e0ab2222dfe2bf36.zip' archive
module.coreapi_lambda.null_resource.archive[0] (local-exec): Installing python requirements: ../core\requirements.txt
module.coreapi_lambda.null_resource.archive[0] (local-exec): > mktemp -d terraform-aws-lambda-XXXXXXXX # 'C:\Users\Yigal\AppData\Local\Temp\terraform-aws-lambda-rv4pzna0'
module.coreapi_lambda.null_resource.archive[0] (local-exec): > cd 'C:\Users\Yigal\AppData\Local\Temp\terraform-aws-lambda-rv4pzna0'
module.coreapi_lambda.null_resource.archive[0] (local-exec): > python.exe -m pip install --no-compile --prefix= --target=. --requirement=requirements.txt
module.coreapi_lambda.null_resource.archive[0] (local-exec): Collecting aws-lambda-wsgi==0.0.6
module.coreapi_lambda.null_resource.archive[0] (local-exec):   Using cached aws_lambda_wsgi-0.0.6-py3-none-any.whl (3.8 kB)
module.coreapi_lambda.null_resource.archive[0] (local-exec): Collecting connexion==2.9.0
module.coreapi_lambda.null_resource.archive[0] (local-exec):   Using cached connexion-2.9.0-py2.py3-none-any.whl (84 kB)
module.coreapi_lambda.null_resource.archive[0] (local-exec): Collecting flask<2,>=1.0.4
module.coreapi_lambda.null_resource.archive[0] (local-exec):   Using cached Flask-1.1.4-py2.py3-none-any.whl (94 kB)
module.coreapi_lambda.null_resource.archive[0] (local-exec): Collecting openapi-spec-validator<0.4,>=0.2.4
module.coreapi_lambda.null_resource.archive[0] (local-exec):   Using cached openapi_spec_validator-0.3.1-py3-none-any.whl (32 kB)
module.coreapi_lambda.null_resource.archive[0] (local-exec): Collecting inflection<0.6,>=0.3.1
...
Package installation continues
...
module.coreapi_lambda.null_resource.archive[0] (local-exec): Created: 'builds\69eeba963453756ac782588e0a5022290d580d13ddb53793e0ab2222dfe2bf36.zip'
module.coreapi_lambda.null_resource.archive[0]: Creation complete after 41s [id=7651629136115322200]

Actual behavior
The Cloud Run environment fails when creating the python deployment package.

Do you know if it's possible to install a later version of Python on the Terraform Cloud machines?

Do you know if it's possible to install a later version of Python on the Terraform Cloud machines?

Hashicorp don't seem to be interested too much in the build process of Lambda packages in Terraform Cloud, they expect you to create your own Runners, or use a different tool for Lambda packaging.

@stevewillard There is a note in README - https://github.com/terraform-aws-modules/terraform-aws-lambda#-terraform-cicd


project level timeout

I want to set a project level timeout
is HTTP.default_options = { timeout_class: HTTP::Timeout::Global, timeout_options: { global_timeout: 10 } }  ok?

I'd suggest asking about this in #773 where we are discussing a redesign of the timeout subsystem

@tarcieri it works


Multiple issues with OtterHD

https://github.com/Luodian/Otter/blob/main/docs/OtterHD.md as it stands now at the time of the writing of this issue is a weird document:

the Technical report link leads to a file that doesn't exist (https://github.com/Luodian/Otter/blob/main/docs/link)
the Demo leads to a huggingface page, which has a link to Checkpoints, which don't exist at the moment (see https://github.com/Luodian/Otter/issues/303 as well)
there's for now only a finetuning script for anyone wishing to replicate your finetuning efforts, I guess, but no inference script (probably due to 2.)

Hope the checkpoints get released soon!

hi I fixed issue 1 already and for issue 2, the ETA is approximately early Dec, no later than late Dec. We are doing some experiments on resizing vs. padding, it will take some efforts to finish and provide the best checkpoint for both good demo & benchmark performance.
We've updated a recent trained model on demo, you could take a look at: https://huggingface.co/spaces/Otter-AI/OtterHD-Demo
As for issue 3. As for inference script, you can take a look at following file. It already has a defined OtterHD class.
https://github.com/Luodian/Otter/blob/main/pipeline/benchmarks/models/otterhd.py
It's basically the same as Fuyu's:
https://github.com/Luodian/Otter/blob/main/pipeline/benchmarks/models/fuyu.py

At the time of me writing this it's December 18th. Is that late enough? Do you have any updates on the ETA?
A link to your wandb page would be super cool, so that we can all see how the model is doing


Rename version to ociVersion according to runtime.md

* `Root` is path to the container's rootfs which can be useful information
to hook, and the official sample runtime implementation--runc--has
already added this field as payload to hook, we should add this to the
spec.

Status seems like unnecessary field, because State is payload to
hook and hook is executed in special time point, e.g.

Prestart is a list of hooks to be run before the container process is
executed, indicating a status of created.
Poststart is a list of hooks to be run immediately after the container
process is started, indicating a status of running.
Poststop is a list of hooks to be run after the container process exits,
indicating a status of stopped.
So the Status field is redundant.

According to definition of state, we should rename
version field in state.go to ociVersion
Signed-off-by: Zhang Wei<EMAIL_ADDRESS>

I think status is included because this state object can be used as the output for runtime state <id>

Oh, my... I'm too confused now, it seems that we have many conflicts between specs and runc.
runc containerState: https://github.com/opencontainers/runc/blob/master/list.go#L24-L41
runc hookState: https://github.com/opencontainers/runc/blob/master/libcontainer/configs/config.go#L246-L252
specs description about container state:
https://github.com/opencontainers/runtime-spec/blob/master/runtime.md#state
specs structure about state:
https://github.com/opencontainers/runtime-spec/blob/master/specs-go/state.go
In my understanding, they should be the same, but currently they conflict with each other.
conflicting fields include:

"version" vs "ociVersion"
missing "root" field in specs, and also "root" vs "rootfs"
missing "status" in hooks
extra "created" field in runc state

I'll try to make them synchronous, but the breaking of backward compatibility seems inevitable :cry:

Update:
only update ociVersion field because state.go didn't follow runtime.md
Others:

missing "root" field in specs, and also "root" vs "rootfs": root is redundant, as we already have bundle, rootfs can be retrieved from bundle/config.md
missing "status" in hooks: modify runc
extra "created" field in runc state: keep it only in runc, not add it in spec. Unless all persons agree that it's truly necessary, but this can be discussed seperately.
"bundlePath" vs "bundle": runc should follow the spec

Please take a look. @opencontainers/runc-maintainers @opencontainers/runtime-spec-maintainers

c8f5a569 looks good to me, and seems like a fairly straightforward
bugfix.

LGTM

LGTM


Disable search highlighting

Here's a simple way to disable the highlighting in Sphinx's search. I hope this helps! :smile:

Disable search highlighting
Goals

Disable the highlighting of search terms in search results and links

Change summary
Added

Added searchtools.js based on the Sphinx v4.4.0 Basic theme to the source/_static directory

Changed

Changed searchtools.js to disable the collection of highlight terms and skip including those terms in search results and links

Usage notes
This change can be reverted by removing the searchtools.js file from the source/_static directory.

Hello @neflyte,
Thanks for your pull request! A Core Committer will review your pull request soon. For code contributions, you can learn more about the review process here.

This PR has been automatically labelled "stale" because it hasn't had recent activity.
A core team member will check in on the status of the PR to help with questions.
Thank you for your contribution!

Users can enable the highlight, append the docs page URL with highlight=search-terms where multiple search terms can be separated using +. For example: https://docs.mattermost.com/scale/performance-monitoring.html?highlight=prometheus+grafana highlights all instances of both prometheus and grafana on the Performance Monitoring docs page.


Preserve all version fields

Up to now extra version fields were ignored: only name and date fields were accepted. This changes that by retaining the full JSON data when reading the file, making it possible in the future to support custom fields.

Only reordered version (strange it was not already like that before, looks like a bug). Merging.


fix: pass missing parameters

Description
Please include a summary of the change and specify which issue is being addressed. Additionally, provide relevant motivation and context.
Fixes # (issue number)
Type of change
Please delete options that are not relevant.

[ ] Documentation (typos, code examples, or any documentation updates)
[ ] Bug fix (a non-breaking change that resolves an issue)
[ ] New feature (a non-breaking change that adds functionality)
[ ] Breaking change (a fix or feature that would disrupt existing functionality)
[ ] This change requires a documentation update

Checklist

[ ] My code adheres to the style guidelines of this project (scripts/lint.sh shows no errors)
[ ] I have conducted a self-review of my own code
[ ] I have made the necessary changes to the documentation
[ ] My changes do not generate any new warnings
[ ] I have added tests to validate the effectiveness of my fix or the functionality of my new feature
[ ] Both new and existing unit tests pass successfully on my local environment by running scripts/test-cov.sh
[ ] I have ensured that static analysis tests are passing by running scripts/static-anaylysis.sh
[ ] I have included code examples to illustrate the modifications

@davorrunje should we increase version to 0.2.5 to deliver this changes?

@davorrunje should we increase version to 0.2.5 to deliver this changes?

yes, we should. @sheldygg can you please increase the version to 0.2.5?

@davorrunje should we increase version to 0.2.5 to deliver this changes?

yes, we should. @sheldygg can you please increase the version to 0.2.5?

yes, i did that


[Storyboards] Change .controller to .instantiate()

@djbe as discussed in Slack earlier today. I'll let you run that template on the codebase you tested earlier to see if it's better. Will add CHANGELOG and MG entries later (after GoT 📺⚔ 😄)
Note that this is a breaking change from 2.0 but given that 2.0 is used by nobody yet (as templates 2.0 requires SwiftGen 5.0 which isn't released yet) we'll probably just tag a 2.0.1. It's not really semver-correct but given 2.0 isn't really officially out and was useless without SwiftGen 5 I feel that it's ok.
TODO:

[ ] Check if the playgrounds (and other usage examples that might hide in the documentation) needs to be updated accordingly
[ ] Add CHANGELOG entry
[ ] Mention the change from instantiateFoo to Foo.instantiate in the MG (and also in SwiftGen's main MG)

@djbe thought: provide an additional template with @deprecated attributes to help the migration
// Generated using SwiftGen, by O.Halligon — https://github.com/SwiftGen/SwiftGen
{% if platform and storyboards %}
{% set isAppKit %}{% if platform == "macOS" %}true{% endif %}{% endset %}
{% set prefix %}{% if isAppKit %}NS{% else %}UI{% endif %}{% endset %}
{% set controller %}{% if isAppKit %}Controller{% else %}ViewController{% endif %}{% endset %}

import Foundation
import {% if isAppKit %}Cocoa{% else %}UIKit{% endif %}
{% for module in modules where module != env.PRODUCT_MODULE_NAME and module != param.module %}
import {{module}}
{% endfor %}

{% set sceneEnumName %}{{param.sceneEnumName|default:"StoryboardScene"}}{% endset %}
{% macro className scene %}{% filter removeNewlines %}
  {% if scene.customClass %}
    {% if scene.customModule %}{{scene.customModule}}.{% endif %}
    {{scene.customClass}}
  {% else %}
    {{prefix}}{{scene.baseType}}
  {% endif %}
{% endfilter %}{% endmacro %}

enum {{sceneEnumName}} {
  {% for storyboard in storyboards %}
  {% set storyboardName %}{{storyboard.name|swiftIdentifier|escapeReservedKeywords}}{% endset %}
  enum {{storyboardName}} {
    {% if storyboard.initialScene %}
    {% set sceneClass %}{% call className storyboard.initialScene %}{% endset %}
    @available(*, deprecated, rename: "initialScene.instantiate()")
    static func instantiateInitialScene() -> {{sceneClass}} { return initialScene.instantiate() }
    {% endif %}

    {% for scene in storyboard.scenes %}
    {% set sceneID %}{{scene.identifier|swiftIdentifier|snakeToCamelCase|lowerFirstWord|escapeReservedKeywords}}{% endset %}
    {% set sceneClass %}{% call className scene %}{% endset %}
    @available(*, deprecated, rename: "{{sceneID}}.instantiate()")
    static func instantiate{{sceneID|titlecase}}() -> {{sceneClass}} {
      return {{sceneID}}.instantiate()
    }
    {% endfor %}
  }
  {% endfor %}
}

{% elif storyboards %}
// Mixed AppKit and UIKit storyboard files found, please invoke swiftgen with these separately
{% else %}
// No storyboard found
{% endif %}

Not tested, but I guess you see the idea. Worth it? (or maybe not as a bundle template, but just paste it somewhere in the wiki or MG and let people copy it manually if they need, to make it less official?)

💡  This made me realise that we didn't document the param.module customisation in the storyboard templates documentation

Hmmm, I wouldn't add as an alternative template, that's more code we have to maintain. Maybe put it in a wiki page, and point the MG to it. Mention on that wiki page that it won't be maintained.
It is a small change after all.

It is documented in the templates docs.

Oh, you mean the template inferring the modules, gotcha.

I mean that https://github.com/SwiftGen/templates/blob/master/Documentation/storyboards/swift3.md mentions sceneEnumName and segueEnumName in their Customization section, but not module

Hmmm, I wouldn't add as an alternative template, that's more code we have to maintain. Maybe put it in a wiki page, and point the MG to it. Mention on that wiki page that it won't be maintained.

Yeah, hence the idea of just pasting it in a wiki page, not bundling it in SwiftGen. And mentioning it as something like:

if you need help migrating, you could imagine creating a template like the following, which will generate deprecation warnings in your existing code to help you use the "Fix All in Scope" feature of Xcode to let Xcode do the renaming for you and migrate faster.
Note: this template below is just a suggestion to ease your migration. It won't be integrated into SwiftGen nor maintained, as it's just a tip to help you when you are gonna do your migration but isn't intended to be used as a final template

It is a small change after all.

Sure but it could be very tedious to have to rename every single call to a StoryboardScene in an existing huge codebase… one by one… by hand. While @available(*, deprecated, rename: "newName") allows Xcode's fix-it to do the renaming for you.

That should be the changes for this PR/repo. @AliSoftware you might want to proofread the changelog entry, and then it should be GTM.


VS Code Manual

VS Code Manual
command-line
https://code.visualstudio.com/docs/editor/command-line

# Sometimes you will want to open or create a file.
# If the specified file does not exist, VS Code will create them for you:

$ code index.html style.css readme.md

Node.js
https://code.visualstudio.com/docs/nodejs/nodejs-tutorial
https://code.visualstudio.com/docs/nodejs/nodejs-debugging
https://code.visualstudio.com/tutorials/nodejs-deployment/getting-started
https://code.visualstudio.com/docs/nodejs/reactjs-tutorial
https://code.visualstudio.com/docs/nodejs/angular-tutorial
https://code.visualstudio.com/docs/nodejs/debugging-recipes
https://code.visualstudio.com/docs/nodejs/extensions
tips-and-tricks
https://code.visualstudio.com/docs/getstarted/tips-and-tricks#vscode
https://code.visualstudio.com/docs/editor/codebasics
https://code.visualstudio.com/docs/getstarted/userinterface
CLI

# open code with current directory
code .

# open the current directory in the most recently used code window
code -r .

# create a new window
code -n

# change the language
code --locale=es

# open diff editor
code --diff <file1> <file2>

# open file at specific line and column <file:line[:character]>
code --goto package.json:10:5

# see help options
code --help

# disable all extensions
code --disable-extensions .

Terminal

Mastering VS Code's Terminal

http://www.growingwiththeweb.com/2017/03/mastering-vscodes-terminal.html
https://code.visualstudio.com/docs/editor/integrated-terminal
Zen Mode
Keyboard Shortcut: Ctrl+K Z

Ctrl+K
Z

Side by side editing
Keyboard Shortcut: Ctrl+\
Switch between editors
Keyboard Shortcut: Ctrl+1, Ctrl+2, Ctrl+3
Editing Hacks
Ctrl+K Ctrl+M
@recommended:keymaps
Multi cursor selection
Keyboard Shortcut: Ctrl+Alt+Up / Ctrl+Alt+Down
https://code.visualstudio.com/docs/getstarted/settings
https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier
??? subl ??? Alt + F3
Join line
Keyboard Shortcut: unassigned

Keyboard Shortcuts (Ctrl+K Ctrl+S)
bind editor.action.joinLines

Copy line up / down
Keyboard Shortcut: Shift+Alt+Up / Shift+Alt+Down
Shrink / expand selection
Keyboard Shortcut: Shift+Alt+Left / Shift+Alt+Right
Go to Symbol in File
Keyboard Shortcut: Ctrl+Shift+O
You can group the symbols by kind by adding a colon, @:.
Go to Symbol in Workspace
Keyboard Shortcut: Ctrl+T
Navigate to a specific line
Keyboard Shortcut: Ctrl+G
Move line up and down
Keyboard Shortcut: Alt+Up or Alt+Down
Trim trailing whitespace
Keyboard Shortcut: Ctrl+K Ctrl+X
Code formatting#
Currently selected source code: Ctrl+K Ctrl+F
Whole document format: Shift+Alt+F
Code folding
Keyboard Shortcut: Ctrl+Shift+[ and Ctrl+Shift+]
Select current line
Keyboard Shortcut: Ctrl+I
Navigate to beginning and end of file
Keyboard Shortcut: Ctrl+Home and Ctrl+End
Open Markdown Preview
In a Markdown file, use
Keyboard Shortcut: Ctrl+Shift+V
Side by Side Markdown Edit and Preview
In a Markdown file, use
Keyboard Shortcut: Ctrl+K V === Ctrl+\ Ctrl+Shift+V
Special bonus: The preview will now sync.
IntelliSense
Ctrl+Space to trigger the Suggestions widget.
Peek
Select a symbol then type Ctrl+Shift+F12.
Alternatively, you can use the context menu.

Alternatively, you can use the context menu or Ctrl+click (Cmd+click on macOS).
Find All References
Select a symbol then type Shift+F12. Alternatively, you can use the context menu.
Rename Symbol
Select a symbol then type F2. Alternatively, you can use the context menu.
VS Code ESLint extension

.eslintrc.json

https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint
https://eslint.org/docs/user-guide/configuring

{
    "env": {
        "browser": true,
        "commonjs": true,
        "es6": true,
        "node": true
    },
    "parserOptions": {
        "ecmaVersion": 6,
        "sourceType": "module",
        "ecmaFeatures": {
            "jsx": true,
            "classes": true,
            "defaultParams": true
        }
    },
    "rules": {
        "no-const-assign": 1,
        "no-extra-semi": 0,
        "semi": 0,
        "no-fallthrough": 0,
        "no-empty": 0,
        "no-mixed-spaces-and-tabs": 0,
        "no-redeclare": 0,
        "no-this-before-super": 1,
        "no-undef": 1,
        "no-unreachable": 1,
        "no-use-before-define": 0,
        "constructor-super": 1,
        "curly": 0,
        "eqeqeq": 0,
        "func-names": 0,
        "valid-typeof": 1
    }
}

Emmet syntax
https://code.visualstudio.com/docs/editor/emmet
Snippets
Create custom snippets
https://code.visualstudio.com/docs/editor/userdefinedsnippets
File > Preferences > User Snippets, select the language, and create a snippet.

"create component": {
    "prefix": "component",
    "body": [
        "class $1 extends React.Component {",
        "",
        "\trender() {",
        "\t\treturn ($2);",
        "\t}",
        "",
        "}"
    ]
},

Git integration
Keyboard Shortcut: Ctrl+Shift+G
Setup VS Code as default merge tool

$ git config --global merge.tool code

Debugging

launch.json

https://code.visualstudio.com/docs/editor/debugging
Task Runner
Auto detect tasks

task.json

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "type": "npm",
            "script": "install",
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }
    ]
}

Insiders builds
https://code.visualstudio.com/insiders/
https://code.visualstudio.com/docs/?dv=win&build=insiders
https://go.microsoft.com/fwlink/?Linkid=852155
https://go.microsoft.com/fwlink/?LinkId=808081
https://stackoverflow.com/questions/tagged/visual-studio-code
https://twitter.com/code
https://github.com/Microsoft/vscode/issues
https://www.youtube.com/channel/UCs5Y5_7XK8HLDX0SLNwkd3w
👋Want to submit an issue to Microsoft/vscode?
https://github.com/Microsoft/vscode/blob/master/CONTRIBUTING.md
https://github.com/Microsoft/vscode/issues?q=is%3Aissue+is%3Aopen+label%3A"help+wanted"
https://github.com/Microsoft/vscode/issues?q=is%3Aissue+is%3Aopen+label%3A"good+first+issue"

code snippets

vscode & code snippets

https://github.com/xgqfrms/FEIQA/tree/master/000-xyz/templates
c3t

{
    "CSS3 Template": {
        "prefix": "c3t",
        "body": [
            "@charset \"UTf-8\";",
            "",
            "/* $1.css */\n",
            ":root {",
            "   --cololr: $2;",
            "   --default-cololr: $2;",
            "   --new-cololr: $3;",
            "}",
        ],
        "description": "CSS3 Template & code snippets!"
    }
}

js6r

{
    "JavaScript ES6 React Template": {
        "prefix": "js6r",
        "body": [
            "\"use strict\";",
            "",
            "/**",
            " * ",
            " * @author xgqfrms",
            " * @license MIT",
            " * @copyright xgqfrms",
            " * ",
            " * @description $2",
            " * @augments $3",
            " * @example $4",
            " * ",
            " */",
            "",
            "const $2Generator = ($5datas = [], debug = false) => {",
            "    let result = ``;",
            "    // do something...",
            "    return $7result;",
            "};",
            "",
            "",
            "",
            "export default $2;",
            "",
            "export {",
            "    $2,",
            "};",
            "",
        ],
        "description": "JavaScript ES6 React Template & code snippets!"
    }
}

h5t

{
    "HTML5 Template": {
        "prefix": "h5t",
        "body": [
            "<!DOCTYPE html>",
            "",
            "",
            "    <meta charset=\"UTF-8\">",
            "    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">",
            "    <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">",
            "    <meta name=\"author\" content=\"xgqfrms\">",
            "    <meta name=\"generator\" content=\"VS code\">",
            "    <title>$1</title>",
            "",
            "",
            "
",
            "
$2
",
            "        $3",
            "
",
            "",
            ""
        ],
        "description": "HTML5 Template & code snippets!"
    }
}


Issue doing quests that involve typing in say chat

Any quests that involve typing something in say chat won't work. Unloading XIVAlexander and restarting the game will allow the quest to work properly.

Using EXDF Text Transformation Tool EnglishWithJapanese.json
Updated to latest version and doesn't work.
Removing the .json file from the import list and relaunching the game with XIVAlexander still loaded also fixes the issue so it seems limited to using EXDF Text Transformation Tool. Haven't tried it with other .json files.

Which quest is it (what are you required to type), and are you using the latest version? Your file name should be named something like EnglishWithJapanese_SayQuestEnglish.json. See #165

I updated to the latest version and it was an issue on my end with XIVAlexander loading the old .json file instead of the new one that I had imported. Sorry about that. Thanks for the help.


Add URL in notification summary?

Hello,
Is it possible to add a URL to the notification summary? I tried using the markup syntax but it gets printed as it is. Any idea?
Thanks

Can you send me a screenshot of what you mean?


Add beforeInstall and beforeUninstall PHP scripts

I have been using these scripts extensively while developing my extension. I figured they might be useful for other people as well. There will be an accompanying update for the extension-tools repository as well.

Is there anything I could change to make this PR more attractive? I can close it if you don't want to implement this.


(ticdc): manually cherry-pick simple protocol to release-7.5

What problem does this PR solve?

Issue Number: close #10874
What is changed and how it works?

manually cherry-pick the simple protocol functionality back to release-7.5

Check List
Tests

Unit test
Integration test
Manual test (add detailed scripts or steps below)

Questions
Will it cause performance regression or break compatibility?
Do you need to update user documentation, design documentation or monitoring documentation?
Release note
kafka sink supports the simple protocol

duplicated with #10898


Solidity Contract to Represent Init Actor

Currently if a Solidity dev wants to send FIL to a non Ethereum address in the FVM, they need to call Actor.call, from Actor.sol, and pass in the address hex"0001" along with all the other low level parameters. We could use a layer of abstraction for the Init Actor just like the MarketAPI.sol and MinerAPI.sol do for their respective actors.
This will enable devs to send FIL to any address on Filecoin regardless if it's an Ethereum address or not. This contract should be able to take in any actorID from Filecoin, call the init actor and send FIL to the actorID.

:link: zboto Link

@ZakAyesh we have the InitActor.sol contract on the repository. It has exported methods that Filecoin indicated. Is there any other method that we should add there? We should discuss it with Filecoin then. The library is here.

@ZakAyesh any comment here?


unhandledrejection考虑到跨域问题了吗？

As best as I can tell, the cause is that "unhandledrejection" event handlers are silently ignored if they originate from a different script origin. (For more info, see MDN on same-origin policy.) Chrome is very strict with file URLs' security origins in particular, but I've found that unknowingly breaking the same origin policy can happen for other reasons too (such as developing in webpack-dev-server with Chrome Dev Tools open). See this Chrome issue for discussion.

没有，甚至js跨域报错的话，都取不到，只能是script error

没有，甚至js跨域报错的话，都取不到，只能是script error

嗯，目前来看只能是依赖于使用这个框架的项目自己的打包出来的处理script的情况了，确实框架不适合做这个处理，虽然没用这个框架，应该还是挺厉害的，加油

不过使用cdn的话，可以在script标签上加上crossorigin就可以捕捉到了。


add

Status
Ready
Description
Added the pytz pack to the pipfile
Screenshots
Paste here any images that will help the reviewer

closing as the fix we added to content fixed the issue


DBZ-587 Centralize and unify thread management

https://issues.jboss.org/browse/DBZ-587

Applied. Nice stuff, it'll help with identifying potential thread leaks down the road. Thanks, @jpechane!


[Submission]: image-tools for Docker Desktop

Docker Hub repository name
dixtdf/image-tools
Terms of services

[X] I accept the term of services

/validate

Hi, I quicky installed the extension, could you do some minor improvements before this can make it to the marketplace:

change the com.docker.desktop.extension.icon label to provide your own icon that will appear in the marketplace (icon in the red circle). Please test it in dark/light mode to see how it renders.
change the docker.svg file copied in the extension image. This is the icon that appears when running the extension (icon in orange circle). Please test it in dark/light mode to see how it renders.
Set a proper description with the org.opencontainers.image.description label to describe your extension.

Thanks

@gtardif Thanks for the heads up, these issues were an oversight on my part and they were fixed in 1.0.2

/validate


Added 3 events

Added 3 events (i.e. DevScript WOC, SWOC and CWOC) in the list according to month.
Fixes #146

Thats nice @pranabprohit

I merged this PR, but try to write proper details about your PR this will help you to become better developer.

Ok Thank you for letting me know .I will improve it next time.


Parallelized TrcDbgTrace to reduce latency

https://github.com/trc492/Frc2018FirstPowerUp/blob/160214a6d058b03994c85bdca8cbe7d1b8f9b188/src/trclib/TrcDbgTrace.java#L513-L524
This will actually hang when the queue is empty. This is a note for me to fix later.
If the queue is empty, the thread will be blocking, since it's waiting to get a TraceJob from the queue. This means that the thread will not see the shutdown flag, meaning the thread will not exit until someone puts something in the queue.
To fix this, the flag should still be used. However, the code to check for the shutdown flag should be outside the while loop. That way, when the thread is interrupted, it checks the shutdown flag. If flagged, it will finish writing all queued messages. Otherwise, it'll just drop them and quit.
Possibly rename the shutdown flag to something like finishWriting, to more accurately reflect the purpose of the flag.

Okay I fixed the issue above.


why the EventSourcePolyfill could not get the sse data

I have defined a sse api like this using rust:
use actix_web::{App, HttpResponse, HttpServer, Responder, post, get};
use rust_wheel::common::util::net::{sse_stream::SseStream, sse_message::SSEMessage};
use std::time::{Duration, SystemTime};
use tokio::{
    sync::mpsc::{UnboundedReceiver, UnboundedSender},
    task,
};

#[get("/sse/producer")]
pub async fn sse() -> impl Responder {
    let (tx, rx): (UnboundedSender<SSEMessage>, UnboundedReceiver<SSEMessage>) =
        tokio::sync::mpsc::unbounded_channel();
    task::spawn(async move {
        for _ in 0..5 {
            let message:SSEMessage = SSEMessage::from_data(&"data".to_string(),& "event_type".to_string());
            let send_result = tx.send(message);
            match send_result {
                Ok(_) => {

                }
                Err(err) => {
                    println!("get docs failed, {}", err);
                }
            }
            tokio::time::sleep(Duration::from_secs(1)).await;
        }
    });
    let response = HttpResponse::Ok()
        .content_type("text/event-stream")
        .streaming(SseStream { receiver: Some(rx) });
    response
}

#[actix_web::main]
async fn main() -> Result<(), std::io::Error> {
    HttpServer::new(|| App::new().service(sse).service(sse))
        .bind("<IP_ADDRESS>:8000")?
        .run()
        .await
}

and this is the cargo.toml:

[package]
name = "rust-learn"
version = "0.1.0"
edition = "2018"

[dependencies]
tokio = { version = "1.17.0", features = ["full"] }
serde = { version = "1.0.64", features = ["derive"] }
serde_json = "1.0.64"
actix-web = "4"
futures = "0.3"
eventsource = "0.5"
bytes = "1"
reqwest = { version = "0.11.20", features = ["stream"] }
tokio-stream = "0.1"
rust_wheel = { git = "https://github.com/jiangxiaoqiang/rust_wheel.git", branch = "diesel2.0" }
log4rs = "1.2.0"
log = "0.4.0"
actix-rt = "2.4.1"
futures-util = "0.3.28"

when I using EventSourcePolyfill to get the sse stram data like this:
import React from 'react';

const App: React.FC = () => {

  React.useEffect(() => {
    doLocal();
  },[]);

  const doLocal = () => {
    let eventSource = new window.EventSourcePolyfill('http://localhost:3000/sse/producer');
    eventSource.onopen = () => {

    }
    eventSource.onerror = (error:any) => {
      console.log(error)
      eventSource.close();
    }
    eventSource.onmessage = (msg: any) => {
      console.log("origin polly:",msg)
    };
  }
}

could not get the stream response.

Am I missing something?

This is a browser issue and does not relate to this module. I think this has since been fixed, though.


.Net: Update release pipeline to ensure only required packages are being marked as V1.0

This should just require dropping projects from the solution file


feat: Introduce visual clue

The type of this PR is: Feature

This PR resolves CX-2019
Description
This PR introduces the ability to add visual clues to the app.
Visual clues can be added as a pulsating dot and a "new" text (see screenshots).
!!showVisualClue("NewVisualClue") && <VisualClueDot />

!!showVisualClue("NewVisualClue") && <VisualClueText style={{ top: 14, right: -24 }} />

Whenever the user has seen the new feature setVisualClueAsSeen("ClueName") can be called to add the clue to the list of clues the user has seen (saved in GlobalStorage).
Screenshots:

PR Checklist (tick all before merging)

[x] I have included screenshots or videos to illustrate my changes, or I have not changed anything that impacts the UI.
[x] I have tested my changes on iOS and Android.
[x] I have added tests/stories for my changes, or my changes don't require testing/stories, or I have included a link to a separate Jira ticket covering the tests.
[x] I have added a feature flag, or my changes don't require a feature flag. (How do I add one?)
[x] I have documented any follow-up work that this PR will require, or it does not require any.
[x] I have added an app state migration, or my changes do not require one. (What are migrations?)
[x] I have added a changelog entry below or my changes do not require one.

To the reviewers 👀

[x] I would like at least one of the reviewers to run this PR on the simulator or device.

Changelog updates
Changelog updates

Cross-platform user-facing changes

Introduce visual clues - ole

iOS user-facing changes

Android user-facing changes

Dev changes

Warnings

:warning:

❌ An error occurred while validating your changelog, please make sure you provided a valid changelog.

  Generated by :no_entry_sign: dangerJS against 6b883ede650e7a3de3b7a94cced14f1bd43b93e2

sorry for being late on this. nice work!