Quantcast
Channel: Mobile - Couchbase Forums
Viewing all 1117 articles
Browse latest View live

Couchbase lite initial replication crashes

$
0
0

@jeremieburtin wrote:

Hi,

I have a question regarding the replication on couchbase-lite :

When I start a big replication, it seems to crash silently (I can’t find any log), and I have to start it again in order to get it running back. It fails mainly on old devices (iOS/Android), so I’m wondering if this has something to do with the device CPU being to much sought.

I have read this part of the documentation : https://docs.couchbase.com/couchbase-lite/current/java.html#replication (the part with Guaranteed Order Delivery / Maximum Throughput / Extreme Configurability ), but I don’t know if this has a link with my problem.

Here’s an extract of my code (java) starting the replication, if someone sees anything, feel free to correct me :slight_smile:

public static Replicator startReplication() {
    Log.i(TAG, "Replication Start with " + syncUsername);
    try {
        // Réinitialise le total
        notifDocumentTotal = 0;

        // Contrôle des données de réplications
        if(syncUrl == null || syncChannel == null) {
            throw new Exception("Informations du Replicator absentes");
        } else if(replicator != null) {
            Log.i(TAG, "Replication Exists");
            return replicator;
        }

        Endpoint targetEndpoint = null;
        try {
            targetEndpoint = new URLEndpoint(new URI(syncUrl));
        } catch (URISyntaxException e) {
            Log.e(TAG, e.getMessage());
            e.printStackTrace();
        }

        // Create replicators to push and pull changes to and from the cloud.
        ReplicatorConfiguration config = new ReplicatorConfiguration(database, targetEndpoint);
        // Limitation au channel de l'utilisateur
        config.setChannels(Collections.singletonList(syncChannel));
        config.setContinuous(true);
        config.setReplicatorType(ReplicatorConfiguration.ReplicatorType.PUSH_AND_PULL);
        // Authentification
        config.setAuthenticator(new BasicAuthenticator(syncUsername, syncPassword));

        // final CountDownLatch latch = new CountDownLatch(1);
        replicator = new Replicator(config);
        // Listener
        replicator.addChangeListener(new ReplicatorChangeListener() {
            @Override
            public void changed(ReplicatorChange change) {
                // Handling Errors
                CouchbaseLiteException error = change.getStatus().getError();
                if (error != null) {
                    Log.i(TAG, "ReplicatorChange error : " + error.getInfo());
                }

                // Activities
                syncReplicatorStatus = change.getStatus().getActivityLevel().toString();
                syncReplicatorProgressCompleted = change.getStatus().getProgress().getCompleted();
                syncReplicatorProgressTotal = change.getStatus().getProgress().getTotal();
                Log.i(TAG, "Replicator activity : " + change.getStatus().getActivityLevel());

                // Fin de réplication
                if(database != null && change.getStatus().getActivityLevel().toString().equals("IDLE")) {
                    // On force le décallage (bug CBL) en fin de réplication
                    syncReplicatorProgressCompleted = 100;
                    syncReplicatorProgressTotal = 100;
                    Log.i(TAG, "Database change count : " + database.getCount());
                }
            }
        });
        // Start replication.
        replicator.start();
    } catch (Exception e) {
        Log.e(TAG, e.getMessage());
        e.printStackTrace();
    }

    return replicator;
}

Thanks a lot

Posts: 2

Participants: 2

Read full topic


Announcing Couchbase Mobile 2.7 with Java Platform Support, Sync Gateway Write Scale Enhancements and more

$
0
0

@priya.rajagopal wrote:

Hey all
On behalf of the Couchbase Mobile team, happy to announce that Couchbase Mobile 2.7 is now GA and includes support for the following features

  • Java (non Android) platform support for Couchbase Lite
  • Enterprise-grade architectural enhancements in Sync Gateway
    ** Built-in High Availability of Import Processing
    ** Enhancements to Import Throughput including Linear scaling
    ** Improvements to Write Throughout
  • General Availability of predictive queries
  • Plus a number of bug fixes on Couchbase Lite and Sync Gateway , details of which are in platform specific release notes

Here are some quick links

Looking forward to your feedback on 2.7

Posts: 2

Participants: 1

Read full topic

Xcode 11.3 publication errors

$
0
0

@david2 wrote:

Hello,

Xcode has just updated to version 11.3.1 (11C504).
The application launches without problem during the tests but I cannot publish it.

XCode validation gives me the following errors:

1 - Unsupported Architectures. The executable for Pulse.app/Frameworks/CouchbaseLiteSwift.framework contains unsupported architectures ‘[x86_64, i386]’.

Bearing I followed the procedure well : " open the Build Phases tab, then select the > Add Run Script Build Phase option and past strip_frameworks.sh.

2 - Invalid Segment Alignment. The app binary at ‘Pulse.app/Frameworks/CouchbaseLiteSwift.framework/CouchbaseLiteSwift’ does not have proper segment alignment. Try rebuilding the app with the latest Xcode version.

I’m using version 2.6.3 but I don’t have a compliant version for xcode 11.3.1.

3 - The binary is invalid. The encryption info in the LC_ENCRYPTION_INFO load command is either missing or invalid, or the binary is already encrypted. This binary does not seem to have been built with Apple’s linker.

I did not have this error during my previous publication

Do you have an idea ?

Thank you

Posts: 1

Participants: 1

Read full topic

Automatic conflict resolution when upgrade to CouchbaseLite 2.1

$
0
0

@alexegli wrote:

The couchbase lite 2.x docs say it automatically resolves conflicts, will it automatically handle docs from older versions of couchbase lite that have conflicts in them already? Currently we are on couchbase lite 1.3.1 and sync gateway 1.3.1. Our couchbase data server is getting OOMs because we have some docs that have over 1000 revisions and over 1000 conflicts, and when one of these docs gets updated or retrieved from CBL sync gateway uses up a ton of CPU and mem doing something. Sync gateway should be limiting docs to 1000 revisions but for some reason it is not doing that, and CBL 1.3.1 is supposed to auto-resolve conflicts by just going with the longest branch and last updated, but it doesn’t seem to be doing that either and we end up with conflicting branches that are 100’s of revisions long even though we have no custom conflict handling code or logic. We are about to evaluate upgrading to CBL and sync gateway 2.x and the latest couchbase server, but I wanted to confirm that would actually solve our major issues with the current version of CBL and sync gateway.

Posts: 1

Participants: 1

Read full topic

_bulk_docs returns 400 - Bad JSON :: CBLite Push Replication Fails

$
0
0

@andrew.mclean wrote:

Our production users are getting failed push replications more and more often and I cannot diagnose this error.

Server: 5.0.1-5003-enterprise
Sync Gateway 1.5
CouchbaseLite: 1.4.1

Our production users are starting to get sync failures for unknown reasons. We have not changed anything related to our document schemas, and have no issues saving documents into CBLite. However when certain users sync (push replicate), The _bulk_docs api fails with this obscure error. I am using CBLReplicator to sync, so this _bulk_docs is all under the hood of the CBLLite library.

  1. How can I increase logging in CBLite iOS to see what the request body looks like in this API request?
  2. How can I increase logging in SyncGateway to understand what the “Bad JSON” source is?
  3. What else might throw this error? Is it possible the request body is TOO LARGE for the endpoint to handle in Sync Gateway?

Regards,

Andrew

Posts: 1

Participants: 1

Read full topic

Unknown Assembly - FLMutableArray_New on Xamarin Forms iOS

$
0
0

@Gramcito wrote:

Hello all,

Running Xamarin iOS app and when saving a document getting the following error:
FLMutableArray_New assembly: type: member:(null)

This happens when simply calling .SetArray on a new document, i.e.
var mutableDocument = new MutableDocument();
var cbArray = new MutableArrayObject();
cbArray.InsertString(0, “string 0”);
cbArray.InsertString(1, “string 1”);
mutableDocument.SetArray(“somearray”, cbArray);

(Just some dummy code created trying to debug.)

Installed: Couchbase Lite 2.7, and Couchbase Lite Support for iOS, Xamarin Form 4+

Might be missing something obvious but the CBL docs don’t exactly go into depth on saving documents. Any insights greatly appreciated.

G

Posts: 1

Participants: 1

Read full topic

Re-installing app doesn't create database from scratch

$
0
0

@glenn wrote:

Hi,

We are using couchbase lite & sync gateway in version of 2.6. Due to some problems, we needed to create a new bucket in a new vm. By the way, we haven’t change the sync gw configuration file, briefly everything remained same except the ip address of the sync gateway. Of course, we released a new mobile app by including this minor change.

However, when we checked the server, we noticed that some old data replicated to our new bucket. Our mobile developer stated that actual lite database might not be cleaned up at all (AppData folder couldn’t be deleted). In brief, our database corrupted with undesired data which is belong to past.

Note: We are developing for both UWP & Android and we saw that this issue happens only in Android.

Posts: 1

Participants: 1

Read full topic

Google Authentication - How to retrieve the session id of the newly create session?

$
0
0

@Maria_Nabil1 wrote:

I am creating a new user using the google authentication ,
but I have a problem when creating a new session for this user I can’t find the session_id of this session ,
How can I retrieve it please ?
Here is the code I am using :

            using (var httpClient = new HttpClient())
        {
            using (var request = new HttpRequestMessage(new HttpMethod("POST"), "http://localhost:4985/user/_session"))
            {
                request.Headers.TryAddWithoutValidation("accept", "application/json");

                request.Content = new StringContent("{ \"name\": \"Maria\", \"ttl\": 180}");
                request.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json");

                var response = await httpClient.SendAsync(request);
            }
        }
        return "";
    }

Thank you .

Posts: 1

Participants: 1

Read full topic


How to restrict duplicate entry in couchbase lite with flutter

$
0
0

@kiran wrote:

I am inserting new record in database, then performing save Document,
after every refreshing of code in flutter , the document count is increasing. Actual there are only 2 records , it is creating multiple duplicate entries.

Posts: 4

Participants: 2

Read full topic

Which method is better for document change listeners?

$
0
0

@Vishal_Vaishnav wrote:

There are so many methods used for document change events. Can anyone tell which method is more preferrable?
For example;

Query.addChangeListener
MessageEndpointListerner.addChangeListener
LiveQuery.addChangeListener
AbstractReplicator.addDocumentReplicationListener
AbstractReplicator.addChangeListener
Database.addChangeListener
Database.addDocumentChangeListener
Database.addDatabaseChangeListener
Database.addChangeListener
repl.addChangeListener

Posts: 7

Participants: 4

Read full topic

How to send a verification mail in C#?

$
0
0

@Maria_Nabil1 wrote:

How to send a verification mail to the user’s email before authentication ,
I want users to register in the application using their email ,
then I want to verify this email by sending a verification mail to this email and when the user go to the link sent in this mail his mail should be verified and authenticated .
Is this possible in couchbase or should I use another tool with couchbase ?
Thank you .

Posts: 4

Participants: 2

Read full topic

How to resolve - Database.Log.File.Config is null

$
0
0

@TinoMclaren wrote:

Good Morning

I have a .NET desktop client app using CB Lite 2.7 & replicating to SGW 2.7.

In Visual Studio output screen im seeing a ‘Database.Log.File.Config is null’ error, all logs seem to be there on the remote server, is this an error pertaining to my local machine?

Full error:

Id like to know if im set up right & how can I get rid of the error.

Posts: 1

Participants: 1

Read full topic

Connection close

Unable to build cblite for Enterprise

$
0
0

@natoman wrote:

Hello all, I’m attempting to build cblite so that it is capable of using enterprise features of Couchbase Lite. Specifically, I’d like to be able to inspect encrypted databases.

I found a preprocessor define that needs to be set to enable this, COUCHBASE_ENTERPRISE , and I’ve set it in the CMakeLists.txt file in the “cblite” subdirectory. After attempting to build with this new define, I found that SQLITE_HAS_CODEC also needed to be defined. That got me a bit further, but the build now cannot find an entire directory in the “vendor” subdirectory called “couchbase-lite-core-EE,” which I assume is an alternate version of the “couchbase-lite” submodule already present in that directory.

Can someone help me locate that repository so that I can build for enterprise? I would expect it to be located here: https://github.com/couchbase alongside “couchbase-lite-core,” but it isn’t.

FYI, I’ve also asked this question on the couchbase-mobile-tools Github page: https://github.com/couchbaselabs/couchbase-mobile-tools/issues/23

Posts: 6

Participants: 2

Read full topic

Select and group by "month"

$
0
0

@jda wrote:

Hi

I’m trying to present some “overview” data to the mobile users. So ideally, I would like to “transform” a N1QL query like this to CB Lite:

select sum(`count`) count,SUBSTR(date, 5,2) month from data 
where type="Catch" and userkey="2124DEFEC111BA8FC1257ED20034B387"
group by SUBSTR(date, 5,2)

But I’ve not been able to find a proper way to extract the month…

Any suggestions as to how to do this? - apart of “brute force” (retrieving all records and manually build the resultset)…

Posts: 5

Participants: 3

Read full topic


Sync Gateway High Server DCP Latency

$
0
0

@Giallon wrote:

Hello, we had a high Server DCP Latency and write processing the 01/29 at 3h am. Sync-gateway begin to consume memory the 01/29 at 3h30 pm. The 01/30 at 8h30 am, we decided to restart it. All functioned like it should. But this is not the first time this happens. We need to restart sync gateway every 2 days!!

Please, help us to understand this situation and how can we escape it in the future ??



Posts: 3

Participants: 2

Read full topic

database?.addChangeListener not work some time

$
0
0

@Vishal_Vaishnav wrote:

Database.addChangeListener not work some time in Coubaselite 1.4.4 .
Below is my code

    database?.addChangeListener { event ->
        //using for only changed documents
        Log.e("changes",""+event.changes)

       val query = database?.createAllDocumentsQuery()
        query?.allDocsMode = Query.AllDocsMode.ALL_DOCS
        var result: QueryEnumerator? = null
        result = query?.run()
        val it = result

        if (it != null) {
            arrayList.clear()

            while (it.hasNext()) {
                val row = it.next()
                if (row.documentId.startsWith("refill-device-SERIAL-")) {
                    obj = JSONObject(row.document.properties)
                    val canisters = gson.fromJson(obj.toString(), Canisters::class.java)
                    arrayList.add(canisters)
                }
            }
        }

        canistersArrayList.postValue(arrayList)
    }

Above code not fire sometime… What I should do if I want to get every change events from database?

Posts: 3

Participants: 3

Read full topic

Error in sync gateway logs

$
0
0

@pankaj.sharma wrote:

I am getting following error on sync gateway :

#50605: GET /xxxbucketnamexxx/_blipsync (as vvprodappdocstore)
2020-02-03T15:12:29.394Z [INF] HTTP+: #50605: --> 101 [54d8fc1f] Upgraded to BLIP+WebSocket protocol (as xxxusernamexxx) (0.0 ms)
2020-02-03T15:12:29.491Z [INF] HTTP: c:[54d8fc1f] #50605: --> BLIP+WebSocket connection error: unexpected EOF
2020-02-03T15:12:29.491Z [INF] HTTP: c:[54d8fc1f] #50605: --> BLIP+WebSocket connection closed
2020-02-03T15:12:29.492Z [ERR] c:[54d8fc1f] Invalid response to ‘changes’ message: RPY#1 – EOF. Body: – rest.(*blipSyncContext).Logf() at blip_sync.go:222

And and effect on the CBL side is one shot sync fails, then we restarts it but above error comes up again and app goes in infinite loop.

@priya.rajagopal/ @househippo Can you help on it.

Regards
Pankaj Sharma

Posts: 2

Participants: 2

Read full topic

Syncgateway missing channel access

$
0
0

@Sebastian_Single wrote:

Hi,

I’m facing issues with some large documents that have this format:

 "members": [<user_name_1>, ..., <user_name_n"],
"type": "group"

I create a channel for each group-document and allow access for each user that is listed in the members-array.
There is one document that contains about 1500 members and therefore grants lots of doc accesses resulting in this warning

access and role grants count: 1462 exceeds 50 for grants per doc warning threshold

This is what i get from the admin-api:

GET /{db}/_all_docs access=true channels=true

{
  "rows": [
    {
      "key": "test.group:test_channel",
      "id": "test.group:test_channel",
      "value": {
        "rev": "1-49feb57cd8dbf4fe5a8ebf3645bd1814",
        "channels": [
          "group:test_channel"
        ],
        "access": {
          "testmail@couchbase.de": [
            "group:test_channel"
          ],
          ... 1462 access-objects
        }
      }
    },
    {
      "key": "org.couchbase.user:testmail@couchbase.de",
      "id": "org.couchbase.user:testmail@couchbase.de",
      "value": {
        "rev": "1-f9e1af0746a1f8b2520d214d1a47fea1",
        "channels": [
          "user:testmail@couchbase.de"
        ],
        "access": {
          "testmail@couchbase.de": [
            "user:testmail@couchbase.de"
          ]
        }
      }
    },
.... other group-channels
  ],
"total_rows": 4,
 "update_seq": 8
}

My user “testmail@couchbase.de” has access to the channel “group:test_channel” and to his private user-document channel.
However the public api delivers another response as you can see here:

GET /{db}/_all_docs access=true channels=true

{
  "rows": [
    {
      "key": "org.couchbase.user:testmail@couchbase.de",
      "id": "org.couchbase.user:testmail@couchbase.de",
      "value": {
        "rev": "1-f9e1af0746a1f8b2520d214d1a47fea1",
        "channels": [
          "user:testmail@couchbase.de"
        ]
      }
    }
  ],
  "total_rows": 2,
  "update_seq": 8
}

The “group:test_channel” is missing and therefore i cannot see documents that are in this channel. This issue only occurs with this large group-document - 45k. I have tried different database configurations by setting enable_shared_bucket_access to false and to true, but it does not solve my issue. I don’t think that my metadata size exceeds the limit of 1MB or 20MB (depending on shared-bucket config).

This is my database config:

'test': {
            server: 'couchbase://server',
            bucket: 'test',
            username: '***'',
            password: '***',
            enable_shared_bucket_access: false,
            num_index_replicas: 0,
            users: {
              GUEST: {
                disabled: true,
                admin_channels: [],
              },
            },
            allow_conflicts: true,
            revs_limit: 20,
            sync,
          },
        }

Any hints whats wrong? Does this conecpt of group-documents play well with couchbase? How can I debug such issues?

Thanks

Posts: 2

Participants: 2

Read full topic

Permission Denied

$
0
0

@TinoMclaren wrote:

Test setup in docker: SGW 2.7 Server 6.5
Client: WPF app - Lite 2.7

Im loading an image from a file to MemoryStream , then im converting to a dumb array of bytes for my view to consume.

                    var blob = new Blob("image/jpeg", Avatar);// Avatar is a byte[] and was set during SelectImageFile()
                    NewDoc.SetBlob("Avatar", blob);

The exception occurs when I create 2 users who use the same image as the avatar. As these are simple byte arrays what could be going wrong?

CouchbaseLiteException (POSIXDomain / 13): Permission denied.

at LiteCore.Interop.NativeHandler.ThrowOrHandle()
at LiteCore.Interop.NativeHandler.Execute(C4TryLogicDelegate1 block)
at LiteCore.LiteCoreBridge.Check(C4TryLogicDelegate1 block)
at Couchbase.Lite.Blob.Install(Database db)
at Couchbase.Lite.Blob.FLEncode(FLEncoder* enc)
at LiteCore.Interop.FLSliceExtensions.FLEncode(Object obj, FLEncoder* enc)
at Couchbase.Lite.Internal.Serialization.MDict.FLEncode(FLEncoder* enc)
at LiteCore.Interop.FLSliceExtensions.FLEncode(Object obj, FLEncoder* enc)
at Couchbase.Lite.MutableDocument.<>c__DisplayClass20_0.b__0()
at Couchbase.Lite.Support.ThreadSafety.DoLocked(Action a)
at Couchbase.Lite.MutableDocument.Encode()
at Couchbase.Lite.Database.Save(Document doc, C4Document** outDoc, C4Document* baseDoc, Boolean deletion)
at Couchbase.Lite.Database.<>c__DisplayClass94_0.b__0()
at Couchbase.Lite.Support.ThreadSafety.DoLocked(Action a)
at Couchbase.Lite.Database.Save(Document document, Document baseDocument, ConcurrencyControl concurrencyControl, Boolean deletion)
at Couchbase.Lite.Database.Save(MutableDocument document, ConcurrencyControl concurrencyControl)
at Couchbase.Lite.Database.Save(MutableDocument document)
at Agy.Wpf.Views.AeTalentViewModel.Save() in C:\Users\mmcca\source\repos\agy\Agy.Wpf\Views\Talent\AeTalentViewModel.cs:line 671

Posts: 4

Participants: 3

Read full topic

Viewing all 1117 articles
Browse latest View live