1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
|
---
title: "Connector Troubleshooting"
sidebarTitle: "Troubleshooting"
description: "Diagnose and resolve common issues with Google Drive, Gmail, Notion, and OneDrive connectors"
icon: "wrench"
---
Quick guide to resolve common connector issues with authentication, syncing, and permissions.
## Quick Health Check
Check if your connectors are working properly:
<CodeGroup>
```typescript TypeScript
const connections = await client.connections.list({
containerTags: ['user-123']
});
connections.forEach(conn => {
console.log(`${conn.provider}: ${conn.email} - Connected ${conn.createdAt}`);
});
// Check for stuck documents
const documents = await client.connections.listDocuments('notion', {
containerTags: ['user-123']
});
const failed = documents.filter(doc => doc.status === 'failed');
if (failed.length > 0) {
console.log(`⚠️ ${failed.length} documents failed to sync`);
}
```
```python Python
connections = client.connections.list(container_tags=['user-123'])
for conn in connections:
print(f"{conn.provider}: {conn.email} - Connected {conn.created_at}")
# Check for stuck documents
documents = client.connections.list_documents(
'notion',
container_tags=['user-123']
)
failed = [doc for doc in documents if doc.status == 'failed']
if failed:
print(f"⚠️ {len(failed)} documents failed to sync")
```
```bash cURL
# List all connections
curl -X POST "https://api.supermemory.ai/v3/connections/list" \
-H "Authorization: Bearer $SUPERMEMORY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"containerTags": ["user-123"]}'
# Check document status
curl -X POST "https://api.supermemory.ai/v3/documents/list" \
-H "Authorization: Bearer $SUPERMEMORY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"containerTags": ["user-123"], "source": "notion"}'
```
</CodeGroup>
## Common Issues
### OAuth Callback Fails
**Problem:** "Invalid redirect URI" error after user grants permissions
**Solution:** Ensure your redirect URL matches EXACTLY what's configured in your OAuth app:
```typescript
// correct - exact match with OAuth app settings
const connection = await client.connections.create('notion', {
redirectUrl: 'https://yourapp.com/auth/notion/callback',
containerTags: ['user-123']
});
// Wrong - URL doesn't match
// redirectUrl: 'https://yourapp.com/callback'
```
**Prevention:**
- Use HTTPS for production URLs
- Copy the exact URL from your OAuth app settings
- Test the flow in development first
### Documents Not Syncing
**Problem:** Documents stuck in "queued" or "extracting" status for over 30 minutes
**Solution:** Trigger a manual sync:
```typescript
// Force sync for stuck documents
await client.connections.import('notion', {
containerTags: ['user-123']
});
```
If documents consistently fail:
- Check if files are over 50MB (may timeout)
- Verify you have permission to access the documents
- Ensure the document type is supported
### Permission Denied Errors
**Problem:** Some documents show "permission denied" or aren't syncing
**Solution:** Re-authenticate with proper permissions:
```typescript
// Delete and recreate connection
await client.connections.deleteByProvider('google-drive', {
containerTags: ['user-123']
});
const newConnection = await client.connections.create('google-drive', {
redirectUrl: 'https://yourapp.com/callback',
containerTags: ['user-123']
});
// User must re-authenticate
window.location.href = newConnection.authLink;
```
### Sync Takes Too Long
**Problem:** Hundreds of documents taking hours to sync
**Solution:** Set reasonable document limits:
```typescript
const connection = await client.connections.create('onedrive', {
redirectUrl: 'https://yourapp.com/callback',
containerTags: ['user-123'],
documentLimit: 500 // Start with fewer documents
});
```
## Provider-Specific Issues
### Google Drive
**Shared Drive Issues**
Shared drives require special permissions. Make sure:
- User has access to the shared drive
- OAuth app has drive.readonly scope
- User is a member of the shared drive
### Notion
**Database Not Syncing**
Notion databases need explicit permission. If databases aren't syncing:
1. Go to Notion workspace settings
2. Find your integration under "Connections"
3. Click on the integration
4. Select specific pages/databases to share
5. Re-sync after granting access
**Workspace Access**
For full workspace access, a workspace admin must:
1. Approve the integration
2. Grant access to all pages
3. Enable "Read content" permission
### OneDrive
**Business vs Personal Accounts**
Business accounts may have additional restrictions:
- Admin consent might be required
- Some SharePoint sites may be restricted
- Compliance policies may block certain files
### Gmail
**Real-time Sync Not Working**
If emails aren't syncing in real-time but scheduled/manual sync works:
1. Real-time sync uses Google Cloud Pub/Sub webhooks
2. Watch subscriptions expire after 7 days (supermemory auto-renews)
3. Only INBOX label triggers real-time updates
4. Trigger a manual sync to verify the connection is healthy:
```typescript
await client.connections.import('gmail', {
containerTags: ['user-123']
});
```
**Missing Refresh Token**
If Gmail stops syncing after initial setup:
1. The user may have revoked app access in Google Account settings
2. Delete and recreate the connection
3. Ensure user completes full OAuth consent flow
```typescript
// Re-authenticate to get fresh tokens
await client.connections.deleteByProvider('gmail', {
containerTags: ['user-123']
});
const newConnection = await client.connections.create('gmail', {
redirectUrl: 'https://yourapp.com/callback',
containerTags: ['user-123']
});
```
**Scale Plan Required Error**
Gmail connector requires Scale Plan or Enterprise Plan. If you see access errors:
- Verify your organization has the required plan
- Contact support to upgrade your plan
## Best Practices
1. **Set reasonable document limits** - Start with 500-1000 documents
2. **Use descriptive container tags** - Makes debugging easier
3. **Monitor failed documents** - Check weekly for sync issues
4. **Handle rate limits gracefully** - Implement exponential backoff
5. **Test OAuth in development** - Ensure redirect URLs work before production
|