Cannot get my local test baby-fleming to write files

I do the following to make sure I have a fresh configuration:

safe auth logout // Makes sure account is logged out before authd is terminated
safe auth stop // Stop the authenticator
safe vault killall // Stop any running vaults
safe auth clear // Clear the authenticator config
safe config clear // Clear config
safe auth install // Install latest version and maybe set default config files
safe vault install // Install latest version and maybe set default config files
safe auth restart // Restart the authenticator
safe vault run-baby-fleming --testing // Run the local test vaults and wait until the CPU drops from 100% to idle.

This allows me to successfully generate keypairs, keys, but where it fail is at safe files put.
Iā€™m not sure if this is due to a folder permission that is not sufficient or something else.

This is the error that Iā€™m getting:

user@user:~$ safe auth logout
Sending logout action request to authdā€¦
Logged out successfully

user@user:~$ safe auth stop
Stopping SAFE Authenticator daemon (safe-authd)ā€¦
Success, safe-authd (PID: 100581) stopped!
user@user:~$ safe vault killall
Success, all processes instances of safe_vault were stopped!

user@user:~$ safe auth clear
Credentials were succesfully cleared from /home/user/.local/share/safe-cli/credentials

user@user:~$ safe config clear

user@user:~$ safe auth install
Latest release found: safe-authd v0.0.11
Downloading https://safe-api.s3.eu-west-2.amazonaws.com/safe-authd-0.0.11-x86_64-unknown-linux-gnu.zipā€¦
[00:00:18] [========================================] 6.53MB/6.53MB (0s) Done
Installing safe-authd binary at /home/user/.safe/authd ā€¦
Setting execution permissions to installed binary ā€˜/home/user/.safe/authd/safe-authdā€™ā€¦
Done!

user@user:~$ safe vault install
Latest release found: safe_vault v0.25.1
Downloading https://safe-vault.s3.eu-west-2.amazonaws.com/safe_vault-0.25.1-x86_64-unknown-linux-musl.zipā€¦
[00:00:20] [========================================] 8.39MB/8.39MB (0s) Done
Installing safe_vault binary at /home/user/.safe/vault ā€¦
Setting execution permissions to installed binary ā€˜/home/user/.safe/vault/safe_vaultā€™ā€¦
Done!

user@user:~$ safe auth restart
Stopping SAFE Authenticator daemon (safe-authd)ā€¦
No running safe-authd process (with PID 100581) was found
Starting SAFE Authenticator daemon (safe-authd)ā€¦
safe-authd started (PID: 100953)
Success, safe-authd restarted!

user@user:~$ safe vault run-baby-fleming --testing
Storing vaultsā€™ generated data at /home/user/.safe/vault/baby-fleming-vaults
Launching local SAFE networkā€¦
Launching with vault executable from: /home/user/.safe/vault/safe_vault
Network size: 8 vaults
Launching genesis vault (#1)ā€¦
Genesis vault contact info: [ā€œ127.0.0.1:12000ā€]
Launching vault #2ā€¦
Launching vault #3ā€¦
Launching vault #4ā€¦
Launching vault #5ā€¦
Launching vault #6ā€¦
Launching vault #7ā€¦
Launching vault #8ā€¦
Done!
Setting up authenticator against local SAFE networkā€¦
Stopping SAFE Authenticator daemon (safe-authd)ā€¦
Success, safe-authd (PID: 100953) stopped!
Starting SAFE Authenticator daemon (safe-authd)ā€¦
safe-authd started (PID: 101056)
Creating a SafeKey with test-coinsā€¦
Sending account creation request to authdā€¦
Account was created successfully!
SafeKey created and preloaded with test-coins. Owner key pair generated:
Public Key = ad8cea5962be56cecf083495ee7d9eefba5b5c6fb7427558bbdc90a8adbeab03bcf7c3893ebf2c39365ab9bc9f9cd1d6
Secret Key = 30f157da4674426e9ed049f3cf58c809955f3414f36dba2662e388b0892b2b33

user@user:~$ Sending login action request to authdā€¦
Logged in successfully
Authorising CLI applicationā€¦
Waiting for authorising response from authdā€¦
SAFE CLI app was successfully authorised
Credentials were stored in /home/user/.local/share/safe-cli/credentials

user@user:~$ safe auth status
Sending request to authd to obtain a status reportā€¦
Ā±-----------------------------------------Ā±-------+
| SAFE Authenticator status | |
Ā±-----------------------------------------Ā±-------+
| Authenticator daemon version | 0.0.11 |
Ā±-----------------------------------------Ā±-------+
| Logged in to a SAFE account? | Yes |
Ā±-----------------------------------------Ā±-------+
| Number of pending authorisation requests | 0 |
Ā±-----------------------------------------Ā±-------+
| Number of notifications subscribers | 0 |
Ā±-----------------------------------------Ā±-------+

user@user:~$ safe keypair
Key pair generated:
Public Key = a6fb5f2301f0fe640ca4d8de6535b9979083840208eeb799850afa7dbed29fef4dcafee308a1e8d9752965a5e70aaa85
Secret Key = 8719ca687bbde478835ffd09f07733c889f2cd715848e4ad0fda2d2dfd7e1842

user@user:~$ safe keys create --test-coins --preload 777
New SafeKey created at: ā€œsafe://hbyyyybj79ze1pyuyueqhgudefbuju46w966tihfofy7jgn7omabzdkdjyā€
Preloaded with 777 coins
Key pair generated:
Public Key = a7bfba24d04c1343b8698d050cd33d7a9ff7a35e1605075261760bc06e350d204ba999c1dd3f9303cb6f493d67a4aef1
Secret Key = 1aa50214cca4566f312942d6b7c94af10c7139b029cf7aa31a712fcec5b78e5a

Apparently the commands like safe keys create and safe keypair are being returned pretty quickly and resolved successfully, but the safe files put seems to take a long time (time-out?) and then eventually returns:

user@user:~$ safe files put ./safetestfile.txt /safefolder
FilesContainer created at: ā€œsafe://hnyynyxafj63xcc5gizw1y9y9jpw9ap5sou9fqrrfrwh7z1y8boc7oinaebncā€
E ./safetestfile.txt <[Error] NetDataError - Failed to PUT Public ImmutableData: RequestTimeout - CoreError::RequestTimeout>

Which makes me think that the vaults that are building or using ton of CPU resources are unable to respond or maybe not yet finished? But the non-file commands are still able to respond.

Will these vaults keep running at 100% and increase memory until it runs out of memory?

2 Likes

Hey @ThreeSteps
Thanks for reaching out. Allow me to help you out here. It would be nice to see some logs from the vault processes as well. Could you repeat the above steps after setting the RUST_LOG env variable.

export RUST_LOG=safe=trace
// start network and put files

Could you share the terminal output and the contents of ~/.safe/vault/baby-fleming-vaults/safe-vault-*/safe_vault.log

Thanks in advance.

1 Like

Also, Iā€™d try with removing the ~/.safe/vault/baby-fleming-vaults folder and trying to run the section again afterwards.

1 Like

So Iā€™m able to put files successfully after the CPU is fully recovered to baseline when the run-baby-fleming --testing command is run.

Something that seems to be very important is when I do a fresh install of the .safe folder to NOT add or switch to any network, ā€œe.g. safe networks switch my-networkā€ or ā€œsafe networks switch shared-sectionā€.
What I thought was that only the shared-section would not work due to it being offline/only for IGD routers, so I always created a local network called ā€˜my-networkā€™ but this causes the CLI to throw permission errors for writing data. When I donā€™t add any network, like how .safe is installed by default, it allows me to do everything without errors!

I do the following then:
safe run-baby-fleming --testing
//Wait until CPU is done, can take quite some timeā€¦
safe auth restart
safe auth create-acc --test-coins
safe auth logout //This is important because it seems the account doesnā€™t login with --self-auth, this might be throwing permission errors
safe auth login --self-auth

Now I can successfully use all commands like safe files put myfile /mylocation

5 Likes

This topic was automatically closed after 60 days. New replies are no longer allowed.