-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: importTransactions results in timestamp error #1585
Comments
What API version are you using? I just tested against a local instance and also a remote instance. Both worked perfectly fine. var api = require('@actual-app/api');
const config = {
serverURL: 'http://localhost:5006',
password: 'password',
budgetId: '4e805261-6fdc-4c50-b5f3-fa34876644c8',
accountId: '76d2ed74-c606-41c2-8f5d-f18a6f99cadc',
};
(async () => {
await api.init(config);
await api.downloadBudget(config.budgetId);
await api.importTransactions(config.accountId, [{
date: "2024-08-23",
amount: 1200,
payee_name: "Kroger"
}]);
let budget = await api.getBudgetMonth('2023-08');
console.log(budget);
await api.shutdown();
})(); |
How can I determine the version? It is the version downloaded via "npm
install @actual-app/api".
I attempted your code just now and got an error "Segmentation fault".
Can I also double-check, is the accountId the string after
"http://server:port/accounts/" when you navigate to an account?
…On Sat, 26 Aug 2023 at 18:39, Matiss Janis Aboltins < ***@***.***> wrote:
What API version are you using? I just tested against a local instance and
also a remote instance. Both worked perfectly fine.
var api = ***@***.***/api');
const config = {
serverURL: 'http://localhost:5006',
password: 'password',
budgetId: '4e805261-6fdc-4c50-b5f3-fa34876644c8',
accountId: '76d2ed74-c606-41c2-8f5d-f18a6f99cadc',};
(async () => {
await api.init(config);
await api.downloadBudget(config.budgetId);
await api.importTransactions(config.accountId, [{
date: "2024-08-23",
amount: 1200,
payee: "Kroger"
}]);
let budget = await api.getBudgetMonth('2023-08');
console.log(budget);
await api.shutdown();})();
—
Reply to this email directly, view it on GitHub
<#1585 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE2HTLHQLGKZ6A7IQH4IMYDXXGY3ZANCNFSM6AAAAAA36FFT7M>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
The api version is 9.8.0
$ npm -v actual-app/api
9.8.0
On Sat, 26 Aug 2023 at 19:31, Nicholas Manojlovic <
***@***.***> wrote:
… How can I determine the version? It is the version downloaded via "npm
install @actual-app/api".
I attempted your code just now and got an error "Segmentation fault".
Can I also double-check, is the accountId the string after
"http://server:port/accounts/" when you navigate to an account?
On Sat, 26 Aug 2023 at 18:39, Matiss Janis Aboltins <
***@***.***> wrote:
> What API version are you using? I just tested against a local instance
> and also a remote instance. Both worked perfectly fine.
>
> var api = ***@***.***/api');
> const config = {
> serverURL: 'http://localhost:5006',
> password: 'password',
> budgetId: '4e805261-6fdc-4c50-b5f3-fa34876644c8',
> accountId: '76d2ed74-c606-41c2-8f5d-f18a6f99cadc',};
>
> (async () => {
> await api.init(config);
> await api.downloadBudget(config.budgetId);
>
> await api.importTransactions(config.accountId, [{
> date: "2024-08-23",
> amount: 1200,
> payee: "Kroger"
> }]);
>
> let budget = await api.getBudgetMonth('2023-08');
> console.log(budget);
>
> await api.shutdown();})();
>
> —
> Reply to this email directly, view it on GitHub
> <#1585 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AE2HTLHQLGKZ6A7IQH4IMYDXXGY3ZANCNFSM6AAAAAA36FFT7M>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
|
The latest version is 6.2.1 🤔 https://www.npmjs.com/package/@actual-app/api?activeTab=versions |
oh sorry, that was my mistake - it was just giving me the version of npm I
think.
$ npm list
nicholas@ /home/nicholas
├── @actual-app/[email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]
…On Sat, 26 Aug 2023 at 19:39, Matiss Janis Aboltins < ***@***.***> wrote:
The latest version is 6.2.1 🤔
***@***.***/api?activeTab=versions
—
Reply to this email directly, view it on GitHub
<#1585 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE2HTLFY2A7LBVNAY6Z75DDXXG73XANCNFSM6AAAAAA36FFT7M>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
The version numbers are masked @niko123456000 |
sorry! I replied by email, didn't know that was a thing ;) $ npm list |
I have the exact same set-up as you and things are working perfectly fine for me. So I'm not really sure what the issue might be.. Maybe try running my code snippet posted above against your server? If that doesn't work - an export of your budget (with redacted information) would be helpful. |
I have created a new budget file and I still get the same issues. If I keep init and downloadBudget I get a 'segementation fault' on node v20 or 'stack smashing detected' on node v18. in a last ditch attempt I installed node directly into Windows... (not WSL or Pop_OS): it worked. On Pop_OS I got an error that sqlite was built using a different package version but couldn't really figure out where that was coming from.. it wasn't in my package-lock.json file. |
I'm seeing the same error with
Fedora 38 (Docker container)
app.jslet api = require('@actual-app/api');
let data = require('/root/actual/my-data.json');
(async () => {
await api.init({
// Budget data will be cached locally here, in subdirectories for each file.
dataDir: '/tmp',
// This is the URL of your running server
serverURL: 'https://example.com',
// This is the password you use to log into the server
password: 'xxxxxxxxxxx'
});
// async function run() {
for (let account of data.accounts) {
console.log("account", account);
let acctId = await api.createAccount(account);
console.log("account id", acctId);
/*
await api.addTransactions(
acctId,
data.transactions
.filter(t => t.acctId === acctId)
.map(convertTransaction),
);
*/
}
// }
// await api.runImport('My-Budget', run);
await api.shutdown();
})(); |
I had the same issues all described here and the only thing that fixed it was downgrading to node v18.18.2 using nvm |
I'm having this same issue while initializing the API in I wonder if previous "cannot reproduce" attempts in this thread started with an empty I'm running node version |
This may not be an issue anymore - |
I'm reproducing this issue with the following minimal code:
Error:
Both with Node 18.20.3 and Node 20.15.0. Actual API version 6.8.2 |
Turns out you need to always run |
Not sure if this helps anyone but I was getting the Segmentation fault (core dumped) error and entering |
Confirmed ErnstHaagsman comment above that the work around is to use |
Verified issue does not already exist?
What happened?
Attempting to insert a transaction using the API results in an error.
Node.js: v20.5.1 on WSL2
Client version: v23.8.1
Server version: v23.8.1
What error did you receive?
Where are you hosting Actual?
Docker
What browsers are you seeing the problem on?
No response
Operating System
Linux
The text was updated successfully, but these errors were encountered: