You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/troubleshooting.md
+36-1Lines changed: 36 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,10 @@
7
7
|`Cannot connect to API at <url>`| API server is not running or URL is wrong | Check the server is running and verify `api.base` in config |
8
8
|`API returned non-JSON (HTTP ...)`| URL points to a non-API endpoint | Confirm the API base URL is correct (e.g., `http://host:8001`) |
9
9
|`Login failed (code=x)`| Wrong username or password | Check `api.username` and `api.password`|
10
+
|`No credentials provided and none found in config`| Credentials missing from all sources | Provide via CLI, environment, config file, or respond to the interactive prompt |
11
+
|`Failed to save token to keyring`| Keyring service unavailable or access denied | Ensure your system keyring service is running (GNOME Keyring on Linux, Keychain on macOS, Credential Manager on Windows) |
12
+
|`Failed to load token from keyring`| Keyring service unavailable or corruption | Try re-authenticating with `--username` and `--password` to resave the token |
13
+
|`Token refresh failed, re-authenticating`| Token expired and refresh was unsuccessful | The tool will automatically re-authenticate. This is normal behavior. |
10
14
|`No matching public accounts found`| MP IDs don't exist on the server | Use `target_mps = "all"` to discover available IDs |
11
15
|`No write permission to output directory`| Output directory is not writable | Change permissions with `chmod` or set a different `output_dir`|
12
16
|`Refresh task timeout`| WeChat content fetch took longer than 3 minutes | Re-run to retry. The article may become available later |
@@ -51,10 +55,41 @@ State files are automatically compacted when the line count exceeds 2× the numb
51
55
52
56
### Token expiry
53
57
54
-
werss-cli automatically re-authenticates on 401 responses. No configuration or manual intervention needed.
58
+
werss-cli automatically manages token expiry:
59
+
1. Checks token validity before each run (with 5-minute buffer)
60
+
2. If token is expired, attempts automatic refresh (if `refresh_token` is available)
61
+
3. If refresh fails, falls back to re-authentication using stored credentials
62
+
4. New token is automatically saved to system keyring
63
+
64
+
No manual intervention needed. The process is transparent to you.
65
+
66
+
### Credentials not saved between runs
67
+
68
+
If werss-cli prompts for credentials every run:
69
+
1. Check your system keyring service is running:
70
+
-**Linux**: `systemctl status gnome-keyring-daemon` or `systemctl status kwalletd`
71
+
-**macOS**: Keychain is typically always running
72
+
-**Windows**: Credential Manager should be available
73
+
2. Try explicitly providing credentials to force resave:
74
+
```bash
75
+
werss-cli --username admin --password secret
76
+
```
77
+
3. The token should now be saved and available on next run
55
78
56
79
## FAQ
57
80
81
+
**Q: Do I need to provide credentials every time?**
82
+
83
+
No. On the first run, you provide credentials once. They are used to obtain a token, which is then saved to your system keyring. On subsequent runs, werss-cli loads the token automatically and doesn't need credentials.
84
+
85
+
**Q: What if my keyring is not available?**
86
+
87
+
werss-cli will prompt you for credentials whenever the keyring is unavailable. You can also explicitly provide credentials via CLI flags or environment variables, which will always work.
88
+
89
+
**Q: Can I use werss-cli without a keyring system?**
90
+
91
+
The keyring integration is automatic and transparent. If your system doesn't have a keyring, werss-cli will fall back to prompting for credentials, but will still function normally.
92
+
58
93
**Q: Can I run werss-cli without a WeRSS server?**
59
94
60
95
No. werss-cli is a client for the WeRSS API. You need a running WeRSS server that handles WeChat scraping.
0 commit comments