Memo
April 12, 2022, 5:37pm
1
Hardware: Root Server by Netcup
YunoHost version: 4.3.6.3 (stable)
I have access to my server : Through SSH | through the webadmin | webmin | VNC
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : Changed SSH port.
Description of my issue
Successful Misskey upgrade on test server (VirtualBox test environment), but fails on productive server (Debian 10 Buster).
[Error] Upgrade failed.
sh: 0: getcwd() failed: No such file or directory
sh: 0: getcwd() failed: No such file or directory
sh: 0: getcwd() failed: No such file or directory
This action broke dpkg/APT (the system package managers)... You can try to solve this issue by connecting through SSH and running `sudo apt install --fix-broken` and/or `sudo dpkg --configure -a`.
No changes after runnig 'sudo apt install --fix-broken'
: 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
and 'sudo dpkg --configure -a'
Second upgrade also fails.
I also uninstalled two apps (Plume and Invidious) for testing because they also access the Postgres server. No changes.
Logfile: https://paste.yunohost.org/raw/olidifival
Most important log entries (I think):
2022-04-12 10:30:40,047: DEBUG - CannotExecuteNotConnectedError: Cannot execute operation on "default" connection because connection is not yet established.
2022-04-12 10:30:40,048: DEBUG - at DataSource.destroy (/var/www/misskey/packages/backend/node_modules/typeorm/data-source/DataSource.js:169:19)
2022-04-12 10:30:40,048: DEBUG - at Object.handler (/var/www/misskey/packages/backend/node_modules/typeorm/commands/MigrationRunCommand.js:67:34)
Memo
April 13, 2022, 12:26pm
2
Also, no changes after @jarods PR ( adding “ynh_use_nodejs” to the upgrade script).
Hi @Memo
I’m sorry, I didn’t take the time to look into the entire log (I have so little free time these days.)
I see this
The operation 'Remove the 'misskey' app' could not be completed
It’s the remove script that failed, see what is installed (in the install script) that didn’t get removed in the remove script. Reverse the order (what’s installed first should be removed last).
Good luck
Memo
April 13, 2022, 1:25pm
4
Thanks for this hint @jarod5001 , but I’m pretty new to YunoHost, so I’m afraid that’s beyond my knowledge.
But what I don’t understand with my little knowledge is why it worked on my test instance (installed according to the instruction on Install YunoHost | Yunohost Documentation )
but not on my productive server ¯_(ツ)_/¯
Memo
April 13, 2022, 4:22pm
5
Just a thought: One difference between my productive server and the Virtual-Box YunoHost installation is that all Debian packages are up to date on the productive server.
The Virtual-Box YunoHost installation was tested without Debian updates.
Memo
April 14, 2022, 6:13am
6
I don’t know if it’s relevant, but I updated Yarn just before:
Upgrade: yarn:amd64 (1.22.17-1, 1.22.18-1)
Memo
April 14, 2022, 9:57am
8
On the production server.
If there’s a way to undo this upgrade and go back to the latest one later, I’ll test it, but I don’t know how.
I think this update changed the yarn package from auto to manual. You can fix it with apt-mark
Memo
April 14, 2022, 12:35pm
11
Nope. It is still marked as auto.
Memo
April 14, 2022, 2:42pm
12
Johann (misskey-dev) sent a hint, this might be an issue in TypeORM:
opened 12:02PM - 12 Apr 22 UTC
bug
requires triage
<!--
Please follow the template. If you don't, your issue may be closed.
… Have a question? This is the TypeORM issue tracker - and not the right place
for general support or questions. Instead, check the "Support" Documentation
on the best places to ask questions!
https://github.com/typeorm/typeorm/blob/master/docs/support.md
-->
## Issue Description
When trying to run a migration on Postgres DB, the migrations fail to run with `CannotExecuteNotConnectedError: Cannot execute operation on "default" connection because connection is not yet established.
at DataSource.destroy (/home/assaf/Code/private/f3tw/src/data-source/DataSource.ts:284:19)
at Object.handler (/home/assaf/Code/private/f3tw/src/commands/MigrationRunCommand.ts:73:46)`
### Expected Behavior
All migrations should run as expected.
### Actual Behavior
No migrations are running, and an error is thrown:
```shell
> typeorm-ts-node-esm -d src/data-source.ts "migration:run"
query: SELECT * FROM current_schema()
typeorm-ts-node-esm migration:run
Runs all pending migrations.
Options:
-h, --help Show help [boolean]
-d, --dataSource Path to the file where your DataSource instance is defined.
[required]
-t, --transaction Indicates if transaction should be used or not for
migration run. Enabled by default. [default: "default"]
-v, --version Show version number [boolean]
CannotExecuteNotConnectedError: Cannot execute operation on "default" connection because connection is not yet established.
at DataSource.destroy (/home/assaf/Code/private/f3tw/src/data-source/DataSource.ts:284:19)
at Object.handler (/home/assaf/Code/private/f3tw/src/commands/MigrationRunCommand.ts:73:46)
```
### Steps to Reproduce
1. Create a migration
2. try to run it with `npm run typeorm migration:run`
my `datasource`:
```typescript
import "reflect-metadata";
import { DataSource } from "typeorm";
export const TestAppDataSource = new DataSource({
type: "postgres",
host: "localhost",
port: 5432,
username: "postgres",
password: "test",
database: "postgres",
logging: process.env.NODE_ENV !== "production",
entities: ["src/entity/*.{js,ts}"],
migrations: ["src/migration/*.{ts, ts}"],
});
```
From looking at the code in `src/commands/MigrationRunCommand.ts` it seems like it does call
[await dataSource.initialize()](https://github.com/typeorm/typeorm/blob/1197d1d61cb664b52ab38d26f7473fd5f1476ba5/src/commands/MigrationRunCommand.ts#L44-L45) so I have no idea where that problem is coming from.
### My Environment
~Might be related to the fact that I am using npm workspace and running inside one of the projects?~
It does work when using `typeorm-ts-node-commonjs` but not `typeorm-ts-node-esm`
| Dependency | Version |
| --- | --- |
| Operating System | Arch linux |
| Node.js version | 17.8.0 |
| Typescript version | 4.6.3 |
| TypeORM version | 0.3.5 |
### Additional Context
<!--
Add any other context about the bug report here.
-->
### Relevant Database Driver(s)
| DB Type | Reproducible |
|-------------------| --- |
| `aurora-mysql` | no |
| `aurora-postgres` | no |
| `better-sqlite3` | no |
| `cockroachdb` | no |
| `cordova` | no |
| `expo` | no |
| `mongodb` | no |
| `mysql` | no |
| `nativescript` | no |
| `oracle` | no |
| `postgres` | yes |
| `react-native` | no |
| `sap` | no |
| `sqlite` | no |
| `sqlite-abstract` | no |
| `sqljs` | no |
| `sqlserver` | no |
### Are you willing to resolve this issue by submitting a Pull Request?
- ✖️ Yes, I have the time, and I know how to start.
- ✅ Yes, I have the time, but I don't know how to start. I would need guidance.
- ✖️ No, I don’t have the time, but I can support (using donations) development.
- ✖️ No, I don’t have the time and I’m okay to wait for the community / maintainers to resolve this issue.
<!--
Remember that first-time contributors are welcome! 🙌
👋 Have a great day and thank you for the bug report!
-->
No I don’t think this is related to the update issue.
Since you have updated yarn, it’s may be what broke it.
Try making a backup of misskey, remove it, remove yarn, restore backup and launch the update.
Memo
April 14, 2022, 6:52pm
15
Made a backup, removed app Misskey, no yarn to remove on server, restored backup, update fails again.
Memo
April 14, 2022, 8:12pm
16
This solution might help:
opened 09:13AM - 12 Apr 22 UTC
⚠️bug?
<!--
Thanks for reporting!
First, in order to avoid duplicate Issues, please s… earch to see if the problem you found has already been reported.
-->
## 💡 Summary
**Upgrade fails with error:**
```
2022-04-12 10:30:40,047: DEBUG - CannotExecuteNotConnectedError: Cannot execute operation on "default" connection because connection is not yet established.
2022-04-12 10:30:40,048: DEBUG - at DataSource.destroy (/var/www/misskey/packages/backend/node_modules/typeorm/data-source/DataSource.js:169:19)
2022-04-12 10:30:40,048: DEBUG - at Object.handler (/var/www/misskey/packages/backend/node_modules/typeorm/commands/MigrationRunCommand.js:67:34)
```
## 📌 Environment
Misskey version: 12.109.2
Your OS: Debian 10 Buster
But the upgrade script would have to be revised for that?
1 Like
It’s working now. @ericg fixed it and the ci test passed. Can you confirm that the upgrade is OK for you?
Memo
April 15, 2022, 9:54am
18
No, unfortunately not. Exactly the same error messages
I called the upgrade with:
sudo yunohost app upgrade misskey -u https://github.com/YunoHost-Apps/misskey_ynh/tree/testing --debug
Correct?
ericg
April 15, 2022, 10:23am
19
You need to upgrade from the upgrade-fix
branch
sudo yunohost app upgrade misskey -u
https://github.com/YunoHost-Apps/misskey_ynh/tree/upgrade-fix --force
1 Like
Memo
April 15, 2022, 10:51am
20
system
Closed
April 30, 2022, 10:51am
21
This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.